From: Matthew Wilcox <willy@infradead.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Karel Zak <kzak@redhat.com>,
linux-fsdevel@vger.kernel.org,
Kent Overstreet <kent.overstreet@gmail.com>
Subject: Re: [PATCH v2] proc/mounts: add cursor
Date: Thu, 9 Apr 2020 11:45:12 -0700 [thread overview]
Message-ID: <20200409184512.GX21484@bombadil.infradead.org> (raw)
In-Reply-To: <20200409141619.GF28467@miu.piliscsaba.redhat.com>
On Thu, Apr 09, 2020 at 04:16:19PM +0200, Miklos Szeredi wrote:
> Solve this by adding a cursor entry for each open instance. Taking the
> global namespace_sem for write seems excessive, since we are only dealing
> with a per-namespace list. Instead add a per-namespace spinlock and use
> that together with namespace_sem taken for read to protect against
> concurrent modification of the mount list. This may reduce parallelism of
It occurs to me that this is another place where something like Kent's
SIX locks would fit the bill. To recap, that was a mutex with Shared,
Intent-to-upgrade and eXclusive states. eXclusive and Shared are like
write and read states in our rwsem. The Intent state would allow other
Shared users to start, but no more Intent users. You'd have to upgrade
to eXclusive state to actually modify the list, so you might have to
wait for Shared users to finish the section. Might not work out well
in practice for this user, but thought it was worth mentioning.
prev parent reply other threads:[~2020-04-09 18:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 14:16 [PATCH v2] proc/mounts: add cursor Miklos Szeredi
2020-04-09 16:22 ` Aurélien Aptel
2020-04-09 16:50 ` Al Viro
2020-04-09 16:54 ` Al Viro
2020-04-09 18:30 ` Al Viro
2020-04-09 19:36 ` Miklos Szeredi
2020-04-09 18:45 ` Matthew Wilcox [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=20200409184512.GX21484@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=kent.overstreet@gmail.com \
--cc=kzak@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).