public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Robert Macaulay <robert_macaulay@dell.com>,
	Rik van Riel <riel@conectiva.com.br>,
	Craig Kulesa <ckulesa@as.arizona.edu>,
	linux-kernel@vger.kernel.org, Bob Matthews <bmatthews@redhat.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: Re: highmem deadlock fix [was Re: VM in 2.4.10(+tweaks) vs. 2.4.9-ac14/15(+stuff)]
Date: Fri, 28 Sep 2001 01:47:20 +0200	[thread overview]
Message-ID: <20010928014720.Z14277@athlon.random> (raw)
In-Reply-To: <20010928001321.L14277@athlon.random> <Pine.LNX.4.33.0109271605550.25667-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0109271605550.25667-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Thu, Sep 27, 2001 at 04:16:11PM -0700

On Thu, Sep 27, 2001 at 04:16:11PM -0700, Linus Torvalds wrote:
> 
> On Fri, 28 Sep 2001, Andrea Arcangeli wrote:
> However, your patch is racy:
> 
> > --- 2.4.10aa2/fs/buffer.c.~1~	Wed Sep 26 18:45:29 2001
> > +++ 2.4.10aa2/fs/buffer.c	Fri Sep 28 00:04:44 2001
> > @@ -194,6 +194,7 @@
> >  		struct buffer_head * bh = *array++;
> >  		bh->b_end_io = end_buffer_io_sync;
> >  		submit_bh(WRITE, bh);
> > +		clear_bit(BH_Pending_IO, &bh->b_state);
> 
> No way can we clear the bit here, because the submit_bh() may have caused
> the buffer to be unlocked and IO to have completed, and it is no longer
> "owned" by us - somebody else might have started IO on it and we'd be
> clearing the bit for the wrong user.

Moving clear_bit just above submit_bh will fix it (please Robert make
this change before testing it), because if we block in submit_bh in the
bounce, then we won't deadlock on ourself because of the pagehighmem
check, and all previous non-pending bh are ok too, (only the next are
problematic, and they're still marked pending_IO so we can't deadlock on
them).

So you can re-consider my approch, the design of the fix was ok, it was
just a silly implementation error.

Andrea

  parent reply	other threads:[~2001-09-27 23:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-26 13:38 VM in 2.4.10(+tweaks) vs. 2.4.9-ac14/15(+stuff) Craig Kulesa
2001-09-26 14:03 ` Andrea Arcangeli
2001-09-26 14:23   ` Rik van Riel
2001-09-26 14:49     ` Andrea Arcangeli
2001-09-26 18:17       ` Robert Macaulay
2001-09-26 18:36         ` Andrea Arcangeli
2001-09-27 22:13           ` highmem deadlock fix [was Re: VM in 2.4.10(+tweaks) vs. 2.4.9-ac14/15(+stuff)] Andrea Arcangeli
2001-09-27 22:55             ` J . A . Magallon
2001-09-27 23:16             ` Linus Torvalds
2001-09-27 23:18               ` Linus Torvalds
2001-09-27 23:37                 ` Andrea Arcangeli
2001-09-27 23:51                   ` Rik van Riel
2001-09-28  1:26                     ` Andrea Arcangeli
2001-09-28  1:28                     ` Linus Torvalds
2001-09-27 23:47               ` Andrea Arcangeli [this message]
2001-09-28  0:03                 ` Linus Torvalds
2001-09-28  0:11                   ` Andrea Arcangeli
2001-09-28  2:12                 ` Robert Macaulay
2001-09-28  2:24                   ` Andrea Arcangeli
2001-09-28 13:36                     ` Robert Macaulay
2001-09-28 14:02                     ` LILO causes segmentation fault and panic [was Re: highmem deadlock fix] Robert Macaulay
2001-09-28  0:08               ` highmem deadlock fix [was Re: VM in 2.4.10(+tweaks) vs. 2.4.9-ac14/15(+stuff)] Andrea Arcangeli

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=20010928014720.Z14277@athlon.random \
    --to=andrea@suse.de \
    --cc=bmatthews@redhat.com \
    --cc=ckulesa@as.arizona.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=riel@conectiva.com.br \
    --cc=robert_macaulay@dell.com \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox