Re: 2.6.16-rc6-mm2

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

 



On Tue, 13 Jun 2006 15:08:40 +1000
Keith Owens <[email protected]> wrote:

> Andi Kleen (on Tue, 13 Jun 2006 06:56:45 +0200) wrote:
> >
> >> I have previously suggested a lightweight solution that pins a process
> >> to a cpu 
> >
> >That is preempt_disable()/preempt_enable() effectively
> >It's also light weight as much as these things can be.
> 
> The difference being that preempt_disable() does not allow the code to
> sleep.  There are some places where we want to use cpu local data and
> the code can tolerate preemption and even sleeping, as long as the
> process schedules back on the same cpu.

It would be easy to use this mechanism wrongly:

	thread 1 on CPU N		thread 2 on CPU N

	foo = per_cpu(...)
	<preempt>
					foo = per_cpu(...);
					foo++;
					per_cpu(...) = foo;
					<unpreempt>
	foo++;
	per_cpu(...) = foo;	// whoops


In which scenarios did you envisage it being used?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux