All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@poochiereds.net>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Dave Chinner <david@fromorbit.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: Re: [GIT PULL] please pull file-locking related changes for v3.20
Date: Tue, 17 Feb 2015 11:29:56 -0800	[thread overview]
Message-ID: <CA+55aFxmeTp1L19Bnn4fjhyPvjQUMkfP2+KAgAcWoY6Uxrz41w@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFxwuHCr3evNEfpAE-jGG+279PnevvxscvG-8q4YiYEv-g@mail.gmail.com>

On Tue, Feb 17, 2015 at 11:13 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> That said, I'm not at all sure about the "we're stuck with it". We can
> improve the semantics without anybody noticing, because it's not like
> anybody could *depend* on the weaker semantics - they needed
> particular races and timings to hit anyway.

.. that said, it's true that we cannot do the FILE_LOCK_DEFERRED thing
for multiple blockers that already hold a lock. One of them has to
release its lock for other lockers to make progress. So I guess the
weak model of dropping a read lock before taking a write lock is
actually required.

That sleep in the middle with dropping the lock is still complete
crap, though. You can't do it. If you drop the lock, you have to
repeat the while cycle, not just sleep and continue.

Or just go to sleep, waiting for the conflicting lock to also be dropped.

So maybe just removing that whole "if (found) { reschedule }" - but
leaving the "drop early - is the right thing to do.

                          Linus

  parent reply	other threads:[~2015-02-17 19:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 10:55 [GIT PULL] please pull file-locking related changes for v3.20 Jeff Layton
2015-02-16 13:32 ` Kirill A. Shutemov
2015-02-16 14:00   ` Jeff Layton
2015-02-16 18:46     ` Linus Torvalds
2015-02-16 19:24       ` Linus Torvalds
2015-02-16 19:59         ` Jeff Layton
2015-02-17  0:02         ` Jeff Layton
2015-02-17  0:21           ` Linus Torvalds
2015-02-17  0:35             ` Jeff Layton
2015-02-17 19:08         ` J. Bruce Fields
2015-02-17 19:13           ` Linus Torvalds
2015-02-17 19:27             ` Jeff Layton
2015-02-17 19:41               ` Linus Torvalds
2015-02-17 19:45                 ` J. Bruce Fields
2015-02-17 20:12                 ` Jeff Layton
2015-02-17 20:17                   ` Linus Torvalds
2015-02-17 19:29             ` Linus Torvalds [this message]
2015-02-26 11:00             ` One Thousand Gnomes
2015-02-26 14:45               ` J. Bruce Fields
2015-02-26 15:09                 ` J. Bruce Fields

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=CA+55aFxmeTp1L19Bnn4fjhyPvjQUMkfP2+KAgAcWoY6Uxrz41w@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=jlayton@poochiereds.net \
    --cc=kirill@shutemov.name \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sasha.levin@oracle.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.