Re: [RFC] [PATCH] Pre-emption control for userspace

From: Khalid Aziz
Date: Tue Mar 04 2014 - 17:45:31 EST


On 03/04/2014 03:23 PM, One Thousand Gnomes wrote:
Obvious bug

| Usage model is a thread mmaps this file during initialization. It then
| writes a 1 to the mmap'd file after it grabs the lock in its critical
| section where it wants immunity from pre-emption.

You need to write it first or you can be pre-empted taking the lock
before asking for immunity.

Ah, yes. Thanks, Alan!


Presumably you could equally use something to group tasks (say a control
group of some form) and implement voluntary pre-emption within the group
only when in user space. Ie they only pre-empt each other by yielding but
they can be pre-empted by other tasks outside the group ?


I had suggested that to database folks initially, but they use mutexes that are shared across processes and they do not believe they can control the environment in customer scenario where they can ensure right tasks will always be in the right control group. Besides they want to use a common mechanism across multiple OSs and pre-emption delay is already in use on other OSs. Good idea though.

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