From: Dave Hansen <haveblue@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: miklos@szeredi.hu, hch@infradead.org, serue@us.ibm.com
Subject: Re: [RFC][PATCH 3/4] change mnt_writers[] spinlock to mutex
Date: Thu, 10 Jan 2008 11:10:49 -0800 [thread overview]
Message-ID: <1199992249.25690.24.camel@localhost> (raw)
In-Reply-To: <20080110190701.FF57BF50@kernel>
Missed the description on that one. Here it is:
We're shortly going to need to be able to block new
mnt_writers for long periods of time during a
superblock remount operation. Since this operation
can sleep, we can not use a spinlock. We opt for
a mutex instead.
This are very, very rarely contented, mostly because
they are per-cpu. So, this should be very close to
as fast as the spinlocks just with the added benefit
that we can sleep while holding them.
We also need to change the get_cpu_var() to use
__get_cpu_var() so that we don't disable preemption.
Otherwise, we'll be in_atomic() when we try to lock
the (sleepable) mutex. We only use the per-cpu data
for cache benefits and its per-cpuness is not part
of locking logic, so this is OK.
_
-- Dave
next prev parent reply other threads:[~2008-01-10 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 19:06 [RFC][PATCH 0/4] kill open files traverse on remount ro Dave Hansen
2008-01-10 19:06 ` [RFC][PATCH 1/4] use helper to set mnt_sb Dave Hansen
2008-01-10 19:07 ` [RFC][PATCH 2/4] change mnt_writers underflow protection logic Dave Hansen
2008-01-10 19:07 ` [RFC][PATCH 3/4] change mnt_writers[] spinlock to mutex Dave Hansen
2008-01-10 19:10 ` Dave Hansen [this message]
2008-01-10 19:07 ` [RFC][PATCH 4/4] check mount writers at superblock remount Dave Hansen
2008-01-10 21:47 ` [RFC][PATCH 0/4] kill open files traverse on remount ro Serge E. Hallyn
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=1199992249.25690.24.camel@localhost \
--to=haveblue@us.ibm.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=serue@us.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.