[PATCH for vm-scalability] usemem: Output a message after punch holes done

2021-04-13 Thread Hui Zhu
From: Hui Zhu When I use punch holes to setup a test page fragmentation environment, I didn't know when the punch holes done. I can only get this information through top or something else. This commit add code to output a message after punch holes done to handle this issue. Signed-off-by: Hui

[PATCH for vm-scalability] usemem: Add code for touch-alloc

2021-04-08 Thread Hui Zhu
Add code for touch-alloc. And Change read memory to write memory to avoid use the zero-page for reads in do_anonymous_page. Signed-off-by: Hui Zhu --- usemem.c | 34 ++ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/usemem.c b/usemem.c index

[PATCH] usemem: Remove the duplicate do_access

2021-01-18 Thread Hui Zhu
From: Hui Zhu Got following error when build usemem: gcc -O -c -Wall -g usemem.c -o usemem.o usemem.c:451:15: error: redefinition of ‘do_access’ unsigned long do_access(unsigned long *p, unsigned long idx, int read) ^ usemem.c:332:15: note: previous definition

[PATCH] usemem: Add option touch-alloc

2020-12-16 Thread Hui Zhu
Some environment will not fault in memory even if MAP_POPULATE is set. This commit add option touch-alloc to read memory after allocate it to make sure the pages is fault in. Signed-off-by: Hui Zhu --- usemem.c | 37 + 1 file changed, 25 insertions(+), 12

[PATCH] usemem: Add option init-time

2020-12-16 Thread Hui Zhu
From: Hui Zhu This commit add a new option init-time to remove the initialization time from the run time and show the initialization time. Signed-off-by: Hui Zhu --- usemem.c | 29 +++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/usemem.c b/usemem.c

[PATCH] samples/bpf/Makefile: Create tools/testing/selftests/bpf dir

2020-12-14 Thread Hui Zhu
From: Hui Zhu Got an error when I built samples/bpf in a separate directory: make O=../bk/ defconfig make -j64 bzImage make headers_install make V=1 M=samples/bpf ... ... make -C /home/teawater/kernel/linux/samples/bpf/../..//tools/build CFLAGS= LDFLAGS= fixdep make -f /home/teawater/kernel

[RFC for qemu v4 2/2] virtio_balloon: Add dcvq to deflate continuous pages

2020-07-15 Thread Hui Zhu
This commit adds a vq dcvq to deflate continuous pages. When VIRTIO_BALLOON_F_CONT_PAGES is set, try to get continuous pages from icvq and use madvise MADV_WILLNEED with the pages. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 14 +- include/hw/virtio/virtio

[RFC for Linux v4 1/2] virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES and inflate_cont_vq

2020-07-15 Thread Hui Zhu
This commit adds a new flag VIRTIO_BALLOON_F_CONT_PAGES to virtio_balloon. Add it adds a vq inflate_cont_vq to inflate continuous pages. When VIRTIO_BALLOON_F_CONT_PAGES is set, try to allocate continuous pages and report them use inflate_cont_vq. Signed-off-by: Hui Zhu --- drivers/virtio

