Re: [PATCH] cpuset semaphore depth check optimize

Roman Zippel
2005-09-12T17:08:10Z

Hi,

On Mon, 12 Sep 2005, Paul Jackson wrote:

> I've got paths in __alloc_pages() and below that acquire cpuset_sem,
> but only rarely. I am not aware of any other global kernel lock
> that routinely shows up both _above_ and _below_ __alloc_pages on
> the stack. Normally such would be a big problem for numa scaling.
> This one avoids the scaling problem by only being on rare paths when
> called within __alloc_pages. But that means I can't test for bugs;
> I have to code so it is obviously right in the first place (not a
> bad idea in general ;).

Maybe I'm missing something, but why don't you use two locks?
One general management lock to create/insert/remove cpusets and a
low-level lock (maybe even a spinlock) which manages the state of an
active cpuset.
For that you have to figure out (and document) how the fields in the
cpuset structure are used in various situations.

bye, Roman