From: <zhouxianrong@huawei.com>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
hannes@cmpxchg.org, minchan@kernel.org,
mgorman@techsingularity.net, vbabka@suse.cz,
viro@zeniv.linux.org.uk, Mi.Sophia.Wang@huawei.com,
zhouxianrong@huawei.com, zhouxiyu@huawei.com,
weidu.du@huawei.com, zhangshiming5@huawei.com,
won.ho.park@huawei.com, zhouxiaoyan1@huawei.com
Subject: [PATCH] compaction: add def_blk_aops migrate function for memory compaction
Date: Wed, 8 Mar 2017 09:51:55 +0800 [thread overview]
Message-ID: <1488937915-78955-1-git-send-email-zhouxianrong@huawei.com> (raw)
From: zhouxianrong <zhouxianrong@huawei.com>
the reason for why to do this is based on below 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.
Signed-off-by: zhouxianrong <zhouxianrong@huawei.com>
---
fs/block_dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 1c62845..9343b60 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -2062,6 +2062,9 @@ static int blkdev_writepages(struct address_space *mapping,
.releasepage = blkdev_releasepage,
.direct_IO = blkdev_direct_IO,
.is_dirty_writeback = buffer_check_dirty_writeback,
+#ifdef CONFIG_MIGRATION
+ .migratepage = buffer_migrate_page,
+#endif
};
#define BLKDEV_FALLOC_FL_SUPPORTED \
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2017-03-08 2:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1488937915-78955-1-git-send-email-zhouxianrong@huawei.com \
--to=zhouxianrong@huawei.com \
--cc=Mi.Sophia.Wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=minchan@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=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