linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.cz>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Mingming Cao <cmm@us.ibm.com>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	ocfs2-devel@oss.oracle.com, linux-mm@kvack.org
Subject: Re: generic_writepages & jbd2 and ext4
Date: Wed, 16 Nov 2022 16:36:44 +0100	[thread overview]
Message-ID: <20221116153644.7rqgb6a4nyei3ltz@quack3> (raw)
In-Reply-To: <20221116135016.GA9713@lst.de>

On Wed 16-11-22 14:50:16, Christoph Hellwig wrote:
> Hi all,
> 
> I've recently started looking into killing off the ->writepage method,
> and as an initial subproject kill of external uses of generic_writepages.
> One of the two remaining callers s in jbd2 and I'm a bit confused about
> it.
> 
> jbd2_journal_submit_inode_data_buffers has two comments that explicitly
> ask for ->writepages as that doesn't allocate data:
> 
> /*
>  * write the filemap data using writepage() address_space_operations.
>  * We don't do block allocation here even for delalloc. We don't
>  * use writepages() because with delayed allocation we may be doing
>  * block allocation in writepages().
>  */
> 
> 	/*
>          * submit the inode data buffers. We use writepage
> 	 * instead of writepages. Because writepages can do
> 	 * block allocation with delalloc. We need to write
> 	 * only allocated blocks here.
> 	 */
> 
> and these look really stange to me.  ->writepage and ->writepages per
> their document VM/VFS semantics don't different on what they allocate,
> so this seems to reverse engineer ext4 internal behavior in some
> way.  Either way looping over ->writepage just for that is rather
> inefficient.  If jbd2 really wants a way to skip delalloc conversion
> can we come up with a flag in struct writeback_control for that?
> 
> Is there anyone familiar enough with this code who would be willing
> to give it a try?

Yes, I've written that code quite a few years ago :) And I agree JBD2 is
abusing internal knowledge about ext4 here. So yes, writeback_control flag
so that we can propagate the information to ->writepages method should do
the trick. I'll have a look into that.

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


      reply	other threads:[~2022-11-16 15:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 13:50 Christoph Hellwig
2022-11-16 15:36 ` Jan Kara [this message]

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=20221116153644.7rqgb6a4nyei3ltz@quack3 \
    --to=jack@suse.cz \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cmm@us.ibm.com \
    --cc=hch@lst.de \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ocfs2-devel@oss.oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox