From: Arnd Bergmann <arnd@arndb.de>
To: Steven Whitehouse <steve@chygwyn.com>
Cc: Matthew Wilcox <willy@linux.intel.com>,
Christoph Hellwig <hch@lst.de>,
Trond Myklebust <trond.myklebust@fys.uio.no>,
"J. Bruce Fields" <bfields@fieldses.org>,
Miklos Szeredi <mszeredi@suse.cz>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>, John Kacur <jkacur@redhat.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Steve French <sfrench@us.ibm.com>
Subject: Re: [PATCH 2/2] [RFC] Remove BKL from fs/locks.c
Date: Thu, 15 Apr 2010 17:17:15 +0200 [thread overview]
Message-ID: <201004151717.15881.arnd@arndb.de> (raw)
In-Reply-To: <1271342931.7196.120.camel@localhost.localdomain>
On Thursday 15 April 2010, Steven Whitehouse wrote:
> Some comments...
I'll wait for Willy to comment on most of these, except
> On Wed, 2010-04-14 at 22:36 +0200, Arnd Bergmann wrote:
> > @@ -1467,12 +1492,9 @@ int vfs_setlease(struct file *filp, long arg, struct file_lock **lease)
> > {
> > int error;
> >
> > - lock_kernel();
> > - if (filp->f_op && filp->f_op->setlease)
> > - error = filp->f_op->setlease(filp, arg, lease);
> > - else
> > - error = generic_setlease(filp, arg, lease);
> > - unlock_kernel();
> > + lock_flocks();
> > + error = __vfs_setlease(filp, arg, lease);
> > + unlock_flocks();
> >
> This looks to me like generic_setlease() or whatever fs specific
> ->setlease() there might be will be called under a spin lock. That
> doesn't look right to me.
>
> Rather than adding locking here, why not push the BKL down into
> generic_setlease() and ->setlease() first, and then eliminate it on a
> case by case basis later on? That is the pattern that has been followed
> elsewhere in the kernel.
Sounds fair. Besides generic_setlease (which is in this file as well),
the only non-trivial one is cifs_setlease (Cc'ing Steve French now)
and that calls generic_setlease in the end.
If we can show that cifs_setlease does not need locking, the new lock
could be put into generic_setlease directly.
Arnd
next prev parent reply other threads:[~2010-04-15 15:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-14 20:36 [PATCH 1/2] [RFC] block: replace BKL with global mutex Arnd Bergmann
2010-04-14 20:36 ` Arnd Bergmann
2010-04-14 20:36 ` [PATCH 2/2] [RFC] Remove BKL from fs/locks.c Arnd Bergmann
2010-04-14 20:52 ` Trond Myklebust
2010-04-14 21:04 ` J. Bruce Fields
2010-04-15 20:36 ` Arnd Bergmann
2010-04-15 4:14 ` Brad Boyer
2010-04-15 14:48 ` Steven Whitehouse
2010-04-15 15:17 ` Arnd Bergmann [this message]
2010-04-14 22:48 ` [PATCH 1/2] [RFC] block: replace BKL with global mutex Douglas Gilbert
2010-04-15 7:11 ` Arnd Bergmann
2010-04-15 13:15 ` Douglas Gilbert
2010-04-15 14:29 ` Arnd Bergmann
2010-04-15 20:03 ` Kai Makisara
2010-04-15 20:51 ` [PATCH] scsi/st: remove BKL from open Arnd Bergmann
2010-04-30 2:18 ` Frederic Weisbecker
2010-04-30 19:03 ` Kai Makisara
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=201004151717.15881.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=bfields@fieldses.org \
--cc=fweisbec@gmail.com \
--cc=hch@lst.de \
--cc=jkacur@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mszeredi@suse.cz \
--cc=sfrench@us.ibm.com \
--cc=steve@chygwyn.com \
--cc=trond.myklebust@fys.uio.no \
--cc=willy@linux.intel.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.