Re: CPUfreq - udelay() interaction issues

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mathieu Desnoyers
Date: Saturday, April 24, 2010 - 6:58 am

* Saravana Kannan (skannan@codeaurora.org) wrote:
[...]

Not necessarily. Another way to do it: we could keep the udelay loop counter in
the task struct. When ondemand changes frequency, and upon migration, this
counter would be adapted to the current cpu frequency.


see hardirq.h:

/*
 * Are we running in atomic context?  WARNING: this macro cannot
 * always detect atomic context; in particular, it cannot know about
 * held spinlocks in non-preemptible kernels.  Thus it should not be
 * used in the general case to determine whether sleeping is possible.
 * Do not use in_atomic() in driver code.
 */
#define in_atomic()     ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_INATOMIC_BASE)

Sorry, your scheme is broken on !PREEMPT kernels.


This comment seems broken. in_atomic() can return true because preemption is
disabled, thus letting cpufreq interrupts coming in.


You mean this ?


Things like lock scalability and performance degradations comes to my mind. We
can expect some drivers to make very heavy use of udelay(). This should not
bring a 4096-core box to its knees. sched_setaffinity() is very far from being
lightweight, as it locks cpu hotplug (that's a global mutex protecting a
refcount), allocates memory, manipulates cpumasks, etc...


Nope, not on a multiprocessor system.

Thanks,

Mathieu



-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: CPUfreq - udelay() interaction issues, Mathieu Desnoyers, (Fri Apr 23, 11:40 am)
Re: CPUfreq - udelay() interaction issues, Arjan van de Ven, (Fri Apr 23, 12:22 pm)
Re: CPUfreq - udelay() interaction issues, Mathieu Desnoyers, (Fri Apr 23, 12:55 pm)
Re: CPUfreq - udelay() interaction issues, Saravana Kannan, (Fri Apr 23, 7:49 pm)
Re: CPUfreq - udelay() interaction issues, Saravana Kannan, (Fri Apr 23, 7:57 pm)
Re: CPUfreq - udelay() interaction issues, Pavel Machek, (Fri Apr 23, 10:56 pm)
Re: CPUfreq - udelay() interaction issues, Mathieu Desnoyers, (Sat Apr 24, 6:58 am)
Re: CPUfreq - udelay() interaction issues, Arjan van de Ven, (Sat Apr 24, 11:56 am)
Re: CPUfreq - udelay() interaction issues, Mathieu Desnoyers, (Sat Apr 24, 2:00 pm)
Re: CPUfreq - udelay() interaction issues, Arjan van de Ven, (Sat Apr 24, 4:20 pm)
Re: CPUfreq - udelay() interaction issues, Saravana Kannan, (Tue Apr 27, 4:41 pm)