From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Manfred Spraul <manfred@colorfullife.com>
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 10:00:49 +0200 [thread overview]
Message-ID: <1317024050.9084.62.camel@twins> (raw)
In-Reply-To: <1316885838-12026-1-git-send-email-manfred@colorfullife.com>
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.
> + }
next prev parent reply other threads:[~2011-09-26 8:01 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 [this message]
2011-09-26 15:22 ` Manfred Spraul
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=1317024050.9084.62.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--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