Skip to contentSkip to conversation

Query about loops_per_jiffy

DISCUSSION 胡杨树 1 participant 2 messages Jan 19, 2010 – Jan 22, 2010

lore
Share & tools
lore

胡杨树

author
#0 lore raw

Are you Alessandro Rubini of LINUX DEVICE DRIVER?

------------------ Original ------------------

From:  "Alessandro Rubini"<[email protected]>;
Date:  Tue, Jan 19, 2010 04:21 PM
To:  "914059751"<[email protected]>; 

Cc: "linux-arm-kernel"<[email protected]>;
Subject: Re: Query about loops_per_jiffy

Quoted 1 line

(loops_per_jiffy * HZ)/1000,000 will give a BogoMips value.

No, it will give a BogoLips (loops per second). A loop is two instructions, in ./arch/arm/lib/delay.S (function __delay) called by init/calibrate.c . To have bogomips you need to multiply by two.

Quoted 4 lines

then why calibrate_delay do it like the following:

    printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
            loops_per_jiffy/(500000/HZ),
            (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);

It's correct, using normal integer aritmetics care.

/alessandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100119/1790ee2f/attachment.htm>

author
#1 lore raw

Green hand apology for the unintended CC, I should make this query personal.

_____

???: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-arm-kernel-bounces at lists.infradead.org] ?? ??? ????: 2010?1?19? 21:38
???: Alessandro Rubini
??: linux-arm-kernel
??: Re: Query about loops_per_jiffy

Are you Alessandro Rubini of LINUX DEVICE DRIVER?

------------------ Original ------------------

From: "Alessandro Rubini"<[email protected]>;

Date: Tue, Jan 19, 2010 04:21 PM

To: "914059751"<[email protected]>;

Cc "linux-arm-kernel"<[email protected]>;

Subject: Re: Query about loops_per_jiffy

Quoted 1 line

(loops_per_jiffy * HZ)/1000,000 will give a BogoMips value.

No, it will give a BogoLips (loops per second). A loop is two instructions, in ./arch/arm/lib/delay.S (function __delay) called by init/calibrate.c .. To have bogomips you need to multiply by two.

Quoted 4 lines

then why calibrate_delay do it like the following:

    printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
            loops_per_jiffy/(500000/HZ),
            (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);

It's correct, using normal integer aritmetics care.

/alessandro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100122/fc3ec93b/attachment.htm>