From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Theodore Tso <tytso@mit.edu>
Cc: cmm@us.ibm.com, sandeen@redhat.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH -V2] ext4: Drop mapped buffer_head check during page_mkwrite
Date: Mon, 31 Aug 2009 18:03:14 +0530 [thread overview]
Message-ID: <20090831123313.GA21973@skywalker.linux.vnet.ibm.com> (raw)
In-Reply-To: <20090831122448.GG20822@mit.edu>
On Mon, Aug 31, 2009 at 08:24:48AM -0400, Theodore Tso wrote:
> On Mon, Aug 31, 2009 at 12:00:06PM +0530, Aneesh Kumar K.V wrote:
> > Below are the possibilities i looked at
> >
> > a) mmap with no parallel write to the same offset. That would mean
> > we don't have attached buffer heads because nobody attach buffer
> > heads to the page.
> >
> > b) mmap happening to the hole. The buffer heads are not mapped.
> >
> > c) mmap with parallel write to the same offset. The parallel write
> > did attach mapped buffer heads to the same page. So we should find
> > all buffer heads mapped in the above case.
> >
> > if we will find buffer heads already be mapped in many workloads then
> > i guess it make sense to add page lock. It will also avoid the
> > journal_start that we do in write_begin. I will redo the patch
>
> The usage case I was worried about is the one where we are mmap'ing an
> existing file (say, like an Oracle or DB2 table space, or a berkdb
> database file), and we are writing into already allocated blocks. In
> that case (which does use these code paths, right?) the second time we
> write a particular page, the buffer heads will already be mapped.
If the database is not being updated via a write(2), then even though
the blocks are already allocated, we won't find buffer_heads attached to the page.
ie, page_buffers(page) will be NULL
The page_mkwrite -> write_begin path would be allocating the buffer_heads
and attaching them to the page. So even in the above case we will be
doing write_begin -> write_end. That is, it is similar to the (a) i wrote
above.
>
> For database applications where we aren't loading a table, but just
> making changes to an already instantiated table, the buffer heads
> would be mapped most of the time, would they not?
>
> - Ted
-aneesh
next prev parent reply other threads:[~2009-08-31 12:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-26 5:23 [PATCH -V2] ext4: Drop mapped buffer_head check during page_mkwrite Aneesh Kumar K.V
2009-08-29 2:26 ` Theodore Tso
2009-08-31 6:30 ` Aneesh Kumar K.V
2009-08-31 12:24 ` Theodore Tso
2009-08-31 12:33 ` Aneesh Kumar K.V [this message]
2009-08-31 12:50 ` Theodore Tso
2009-08-31 17:06 ` Aneesh Kumar K.V
2009-09-06 3:49 ` Theodore Tso
2009-09-07 12:22 ` Aneesh Kumar K.V
2009-09-07 9:44 ` [PATCH -v3] ext4: Take page lock before looking at attached buffer_heads flags Aneesh Kumar K.V
2009-09-10 3:25 ` Theodore Tso
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=20090831123313.GA21973@skywalker.linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=cmm@us.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/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.