From: Michal Hocko <mhocko@kernel.org>
To: Jan Kara <jack@suse.cz>
Cc: Vlastimil Babka <vbabka@suse.cz>,
akpm@linux-foundation.org, zhouxianrong@huawei.com,
Mi.Sophia.Wang@huawei.com, hannes@cmpxchg.org,
kirill.shutemov@linux.intel.com, mgorman@techsingularity.net,
minchan@kernel.org, viro@zeniv.linux.org.uk, weidu.du@huawei.com,
won.ho.park@huawei.com, zhangshiming5@huawei.com,
zhouxiaoyan1@huawei.com, zhouxiyu@huawei.com,
mm-commits@vger.kernel.org, Hugh Dickins <hughd@google.com>,
Linux-FSDevel <linux-fsdevel@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: + compaction-add-def_blk_aops-migrate-function-for-memory-compaction.patch added to -mm tree
Date: Thu, 9 Mar 2017 14:19:18 +0100 [thread overview]
Message-ID: <20170309131918.GB11598@dhcp22.suse.cz> (raw)
In-Reply-To: <20170309121507.GH15874@quack2.suse.cz>
On Thu 09-03-17 13:15:07, Jan Kara wrote:
> On Thu 09-03-17 08:58:45, Vlastimil Babka wrote:
> > On 03/09/2017 12:55 AM, akpm@linux-foundation.org wrote:
> > >
> > > The patch titled
> > > Subject: compaction: add def_blk_aops migrate function for memory compaction
> > > has been added to the -mm tree. Its filename is
> > > compaction-add-def_blk_aops-migrate-function-for-memory-compaction.patch
> > >
> > > This patch should soon appear at
> > > http://ozlabs.org/~akpm/mmots/broken-out/compaction-add-def_blk_aops-migrate-function-for-memory-compaction.patch
> > > and later at
> > > http://ozlabs.org/~akpm/mmotm/broken-out/compaction-add-def_blk_aops-migrate-function-for-memory-compaction.patch
> > >
> > > Before you just go and hit "reply", please:
> > > a) Consider who else should be cc'ed
> > > b) Prefer to cc a suitable mailing list as well
> > > c) Ideally: find the original patch on the mailing list and do a
> > > reply-to-all to that, adding suitable additional cc's
> > >
> > > *** Remember to use Documentation/SubmitChecklist when testing your code ***
> > >
> > > The -mm tree is included into linux-next and is updated
> > > there every 3-4 working days
> > >
> > > ------------------------------------------------------
> > > From: zhouxianrong <zhouxianrong@huawei.com>
> > > Subject: compaction: add def_blk_aops migrate function for memory compaction
> >
> > That's not really a mm/compaction patch, but a block layer/migration patch. I
> > don't know internals of those so well, so I added some CC's.
>
> Thanks!
>
> > > The reason for doing this is based on two factors.
> > >
> > > 1. larg file read/write operations with order 0 can fragmentize
> > > memory rapidly.
> > >
> > > 2. when a special filesystem does not supply migratepage callback,
> > > kernel would fallback to default function fallback_migrate_page.
> > > but fallback_migrate_page could not migrate diry page nicely;
> > > specially kcompactd with MIGRATE_SYNC_LIGHT could not migrate
> > > diry pages due to this until clear_page_dirty_for_io in some
> > > procedure. i think it is not suitable here in this scenario.
> > > for dirty pages we should migrate it rather than skip or writeout
> > > it in kcomapctd with MIGRATE_SYNC_LIGHT. i think this problem is
> > > for all filesystem without migratepage not only for block device fs.
> > >
> > > So for compaction under large file writing supply migratepage for
> > > def_blk_aops.
> >
> > Is this really safe to do? buffer_migrate_page() has some assumptions listed in
> > its comment (and maybe more that are not listed). Do we know it's safe to use it
> > for all def_blk_aops users?
>
> So this is definitely *not* OK for ext4 which is using def_blk_aops. Ext4
> will create temporary buffer heads that alias buffer heads attached to the
> block device page when committing a transaction (see fs/jbd2/journal.c:
> jbd2_journal_write_metadata_buffer()) and these will point to the original
> page.
>
> Now I'm not saying ext4 / jbd2 cannot be modified so that it somehow makes
> it clear to the page migration code it should stay away from the page.
> However it demostrates that this patch is not safe as is...
Which would suggest to enahnce the documentation of buffer_migrate_page.
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2017-03-09 13:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <58c099dc.qZs+2fQBHcULYdhi%akpm@linux-foundation.org>
2017-03-09 7:58 ` Vlastimil Babka
2017-03-09 11:50 ` zhouxianrong
2017-03-09 12:15 ` Jan Kara
2017-03-09 13:19 ` Michal Hocko [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=20170309131918.GB11598@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=Mi.Sophia.Wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=jack@suse.cz \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=minchan@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=viro@zeniv.linux.org.uk \
--cc=weidu.du@huawei.com \
--cc=won.ho.park@huawei.com \
--cc=zhangshiming5@huawei.com \
--cc=zhouxianrong@huawei.com \
--cc=zhouxiaoyan1@huawei.com \
--cc=zhouxiyu@huawei.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
all inboxes | Powered by JetHome®