Re: udelay() and BogoMips doubts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Gaurav

Read http://www.linux.com/howtos/BogoMips-2.shtml

Ketan

At 12:26 PM 8/13/2004, prasanna wakhare wrote:
Hi Gaurav,
The   answer about bogomips and calibrate_delay
should be given by big people in mailing list.

Kernel trusts its code,If the kernel code is
interrupted then control should be given return back
to kernel only,b'coz interrupt handler assumes that it
must be doing extremly critical and more important
work than any user process do.Its as simple as that.
Tell me one thing which kernel does is less important
than what user  process do!So if user process given
priority we are delaying some critical code and thus
degrading performance.Though the answer is more
involved.
I have'nt grep through calibrate_delay() code.
But udelay() as well mdelay() calls the __delay() loop
with argument loop,it executes nops for as below:
 rdtscl(bclock);/*reading current TSC */
        do
        {
                rep_nop();/*does NOP*/
                rdtscl(now);/*read TSC it must be
incremented by the value in which nops get executed*/

        } while ((now-bclock) < loops);/*iterate
TSC=loops times forget how much cycle nops taking*/
}
here loop is the argument  given by the udelay().
I think You go in detail throgh calibrate_delay().
And let me know also.
Forgive me if I made some dangerously wrong comments.
After all I'm also in learning phase.
Thanks
Prasanna




> Hi All, > > Thanks for your replies, but nobody answered about > "BogoMips" and "loop_per_second". > If somebody knows the details of BogoMips, please > let me know how it works and what is the role of it > in udelay() function. > > One more thing, as Prasanna said that while > returning back from interrupt, check is doing if we > are returning to kernel space or user space and then > scheduler is called only if we are returning to user > space and the time slot of current process has been > expired. Please let me know, in case we are > returning to kernel mode, why the scheduler is not > called if the time slot of current process has > expired, why such a decision is only taken if we are > returning to user process. If the scheduler is > called in this case also (when returning to kernel > space), then situation like while() loop in kernel > mode will not make the system hang. It will > definitely bring the performance down, but will not > give an impression of hanged system. Why scheduler > is not called while retuning to kernel mode. > > Regards, > Gaurav. > > > prasanna wakhare <prasannawakhare@xxxxxxxxx> wrote: > Hi, > Some facts about timer handler: > When Scheduler invokes in 2.4? At every timer > interrupt jiffies are incremented and check is made > if current process time slice is over or it is > waiting > for I/O ,so if its need_resched flag is set the > scheduler is invoked. > After this moment, > In case of code interrupt by a timer handler, at > IRET(interrupt return) the check is made whether the > code interrupted belongs to user land or kernel mode > , > If the code belongs to user land scheduler is > invoked > immediately, if code is of kernel mode the > interrupted > path is resume without invoking scheduler. > Please forgive me if i was wrong B'coz i think > something i missed out. > Prasanna. > > > > >>- If we go into infinte loop in kernel mode, > will > > the scheduler be > > called by timer interrupt once the time allocated > to > > current runing process > > expires ? Does the >> timer interrupt take care of > > it or will our system be > > hanged. If timer interrupt takes care of it, how > > does it do that ? > > > > Yes, the timer will interrupt the loop [unless > > ofcourse you disable all > > interrupts prior to looping], but it will *NOT* > take > > care of loop, once the > > timer interrupt service finishes, it returns to > the > > loop since the loop is > > running in kernel mode and kernel is > non-preemptible > > (except for > > interrupts) and the system will appear as if it is > > hanged. [No other > > processing will occur apart from interrupt > > servicing]. This is true till > > kernel 2.4. Dunno about 2.6 which has a > preemptible > > kernel. > > > > Correct me if i am wrong. > > > > For BogoMips visit > > http://www.tldp.org/HOWTO/BogoMips.html > > > > Ketan > > > > > > At 10:36 PM 8/10/2004, Gaurav Dhiman wrote: > > > > > >Hi, > > > > > >Can someone let me know the answers to my > following > > doubts: > > > > > > > > > > > >- I am reading the 6th chapter of Rubini's book > > (LDD), want to know about > > >the internals of udelay() function. How this > > function exactly works, I saw > > >its code at following link: > > > >http://lxr.linux.no/source/include/asm-i386/delay.h?v=2.4.21#L18 > > >but cud not understand it as I am not able to > find > > the definations of > > >__bad_ndelay and all other realted functions. The > > deceleration has been > > >given just before the defination of udelay() > > function, dont know where the > > >definition is. > > >Also let me know about BogoMips and how > > 'loop_per_second' is used in > > >udelay() macro. > > > > > >You can give me the links to some good articles > on > > this, I can read it > > >from there. > > > > > >Regards, > > >Gaurav. > > > > > > > > > > > >Do you Yahoo!? > > > >New > > > > >and Improved Yahoo! Mail - 100MB free storage! > > > > > > > > -- > > Kernelnewbies: Help each other learn about the > Linux > > kernel. > > Archive: > > http://mail.nl.linux.org/kernelnewbies/ > > FAQ: http://kernelnewbies.org/faq/ > > > > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > http://promotions.yahoo.com/new_mail > > -- > Kernelnewbies: Help each other learn about the Linux > kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers!




__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux