lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 8 Mar 2017 09:51:55 +0800
From:   <zhouxianrong@...wei.com>
To:     <linux-mm@...ck.org>
CC:     <linux-kernel@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
        <akpm@...ux-foundation.org>, <kirill.shutemov@...ux.intel.com>,
        <hannes@...xchg.org>, <minchan@...nel.org>,
        <mgorman@...hsingularity.net>, <vbabka@...e.cz>,
        <viro@...iv.linux.org.uk>, <Mi.Sophia.Wang@...wei.com>,
        <zhouxianrong@...wei.com>, <zhouxiyu@...wei.com>,
        <weidu.du@...wei.com>, <zhangshiming5@...wei.com>,
        <won.ho.park@...wei.com>, <zhouxiaoyan1@...wei.com>
Subject: [PATCH] compaction: add def_blk_aops migrate function for memory compaction

From: zhouxianrong <zhouxianrong@...wei.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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