mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel McNeil <daniel@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: "linux-aio@kvack.org" <linux-aio@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.3-rc2-mm1] __block_write_full patch
Date: 13 Feb 2004 16:02:04 -0800	[thread overview]
Message-ID: <1076716924.1956.113.camel@ibm-c.pdx.osdl.net> (raw)
In-Reply-To: <20040213154815.42e74cb5.akpm@osdl.org>

On Fri, 2004-02-13 at 15:48, Andrew Morton wrote:
> Daniel McNeil <daniel@osdl.org> wrote:
> >
> > My only concern is that a racing mpage_writepages(WB_SYNC_NONE)
> > with a mpage_write_pages(WB_SYNC_ALL) from a filemap_write_and_wait. 
> > Both could be processing the io_pages list, if the
> > mpage_writepages(WB_SYNC_NONE) moves a page that has locked buffers 
> > back to the dirty_pages list, then when the filemap_write_and_wait()
> > calls filemap_fdatawait, it will not wait for the page moved back
> > to the dirty list.
> 
> Yes.  I suspect we simply cannot get this right without insane locking. 
> We're trying to do something here which the writeback code simply does not
> and cannot generally do, namely write and wait upon IO and dirtyings which
> are initiated by other processes.
> 
> The best way to handle *all* this crap is to remove the address_space page
> lists completely and replace all these things with radix tree walks, but I
> never got onto that.  Sad.
> 
> Maybe we could implement some form of per-address_space serialisation which
> permts multiple WB_SYNC_NONE writers, but exclusive WB_SYNC_ALL writers. 
> That's basically an rwsem, but we don't want to block WB_SYNC_NONE
> processes if there's a sync in progress.
> 
> So WB_SYNC_NONE callers would use down_read_trylock() and WB_SYNC_ALL
> callers would use down_write().   That just fixes all this stuff up.
> 

This sounds like an interesting idea.  I'll take a look and see if
I can give it a try.

BTW, the 2.6.3-rc2-mm1 __block_write_full_page() almost already did
your option c) except for the "if (buffer_dirty())".  If the
buffer is in flight buffer_dirty would already be cleared, so
it would not call __set_page_dirty_nobuffers().

                if (wbc->sync_mode != WB_SYNC_NONE) {
                        lock_buffer(bh);
                } else {
                        if (test_set_buffer_locked(bh)) {
                                if (buffer_dirty(bh))
                                        __set_page_dirty_nobuffers(page);
                                continue;
                        }
                }
Thanks,

Daniel



  reply	other threads:[~2004-02-14  0:02 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12  9:57 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 11:13 ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 11:57   ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 12:09     ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 14:40       ` 2.6.3-rc2-mm1 Zwane Mwaikambo
2004-02-12 14:46         ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 14:47       ` 2.6.3-rc2-mm1 Anton Blanchard
2004-02-12 11:24 ` 2.6.3-rc2-mm1 Nick Piggin
2004-02-12 14:46   ` 2.6.3-rc2-mm1 Zwane Mwaikambo
2004-02-12 15:40   ` 2.6.3-rc2-mm1 Mark Haverkamp
2004-02-12 21:38     ` 2.6.3-rc2-mm1 Andrew Morton
2004-02-12 22:33     ` 2.6.3-rc2-mm1 Nick Piggin
2004-02-12 17:06 ` 2.6.3-rc2-mm1 (compile stats) John Cherry
2004-02-12 18:43 ` 2.6.3-rc2-mm1 Alistair John Strachan
2004-02-12 20:33 ` 2.6.3-rc2-mm1 (dm) Miquel van Smoorenburg
2004-02-12 21:28   ` Nathan Scott
2004-02-12 22:08     ` Miquel van Smoorenburg
2004-02-12 22:34     ` Andrew Morton
2004-02-13 16:29       ` Miquel van Smoorenburg
2004-02-13  0:04 ` 2.6.3-rc2-mm1 Torrey Hoffman
2004-02-14 10:36   ` 2.6.3-rc2-mm1 Terje Kvernes
2004-02-13 21:04 ` [PATCH 2.6.3-rc2-mm1] Daniel McNeil
2004-02-13 21:30 ` [PATCH 2.6.3-rc2-mm1] __block_write_full patch Daniel McNeil
2004-02-13 21:49   ` [PATCH 2.6.3-rc2-mm1] filemap_fdatawait patch Daniel McNeil
2004-02-13 22:38   ` [PATCH 2.6.3-rc2-mm1] __block_write_full patch Andrew Morton
2004-02-13 23:30     ` Daniel McNeil
2004-02-13 23:48       ` Andrew Morton
2004-02-14  0:02         ` Daniel McNeil [this message]
2004-02-18  1:02         ` [PATCH 2.6.3-rc2-mm1] address_space_serialize_writeback patch Daniel McNeil
2004-02-18  1:43           ` Andrew Morton
2004-02-18  1:47           ` Andrew Morton
2004-02-18 19:36             ` Daniel McNeil
2004-02-14  5:27 ` 2.6.3-rc2-mm1 Glenn Johnson

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=1076716924.1956.113.camel@ibm-c.pdx.osdl.net \
    --to=daniel@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®