[RFC for qemu v4 0/2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_F_CONT_PAGES

2020-07-15 Thread Hui Zhu
two benefits: 1. Increase the speed of balloon inflate and deflate. 2. Decrease the splitted THPs number in the host. [1] https://github.com/teawater/linux/tree/balloon_conts [2] https://github.com/teawater/qemu/tree/balloon_conts [3] https://lkml.org/lkml/2020/5/13/1211 Hui Zhu (2

[RFC for Linux v4 0/2] virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES to report continuous pages

2020-07-15 Thread Hui Zhu
kml/2020/5/12/324 [4] https://github.com/teawater/linux/tree/balloon_conts [5] https://github.com/teawater/qemu/tree/balloon_conts [6] https://lkml.org/lkml/2020/5/13/1211 Hui Zhu (2): virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES and inflate_cont_vq virtio_balloon: Add deflate_cont_vq to

[RFC for qemu v4 1/2] virtio_balloon: Add cont-pages and icvq

2020-07-15 Thread Hui Zhu
the pages. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 80 - include/hw/virtio/virtio-balloon.h | 2 +- include/standard-headers/linux/virtio_balloon.h | 1 + 3 files changed, 55 insertions(+), 28 deletions(-) diff --git

[RFC for Linux v4 2/2] virtio_balloon: Add deflate_cont_vq to deflate continuous pages

2020-07-15 Thread Hui Zhu
-by: Hui Zhu --- drivers/virtio/virtio_balloon.c| 73 include/linux/balloon_compaction.h | 3 ++ mm/balloon_compaction.c| 76 ++ 3 files changed, 144 insertions(+), 8 deletions(-) diff --git a/drivers/virtio

[RFC v3 for QEMU] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT

2020-05-12 Thread Hui Zhu
. Then It will get continuous pages PFN that its order is current_pages_order from VQ ivq use use madvise MADV_DONTNEED release the page. This will handle the THP split issue. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 77 + include/hw/virtio/virtio

[RFC v3 for Linux] virtio_balloon: Add VIRTIO_BALLOON_VQ_INFLATE_CONT to handle THP split issue

2020-05-12 Thread Hui Zhu
age. [1] https://lkml.org/lkml/2020/3/12/144 [2] https://lore.kernel.org/linux-mm/1584893097-12317-1-git-send-email-teawa...@gmail.com/ Signed-off-by: Hui Zhu --- drivers/virtio/virtio_balloon.c | 98 +++-- include/linux/balloon_compaction.h | 9 +++- incl

[PATCH 1/2] mm, frontswap: Fix frontswap_map issue with THP

2019-10-14 Thread Hui Zhu
. Signed-off-by: Hui Zhu --- mm/frontswap.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/frontswap.c b/mm/frontswap.c index 60bb20e..f07ea63 100644 --- a/mm/frontswap.c +++ b/mm/frontswap.c @@ -274,8 +274,12 @@ int __frontswap_store(struct page *page

[PATCH 2/2] mm, zswap: Support THP

2019-10-14 Thread Hui Zhu
This commit let zswap treats THP as continuous normal pages in zswap_frontswap_store. It will store them to a lot of "zswap_entry". These "zswap_entry" will be inserted to "zswap_tree" together. Signed-off-by:

[RFC v4] zswap: Add CONFIG_ZSWAP_IO_SWITCH to handle swap IO issue

2019-10-08 Thread Hui Zhu
is enabled by the swap parameter io_switch_enabled_enabled, zswap will just work when the swap disk has outstanding I/O requests. [1] https://lkml.org/lkml/2019/9/11/935 [2] https://lkml.org/lkml/2019/9/20/90 [3] https://lkml.org/lkml/2019/9/22/927 Signed-off-by: Hui Zhu --- include/linux/swap.h |

[RFC v3] zswap: Add CONFIG_ZSWAP_IO_SWITCH to handle swap IO issue

2019-09-22 Thread Hui Zhu
/2019/9/20/90 [3] https://lkml.org/lkml/2019/9/20/1076 Signed-off-by: Hui Zhu --- include/linux/swap.h | 3 +++ mm/Kconfig | 18 mm/page_io.c | 16 +++ mm/zswap.c | 58 4 files changed

[RFC v2] zswap: Add CONFIG_ZSWAP_IO_SWITCH to handle swap IO issue

2019-09-20 Thread Hui Zhu
will be stored to zswap only when the IO in flight number of swap device is bigger than zswap_read_in_flight_limit or zswap_write_in_flight_limit when zswap is enabled. Then the zswap just work when the IO in flight number of swap device is low. Signed-off-by: Hui Zhu --- include/linux/swap.h

[PATCH for vm-scalability] usemem: Add new option -Z|--read-again

2019-09-13 Thread Hui Zhu
usemem will read memory again after access the memory with this option. It can help test the speed that load page from swap to memory. Signed-off-by: Hui Zhu --- usemem.c | 46 -- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/usemem.c

[PATCH] zswap: Add CONFIG_ZSWAP_IO_SWITCH

2019-09-11 Thread Hui Zhu
55716864 bytes / 14457505 usecs = 571159 KB/s 365961 usecs to free memory Signed-off-by: Hui Zhu --- include/linux/swap.h | 3 +++ mm/Kconfig | 11 +++ mm/page_io.c | 16 +++ mm/zswap.c | 55 4 fi

[PATCH V3 2/2] zswap: Use movable memory if zpool support allocate movable memory

2019-06-05 Thread Hui Zhu
e page blocks is decreased when the kernel has this commit. Signed-off-by: Hui Zhu --- mm/zswap.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index a4e4d36ec085..c6bf92bf5890 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1006,6 +1006,7 @@ static int

[PATCH V3 1/2] zpool: Add malloc_support_movable to zpool_driver

2019-06-05 Thread Hui Zhu
zpool_malloc_support_movable check malloc_support_movable to make sure if a zpool support allocate movable memory. Signed-off-by: Hui Zhu --- include/linux/zpool.h | 3 +++ mm/zpool.c| 16 mm/zsmalloc.c | 19 ++- 3 files changed, 29 insertions(+), 9 deletions

Re: [PATCH V2 2/2] zswap: Add module parameter malloc_movable_if_support

2019-06-04 Thread Hui Zhu
Shakeel Butt 于2019年6月5日周三 上午1:12写道: > > On Sun, Jun 2, 2019 at 2:47 AM Hui Zhu wrote: > > > > This is the second version that was updated according to the comments > > from Sergey Senozhatsky in https://lkml.org/lkml/2019/5/29/73 > > > > zswap compresses swa

[PATCH V2 2/2] zswap: Add module parameter malloc_movable_if_support

2019-06-02 Thread Hui Zhu
0 00 You can see that the number of unmovable page blocks is decreased when malloc_movable_if_support is enabled. Signed-off-by: Hui Zhu --- mm/zswap.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index

[PATCH V2 1/2] zpool: Add malloc_support_movable to zpool_driver

2019-06-02 Thread Hui Zhu
zpool_malloc_support_movable check malloc_support_movable to make sure if a zpool support allocate movable memory. Signed-off-by: Hui Zhu --- include/linux/zpool.h | 3 +++ mm/zpool.c| 16 mm/zsmalloc.c | 19 ++- 3 files changed, 29 insertions(+), 9 deletions

[UPSTREAM KERNEL] mm/zsmalloc.c: Add module parameter malloc_force_movable

2019-05-28 Thread Hui Zhu
can see that the number of unmovable page blocks is decreased when malloc_force_movable is enabled. Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 0787d33b80d8..7d44c7ccd882 100644 --- a/mm/zsmall

[RFC 2/4] BloodTest: perf

2017-10-13 Thread Hui Zhu
_config", "perf_freq", "perf_period", "perf_type" can set the options of perf. After record, access "str" will get the record data in string. Access "cpu0/page" will get the record data in binary that is format is in "bin_format". Signed-of

[RFC 2/4] BloodTest: perf

2017-10-13 Thread Hui Zhu
_config", "perf_freq", "perf_period", "perf_type" can set the options of perf. After record, access "str" will get the record data in string. Access "cpu0/page" will get the record data in binary that is format is in "bin_format". Signed-off-by:

[RFC 0/4] BloodTest: kernel status

2017-10-13 Thread Hui Zhu
overhead and full coverage. BloodTest is for it. It is a interface can acess function of other analysing tools and records to internal buffer that user or application can access very quickly (mmap). Now, BloodTest just support record cpu, perf and task infomation in one seconds. Hui Zhu (2

[RFC 0/4] BloodTest: kernel status

2017-10-13 Thread Hui Zhu
overhead and full coverage. BloodTest is for it. It is a interface can acess function of other analysing tools and records to internal buffer that user or application can access very quickly (mmap). Now, BloodTest just support record cpu, perf and task infomation in one seconds. Hui Zhu (2

[RFC 1/4] BloodTest: kernel status

2017-10-13 Thread Hui Zhu
p record. bt_insert and bt_pullout will call analysing tools. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- fs/proc/stat.c | 8 +-- include/linux/kernel_stat.h| 3 ++ init/Kconfig | 3 ++ kernel/Makefile| 2 + kernel/bloodtest/Makefile

[RFC 1/4] BloodTest: kernel status

2017-10-13 Thread Hui Zhu
p record. bt_insert and bt_pullout will call analysing tools. Signed-off-by: Hui Zhu --- fs/proc/stat.c | 8 +-- include/linux/kernel_stat.h| 3 ++ init/Kconfig | 3 ++ kernel/Makefile| 2 + kernel/bloodtest/Makefile | 1 + kernel/bloodtest

[RFC 4/4] BloodTest: task

2017-10-13 Thread Hui Zhu
fomation. After record, access "str" will get the record data in string. Access "page" will get the record data in binary that is format is in "bin_format". Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- include/linux/bloodtest.h | 10 + kernel/bloodtest/

[RFC 4/4] BloodTest: task

2017-10-13 Thread Hui Zhu
fomation. After record, access "str" will get the record data in string. Access "page" will get the record data in binary that is format is in "bin_format". Signed-off-by: Hui Zhu --- include/linux/bloodtest.h | 10 + kernel/bloodtest/Makefile | 2 +- kernel/blood

[RFC 3/4] module: add /proc/modules_update_version

2017-10-13 Thread Hui Zhu
module, it also need the address of modules from /proc/modules. Add /proc/modules_update_version will help the application to get if the kernel modules address is changed or not. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- kernel/module.c | 19 +++ 1 file changed, 19 insertio

[RFC 3/4] module: add /proc/modules_update_version

2017-10-13 Thread Hui Zhu
module, it also need the address of modules from /proc/modules. Add /proc/modules_update_version will help the application to get if the kernel modules address is changed or not. Signed-off-by: Hui Zhu --- kernel/module.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/kern

Re: [RFC 0/2] Use HighAtomic against long-term fragmentation

2017-09-26 Thread Hui Zhu
2017-09-26 17:51 GMT+08:00 Mel Gorman <mgor...@techsingularity.net>: > On Tue, Sep 26, 2017 at 04:46:42PM +0800, Hui Zhu wrote: >> Current HighAtomic just to handle the high atomic page alloc. >> But I found that use it handle the normal unmovable continuous page >> allo

Re: [RFC 0/2] Use HighAtomic against long-term fragmentation

2017-09-26 Thread Hui Zhu
2017-09-26 17:51 GMT+08:00 Mel Gorman : > On Tue, Sep 26, 2017 at 04:46:42PM +0800, Hui Zhu wrote: >> Current HighAtomic just to handle the high atomic page alloc. >> But I found that use it handle the normal unmovable continuous page >> alloc will help to against lo

[RFC 1/2] Try to use HighAtomic if try to alloc umovable page that order is not 0

2017-09-26 Thread Hui Zhu
The page add a new condition to let gfp_to_alloc_flags return alloc_flags with ALLOC_HARDER if the order is not 0 and migratetype is MIGRATE_UNMOVABLE. Then alloc umovable page that order is not 0 will try to use HighAtomic. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/page_alloc

[RFC 1/2] Try to use HighAtomic if try to alloc umovable page that order is not 0

2017-09-26 Thread Hui Zhu
The page add a new condition to let gfp_to_alloc_flags return alloc_flags with ALLOC_HARDER if the order is not 0 and migratetype is MIGRATE_UNMOVABLE. Then alloc umovable page that order is not 0 will try to use HighAtomic. Signed-off-by: Hui Zhu --- mm/page_alloc.c | 6 -- 1 file changed

[RFC 2/2] Change limit of HighAtomic from 1% to 10%

2017-09-26 Thread Hui Zhu
pageblocks. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b54e94a..9322458 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2101,7 +2101,7 @@ static void reserve_high

[RFC 0/2] Use HighAtomic against long-term fragmentation

2017-09-26 Thread Hui Zhu
local faults 0 0 NUMA hint local percent100 100 NUMA pages migrated 0 0 AutoNUMA cost 0% 0% Hui Zhu (2): Try to use HighAtomic if try to alloc umovable page that order is not 0 Change limit

[RFC 2/2] Change limit of HighAtomic from 1% to 10%

2017-09-26 Thread Hui Zhu
pageblocks. Signed-off-by: Hui Zhu --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b54e94a..9322458 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2101,7 +2101,7 @@ static void reserve_highatomic_pageblock(struct p

[RFC 0/2] Use HighAtomic against long-term fragmentation

2017-09-26 Thread Hui Zhu
local faults 0 0 NUMA hint local percent100 100 NUMA pages migrated 0 0 AutoNUMA cost 0% 0% Hui Zhu (2): Try to use HighAtomic if try to alloc umovable page that order is not 0 Change limit

Re: [PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-16 Thread Hui Zhu
2017-08-16 12:51 GMT+08:00 Minchan Kim <minc...@kernel.org>: > On Wed, Aug 16, 2017 at 10:49:14AM +0800, Hui Zhu wrote: >> Hi Minchan, >> >> 2017-08-16 10:13 GMT+08:00 Minchan Kim <minc...@kernel.org>: >> > Hi Hui, >> > >> > On Mon,

Re: [PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-16 Thread Hui Zhu
2017-08-16 12:51 GMT+08:00 Minchan Kim : > On Wed, Aug 16, 2017 at 10:49:14AM +0800, Hui Zhu wrote: >> Hi Minchan, >> >> 2017-08-16 10:13 GMT+08:00 Minchan Kim : >> > Hi Hui, >> > >> > On Mon, Aug 14, 2017 at 05:56:30PM +0800, Hui Zhu w

[PATCH] zsmalloc: zs_page_isolate: skip unnecessary loops but not return false if zspage is not inuse

2017-08-16 Thread Hui Zhu
-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch [2] zsmalloc-zs_page_migrate-schedule-free_work-if-zspage-is-ZS_EMPTY.patch Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 5 - 1 file changed, 5 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fb99953..8

[PATCH] zsmalloc: zs_page_isolate: skip unnecessary loops but not return false if zspage is not inuse

2017-08-16 Thread Hui Zhu
-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch [2] zsmalloc-zs_page_migrate-schedule-free_work-if-zspage-is-ZS_EMPTY.patch Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 5 - 1 file changed, 5 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fb99953..8560c93 100644 --- a/mm

[PATCH v3] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-15 Thread Hui Zhu
done the job without "schedule_work(>free_work);" Make this patch let zs_page_migrate wake up free_work if need. [1] zsmalloc-zs_page_migrate-skip-unnecessary-loops-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc

[PATCH v3] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-15 Thread Hui Zhu
done the job without "schedule_work(>free_work);" Make this patch let zs_page_migrate wake up free_work if need. [1] zsmalloc-zs_page_migrate-skip-unnecessary-loops-but-not-return-ebusy-if-zspage-is-not-inuse-fix.patch Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 11 +-- 1 fil

Re: [PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-15 Thread Hui Zhu
Hi Minchan, 2017-08-16 10:13 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hi Hui, > > On Mon, Aug 14, 2017 at 05:56:30PM +0800, Hui Zhu wrote: >> After commit e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary > > This patch is not merged yet so the hash

Re: [PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-15 Thread Hui Zhu
Hi Minchan, 2017-08-16 10:13 GMT+08:00 Minchan Kim : > Hi Hui, > > On Mon, Aug 14, 2017 at 05:56:30PM +0800, Hui Zhu wrote: >> After commit e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary > > This patch is not merged yet so the hash is invalid. > That means

[PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
this patch let zs_page_migrate wake up free_work if need. Fixes: e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse") Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 13 +++-- 1 file changed, 11 i

[PATCH v2] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
this patch let zs_page_migrate wake up free_work if need. Fixes: e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse") Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deleti

Re: [PATCH] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
2017-08-14 16:31 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hi Hui, > > On Mon, Aug 14, 2017 at 02:34:46PM +0800, Hui Zhu wrote: >> After commit e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary >> loops but not return -EBUSY if zspage is not inuse

Re: [PATCH] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
2017-08-14 16:31 GMT+08:00 Minchan Kim : > Hi Hui, > > On Mon, Aug 14, 2017 at 02:34:46PM +0800, Hui Zhu wrote: >> After commit e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary >> loops but not return -EBUSY if zspage is not inuse") zs_page_migrate &g

[PATCH] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
her zspage wake up free_work. Make this patch let zs_page_migrate wake up free_work if need. Fixes: e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse") Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 10 +++

[PATCH] zsmalloc: zs_page_migrate: schedule free_work if zspage is ZS_EMPTY

2017-08-14 Thread Hui Zhu
her zspage wake up free_work. Make this patch let zs_page_migrate wake up free_work if need. Fixes: e2846124f9a2 ("zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse") Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 10 -- 1 file changed

[PATCH] zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse

2017-07-24 Thread Hui Zhu
/21/10 Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index d41edd2..c2c7ba9 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1997,8 +1997,11 @@ int zs_page_migrate(

[PATCH] zsmalloc: zs_page_migrate: skip unnecessary loops but not return -EBUSY if zspage is not inuse

2017-07-24 Thread Hui Zhu
/21/10 Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index d41edd2..c2c7ba9 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1997,8 +1997,11 @@ int zs_page_migrate(struct address_space *mapping

Re: [PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-20 Thread Hui Zhu
2017-07-20 16:47 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hi Hui, > > On Thu, Jul 20, 2017 at 02:39:17PM +0800, Hui Zhu wrote: >> Hi Minchan, >> >> I am sorry for answer late. >> I spent some time on ubuntu 16.04 with mmtests in an old laptop. >&

Re: [PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-20 Thread Hui Zhu
2017-07-20 16:47 GMT+08:00 Minchan Kim : > Hi Hui, > > On Thu, Jul 20, 2017 at 02:39:17PM +0800, Hui Zhu wrote: >> Hi Minchan, >> >> I am sorry for answer late. >> I spent some time on ubuntu 16.04 with mmtests in an old laptop. >> >> 2017-07-17

Re: [PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-20 Thread Hui Zhu
Hi Minchan, I am sorry for answer late. I spent some time on ubuntu 16.04 with mmtests in an old laptop. 2017-07-17 13:39 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hello Hui, > > On Fri, Jul 14, 2017 at 03:51:07PM +0800, Hui Zhu wrote: >> Got some -EBUSY from zs_page_m

Re: [PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-20 Thread Hui Zhu
Hi Minchan, I am sorry for answer late. I spent some time on ubuntu 16.04 with mmtests in an old laptop. 2017-07-17 13:39 GMT+08:00 Minchan Kim : > Hello Hui, > > On Fri, Jul 14, 2017 at 03:51:07PM +0800, Hui Zhu wrote: >> Got some -EBUSY from zs_page_migrate that will make mi

[PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-14 Thread Hui Zhu
if migrate_mode is not MIGRATE_ASYNC. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 66 +-- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index d41edd2..c298e5c 100644 --

[PATCH] zsmalloc: zs_page_migrate: not check inuse if migrate_mode is not MIGRATE_ASYNC

2017-07-14 Thread Hui Zhu
if migrate_mode is not MIGRATE_ASYNC. Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 66 +-- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index d41edd2..c298e5c 100644 --- a/mm/zsmalloc.c +++ b/mm

[RFC 0/2] Add interface let ZRAM close swap cache

2016-11-25 Thread Hui Zhu
1126484928 bytes / 6555923 usecs = 167799 KB/s 1126484928 bytes / 6642291 usecs = 165617 KB/s Hui Zhu (2): SWAP: add interface to let disk close swap cache ZRAM: add sysfs switch swap_cache_not_keep

[RFC 0/2] Add interface let ZRAM close swap cache

2016-11-25 Thread Hui Zhu
1126484928 bytes / 6555923 usecs = 167799 KB/s 1126484928 bytes / 6642291 usecs = 165617 KB/s Hui Zhu (2): SWAP: add interface to let disk close swap cache ZRAM: add sysfs switch swap_cache_not_keep

[RFC 1/2] SWAP: add interface to let disk close swap cache

2016-11-25 Thread Hui Zhu
This patch add a interface to gendisk that SWAP device can use it to control the swap cache rule. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- include/linux/genhd.h | 3 +++ include/linux/swap.h | 8 ++ mm/Kconfig| 10 +++ mm/memory.c | 2 +- mm/swap

[RFC 1/2] SWAP: add interface to let disk close swap cache

2016-11-25 Thread Hui Zhu
This patch add a interface to gendisk that SWAP device can use it to control the swap cache rule. Signed-off-by: Hui Zhu --- include/linux/genhd.h | 3 +++ include/linux/swap.h | 8 ++ mm/Kconfig| 10 +++ mm/memory.c | 2 +- mm/swapfile.c | 74

[RFC 2/2] ZRAM: add sysfs switch swap_cache_not_keep

2016-11-25 Thread Hui Zhu
This patch add a sysfs interface swap_cache_not_keep to control the swap cache rule for a ZRAM disk. Swap will not keep the swap cache anytime if it set to 1. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- drivers/block/zram/zram_drv.c | 34 ++ 1 file chang

[RFC 2/2] ZRAM: add sysfs switch swap_cache_not_keep

2016-11-25 Thread Hui Zhu
This patch add a sysfs interface swap_cache_not_keep to control the swap cache rule for a ZRAM disk. Swap will not keep the swap cache anytime if it set to 1. Signed-off-by: Hui Zhu --- drivers/block/zram/zram_drv.c | 34 ++ 1 file changed, 34 insertions(+) diff

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-09-05 Thread Hui Zhu
On Mon, Sep 5, 2016 at 1:51 PM, Minchan Kim <minc...@kernel.org> wrote: > On Mon, Sep 05, 2016 at 01:12:05PM +0800, Hui Zhu wrote: >> On Mon, Sep 5, 2016 at 10:18 AM, Minchan Kim <minc...@kernel.org> wrote: >> > On Thu, Aug 25, 2016 at 04:25:30PM +0800, Hui Zhu wro

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-09-05 Thread Hui Zhu
On Mon, Sep 5, 2016 at 1:51 PM, Minchan Kim wrote: > On Mon, Sep 05, 2016 at 01:12:05PM +0800, Hui Zhu wrote: >> On Mon, Sep 5, 2016 at 10:18 AM, Minchan Kim wrote: >> > On Thu, Aug 25, 2016 at 04:25:30PM +0800, Hui Zhu wrote: >> >> On Thu, Aug 25, 2016

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-09-04 Thread Hui Zhu
On Mon, Sep 5, 2016 at 10:18 AM, Minchan Kim <minc...@kernel.org> wrote: > On Thu, Aug 25, 2016 at 04:25:30PM +0800, Hui Zhu wrote: >> On Thu, Aug 25, 2016 at 2:09 PM, Sergey Senozhatsky >> <sergey.senozhatsky.w...@gmail.com> wrote: >> > Hello, >>

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-09-04 Thread Hui Zhu
On Mon, Sep 5, 2016 at 10:18 AM, Minchan Kim wrote: > On Thu, Aug 25, 2016 at 04:25:30PM +0800, Hui Zhu wrote: >> On Thu, Aug 25, 2016 at 2:09 PM, Sergey Senozhatsky >> wrote: >> > Hello, >> > >> > On (08/22/16 16:25), Hui Zhu wrote: >> >

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-25 Thread Hui Zhu
On Thu, Aug 25, 2016 at 2:09 PM, Sergey Senozhatsky <sergey.senozhatsky.w...@gmail.com> wrote: > Hello, > > On (08/22/16 16:25), Hui Zhu wrote: >> >> Current ZRAM just can store all pages even if the compression rate >> of a page is really low. So the compression

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-25 Thread Hui Zhu
On Thu, Aug 25, 2016 at 2:09 PM, Sergey Senozhatsky wrote: > Hello, > > On (08/22/16 16:25), Hui Zhu wrote: >> >> Current ZRAM just can store all pages even if the compression rate >> of a page is really low. So the compression rate of ZRAM is out of >> control

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-23 Thread Hui Zhu
Hi Minchan, On Wed, Aug 24, 2016 at 9:04 AM, Minchan Kim <minc...@kernel.org> wrote: > Hi Hui, > > On Mon, Aug 22, 2016 at 04:25:05PM +0800, Hui Zhu wrote: >> Current ZRAM just can store all pages even if the compression rate >> of a page is really low. So the comp

Re: [RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-23 Thread Hui Zhu
Hi Minchan, On Wed, Aug 24, 2016 at 9:04 AM, Minchan Kim wrote: > Hi Hui, > > On Mon, Aug 22, 2016 at 04:25:05PM +0800, Hui Zhu wrote: >> Current ZRAM just can store all pages even if the compression rate >> of a page is really low. So the compression rate of ZRAM is o

[RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-22 Thread Hui Zhu
the page that the compressed size is smaller than a value. With these patches, I set the value to 2048 and did the same test with before. The compression rate is about 20%. The times of lowmemorykiller also decreased. Hui Zhu (4): vmscan.c: shrink_page_list: unmap anon pages after pageout Add non

[RFC 0/4] ZRAM: make it just store the high compression rate page

2016-08-22 Thread Hui Zhu
the page that the compressed size is smaller than a value. With these patches, I set the value to 2048 and did the same test with before. The compression rate is about 20%. The times of lowmemorykiller also decreased. Hui Zhu (4): vmscan.c: shrink_page_list: unmap anon pages after pageout Add non

[RFC 3/4] ZRAM: do not swap the page that compressed size bigger than non_swap

2016-08-22 Thread Hui Zhu
New option ZRAM_NON_SWAP add a interface "non_swap" to zram. User can set a unsigned int value to zram. If a page that compressed size is bigger than limit, mark it as non-swap. Then this page will add to unevictable lru list. This patch doesn't handle the shmem file pages. Signed-o

[RFC 2/4] Add non-swap page flag to mark a page will not swap

2016-08-22 Thread Hui Zhu
After a page marked non-swap flag in swap driver, it will add to unevictable lru list. This page will be kept in this status before its data changed. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- fs/proc/meminfo.c | 6 ++ include/linux/mm_inline.h

[RFC 3/4] ZRAM: do not swap the page that compressed size bigger than non_swap

2016-08-22 Thread Hui Zhu
New option ZRAM_NON_SWAP add a interface "non_swap" to zram. User can set a unsigned int value to zram. If a page that compressed size is bigger than limit, mark it as non-swap. Then this page will add to unevictable lru list. This patch doesn't handle the shmem file pages. Signed-o

[RFC 2/4] Add non-swap page flag to mark a page will not swap

2016-08-22 Thread Hui Zhu
After a page marked non-swap flag in swap driver, it will add to unevictable lru list. This page will be kept in this status before its data changed. Signed-off-by: Hui Zhu --- fs/proc/meminfo.c | 6 ++ include/linux/mm_inline.h | 20 ++-- include/linux

[RFC 1/4] vmscan.c: shrink_page_list: unmap anon pages after pageout

2016-08-22 Thread Hui Zhu
is shmem file page. Then I separate code of shmem file pages to last patch of this series. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- include/linux/rmap.h | 5 mm/Kconfig | 4 +++ mm/page_io.c | 11 --- mm/rmap.c| 28 ++ mm/vm

[RFC 1/4] vmscan.c: shrink_page_list: unmap anon pages after pageout

2016-08-22 Thread Hui Zhu
is shmem file page. Then I separate code of shmem file pages to last patch of this series. Signed-off-by: Hui Zhu --- include/linux/rmap.h | 5 mm/Kconfig | 4 +++ mm/page_io.c | 11 --- mm/rmap.c| 28 ++ mm/vmscan.c | 81

[RFC 4/4] vmscan.c: zram: add non swap support for shmem file pages

2016-08-22 Thread Hui Zhu
This patch add the whole support for shmem file pages non swap. To make sure a page is shmem file page, check mapping->a_ops == _aops. I think it is really a hack way. There are not a lot of shmem file pages will be swapped out. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- drivers/b

[RFC 4/4] vmscan.c: zram: add non swap support for shmem file pages

2016-08-22 Thread Hui Zhu
This patch add the whole support for shmem file pages non swap. To make sure a page is shmem file page, check mapping->a_ops == _aops. I think it is really a hack way. There are not a lot of shmem file pages will be swapped out. Signed-off-by: Hui Zhu --- drivers/block/zram/zram_drv.c |

[PATCH 2/3] zsmalloc: make its page "PageMobile"

2015-11-27 Thread Hui Zhu
The idea of this patch is same with prev version [1]. But it use the migration frame in [1]. [1] http://comments.gmane.org/gmane.linux.kernel.mm/140014 [2] https://lkml.org/lkml/2015/7/7/21 Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 214

[PATCH v3 0/3] zsmalloc: make its pages can be migrated

2015-11-27 Thread Hui Zhu
These patches updated according to the review for the prev version [1]. So they are based on "[RFCv3 0/5] enable migration of driver pages" [2] and "[RFC zsmalloc 0/4] meta diet" [3]. Hui Zhu (3): zsmalloc: make struct can move zsmalloc: mark its page "PageMobile" zr

[PATCH 1/3] zsmalloc: make struct can be migrated

2015-11-27 Thread Hui Zhu
kml/2015/8/10/90 [2] https://lkml.org/lkml/2015/7/7/21 Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 178 ++ 1 file changed, 104 insertions(+), 74 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1b18144..57c91a5 100644 --- a/mm/

[PATCH 3/3] zram: make create "__GFP_MOVABLE" pool

2015-11-27 Thread Hui Zhu
Change the flags when call zs_create_pool to make zram alloc movable zsmalloc page. Signed-off-by: Hui Zhu --- drivers/block/zram/zram_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 9fa15bb

[PATCH 2/3] zsmalloc: make its page "PageMobile"

2015-11-27 Thread Hui Zhu
The idea of this patch is same with prev version [1]. But it use the migration frame in [1]. [1] http://comments.gmane.org/gmane.linux.kernel.mm/140014 [2] https://lkml.org/lkml/2015/7/7/21 Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c

[PATCH 3/3] zram: make create "__GFP_MOVABLE" pool

2015-11-27 Thread Hui Zhu
Change the flags when call zs_create_pool to make zram alloc movable zsmalloc page. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- drivers/block/zram/zram_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram

[PATCH 1/3] zsmalloc: make struct can be migrated

2015-11-27 Thread Hui Zhu
kml/2015/8/10/90 [2] https://lkml.org/lkml/2015/7/7/21 Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 178 ++ 1 file changed, 104 insertions(+), 74 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 1b18144

[PATCH v3 0/3] zsmalloc: make its pages can be migrated

2015-11-27 Thread Hui Zhu
These patches updated according to the review for the prev version [1]. So they are based on "[RFCv3 0/5] enable migration of driver pages" [2] and "[RFC zsmalloc 0/4] meta diet" [3]. Hui Zhu (3): zsmalloc: make struct can move zsmalloc: mark its page "PageMobile" zr

Re: [RFC v2 1/3] migrate: new struct migration and add it to struct page

2015-10-19 Thread Hui Zhu
On Thu, Oct 15, 2015 at 5:53 PM, Minchan Kim wrote: > On Thu, Oct 15, 2015 at 11:27:15AM +0200, Vlastimil Babka wrote: >> On 10/15/2015 11:09 AM, Hui Zhu wrote: >> >I got that add function interfaces is really not a good idea. >> >So I add a new struct migration to p

  1   2   3   >