[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=FOz1UZw8pbYA7Tb7b1q4O1=WRL3fzOuN0E0wX@mail.gmail.com>
Date: Sun, 26 Dec 2010 20:05:57 +0800
From: Hillf Danton <dhillf@...il.com>
To: Rakib Mullick <rakib.mullick@...il.com>
Cc: linux-kernel@...r.kernel.org, mingo@...hat.com
Subject: Re: [PATCH v0] add nano semaphore in kernel
On Sun, Dec 26, 2010 at 5:08 PM, Rakib Mullick <rakib.mullick@...il.com> wrote:
> On Sun, Dec 26, 2010 at 1:04 PM, Hillf Danton <dhillf@...il.com> wrote:
>> On Sun, Dec 26, 2010 at 2:46 PM, Rakib Mullick <rakib.mullick@...il.com> wrote:
>>> On Sun, Dec 26, 2010 at 11:13 AM, Hillf Danton <dhillf@...il.com> wrote:
>>> Above description tells how its done, what it is but its not clear why
>>> we should use it. Can I know why should we use it or its benefits?
>>>
>>
>> The outstanding benefit looks that nano semaphore could be used in
>> cases where callers want to wait not only more than one jiffy, but far
>> less than one jiffy also.
>>
> But, how do we know that resources are going to be available within
> one jiffy or far less than one jiffy? We we be deterministic?
>
This is a really hard question.
Though I could not answer as fine as Ingo Molnar could, the
deterministic has to be faced by most contentions for resources in
kernel, simply because deadlock could occur in spin lock for instance.
On the other hand, this question explores a byproduct advantage, not
seriously considered before, of nano semaphore, that the caller could
learn that there is something out of track if she waited over 100
microseconds in 5 consequent steps, 20 microseconds a step, if she
think the resource should be available in 60 microseconds.
And in nano semaphore method is available for callers to select
waiting over one second, one millisecond, one microsecond, one
nanosecond, depending on what the underlying system could offer. After
waiting, the caller is free to determine what to do next if the
resource is not available.
Here is another sample, if taxi will not come in two minutes, I could
either give up shopping downtown, or wait another three minutes,
depending on what will happen two minutes later.
thanks
Hillf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists