lkml.org 
[lkml]   [2007]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: is minimum udelay() not respected in preemptible SMP kernel-2.6.23?
Andi Kleen wrote:
> On Thursday 08 November 2007 01:20, Matt Mackall wrote:
>
>> On Wed, Nov 07, 2007 at 12:30:45PM -0800, Andrew Morton wrote:
>>
>>> Ow. Yes, from my reading delay_tsc() can return early (or after
>>> heat-death-of-the-universe) if the TSCs are offset and if preemption
>>> migrates the calling task between CPUs.
>>>
>>> I suppose a lameo fix would be to disable preemption in delay_tsc().
>>>
>> preempt_disable is lousy documentation here. This and other cases
>> (lots of per_cpu users, IIRC) actually want a migrate_disable() which
>> is a proper subset. We can simply implement migrate_disable() as
>> preempt_disable() for now and come back later and implement a proper
>> migrate_disable() that still allows preemption (and thus avoids the
>> latency).
>>
>
> We could actually do this right now. migrate_disable() can be just changing
> the cpu affinity of the current thread to current cpu and then restoring it
> afterwards. That should even work from interrupt context.
>
> get_cpu() etc. could be changed to use this then too.
>
>

What if some other thread calls sched_setaffinity() on the
migrate_disable()d cpu? we'd need to detect this to avoid
migrate_enable() stomping on sched_setaffinity()'s work.


--
error compiling committee.c: too many arguments to function

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-08 12:51    [W:0.150 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site