From: Manfred Spraul <manfred@colorfullife.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Mike Galbraith <efault@gmx.de>
Subject: Re: [PATCH 3/3] [RFC] ipc/sem.c: replace busy loop with completion
Date: Mon, 26 Sep 2011 17:22:26 +0200 [thread overview]
Message-ID: <4E8098B2.8000705@colorfullife.com> (raw)
In-Reply-To: <1317024050.9084.62.camel@twins>
On 09/26/2011 10:00 AM, Peter Zijlstra wrote:
> On Sat, 2011-09-24 at 19:37 +0200, Manfred Spraul wrote:
>
> sma = sem_lock(ns, semid);
>
>> @@ -1456,8 +1414,17 @@ sleep_again:
>> /*
>> * Wait until it's guaranteed that no wakeup_sem_queue_do() is ongoing.
>> */
>> - error = get_queue_result(&queue);
>> -
>> + error = queue.status;
>> + if (error != -EINTR) {
>> + /* If there is a return code, then we can leave immediately. */
>> + if (!IS_ERR(sma)) {
>> + sem_unlock(sma);
>> + }
>> + /* Except that we must wait for the hands-off */
>> + wait_for_completion(&queue.done);
>> + goto out_free;
> you just lost a sem_unlock() in the IS_ERR() case.
>
>> + }
If IS_ERR(), then sem_lock() failed - thus there must be no unlock.
--
Manfred
prev parent reply other threads:[~2011-09-26 15:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-24 17:37 [PATCH 3/3] [RFC] ipc/sem.c: replace busy loop with completion Manfred Spraul
2011-09-26 8:00 ` Peter Zijlstra
2011-09-26 15:22 ` Manfred Spraul [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E8098B2.8000705@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox