From: Hugh Dickins <hugh@veritas.com>
To: mingming cao <cmm@us.ibm.com>
Cc: Andrew Morton <akpm@digeo.com>, <linux-kernel@vger.kernel.org>,
<dipankar@in.ibm.com>
Subject: Re: [PATCH]IPC locks breaking down with RCU
Date: Sun, 20 Oct 2002 18:27:25 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.44.0210201809490.2106-100000@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44.0210201346180.1710-100000@localhost.localdomain>
On Sun, 20 Oct 2002, Hugh Dickins wrote:
>
> This looks very good to me: I'm glad you found the RCU idea works out.
> ...
> And I'd be happier to see ipc_unlock without those conditionals i.e.
> delete the "if(lid >= ids->size) return;" and the "if (out)" - they
> seem to encourage calling ipc_unlock where ipc_lock did not succeed,
> but that would be unsafe. If you found somewhere that's being done,
> I think we need to fix that place, not work around it in ipc_unlock.
Sorry, MingMing, it doesn't look so good to me now.
The "if(lid >= ids->size) return;" still looks unnecessary,
but I think I see why you have "if (out)" in ipc_unlock: because
of ipc_rmid, which has already nulled out entries[lid].p, yes?
A minor point is, wouldn't that skipping of spin_unlock leave you
with the wrong preempt count, on a CONFIG_PREEMPT y configuration?
But that's easily dealt with.
A much more serious point: we could certainly bring the ipc_rmid
and ipc_unlock much closer together; but however close we bring them
(unlock implicit within rmid), there will still be a race with one
cpu in ipc_lock spinning on out->lock, while we in ipc_rmid null
entries[lid].p and unlock and free the structure containing that lock.
I think you're going to have to extend RCU to freeing the entry
(though this is a much less exceptional case than growing the array,
so less clear to me that RCU is appropriate here), if you're to
avoid reverting to the earlier rwlock or embedded spinlock designs.
Perhaps there's a simpler solution - ask around - but I don't see it.
Hugh
next prev parent reply other threads:[~2002-10-20 17:20 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-18 0:14 mingming cao
2002-10-20 13:14 ` Hugh Dickins
2002-10-20 17:27 ` Hugh Dickins [this message]
2002-10-21 18:11 ` mingming cao
2002-10-21 19:00 ` Hugh Dickins
2002-10-24 21:49 ` [PATCH]updated ipc lock patch mingming cao
2002-10-24 22:29 ` Andrew Morton
2002-10-24 22:56 ` Hugh Dickins
2002-10-24 23:30 ` Andrew Morton
2002-10-24 23:59 ` Hugh Dickins
2002-10-25 0:35 ` [Lse-tech] " Rick Lindsley
2002-10-25 1:07 ` Robert Love
2002-10-25 0:07 ` mingming cao
2002-10-25 0:24 ` Andrew Morton
2002-10-25 4:18 ` Rusty Russell
2002-10-25 5:53 ` mingming cao
2002-10-25 7:27 ` Rusty Russell
2002-10-25 5:36 ` Manfred Spraul
2002-10-25 16:53 ` Rik van Riel
2002-10-24 23:23 ` mingming cao
2002-10-25 14:21 ` [Lse-tech] " Paul Larson
2002-10-25 17:17 ` mingming cao
2002-10-25 18:20 ` Paul Larson
2002-10-25 18:51 ` mingming cao
2002-10-25 19:06 ` Paul Larson
2002-10-25 20:14 ` mingming cao
2002-10-25 20:23 ` Manfred Spraul
2002-10-25 0:38 ` Cliff White
2002-10-31 17:52 ` [Lse-tech] Re: [PATCH]updated ipc lock patch [PERFORMANCE RESULTS] Bill Hartner
2002-10-21 19:18 ` [PATCH]IPC locks breaking down with RCU Dipankar Sarma
2002-10-21 19:36 ` Hugh Dickins
2002-10-21 19:41 ` mingming cao
2002-10-21 20:14 ` Dipankar Sarma
2002-10-21 18:07 ` mingming cao
2002-10-21 19:23 Manfred Spraul
2002-10-21 20:10 ` Hugh Dickins
2002-10-21 20:34 ` mingming cao
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=Pine.LNX.4.44.0210201809490.2106-100000@localhost.localdomain \
--to=hugh@veritas.com \
--cc=akpm@digeo.com \
--cc=cmm@us.ibm.com \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®