[PATCH/RESEND 0/5] z3fold optimizations and fixes

2016-12-25 Thread Vitaly Wool
This is a consolidation of z3fold optimizations and fixes done so far, revised after comments from Dan [1]. The coming patches are to be applied on top of the following commit: commit 07cfe852286d5e314f8cd19781444e12a2b6cdf3 Author: zhong jiang Date: Tue Dec 20 11:53:40

[PATCH/RESEND 0/5] z3fold optimizations and fixes

2016-12-25 Thread Vitaly Wool
This is a consolidation of z3fold optimizations and fixes done so far, revised after comments from Dan [1]. The coming patches are to be applied on top of the following commit: commit 07cfe852286d5e314f8cd19781444e12a2b6cdf3 Author: zhong jiang Date: Tue Dec 20 11:53:40 2016 +1100

Re: [PATCH 0/2] z3fold fixes

2016-12-22 Thread Vitaly Wool
On Thu, Dec 22, 2016 at 10:55 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Sun, Dec 18, 2016 at 3:15 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> On Tue, Nov 29, 2016 at 11:39 PM, Andrew Morton >> <a...@linux-foundation.org> wrote: >>> On Tue

Re: [PATCH 0/2] z3fold fixes

2016-12-22 Thread Vitaly Wool
On Thu, Dec 22, 2016 at 10:55 PM, Dan Streetman wrote: > On Sun, Dec 18, 2016 at 3:15 AM, Vitaly Wool wrote: >> On Tue, Nov 29, 2016 at 11:39 PM, Andrew Morton >> wrote: >>> On Tue, 29 Nov 2016 17:33:19 -0500 Dan Streetman wrote: >>> >>>> On Sat

Re: [PATCH 0/2] z3fold fixes

2016-12-18 Thread Vitaly Wool
On Tue, Nov 29, 2016 at 11:39 PM, Andrew Morton <a...@linux-foundation.org> wrote: > On Tue, 29 Nov 2016 17:33:19 -0500 Dan Streetman <ddstr...@ieee.org> wrote: > >> On Sat, Nov 26, 2016 at 2:15 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> > Here come

Re: [PATCH 0/2] z3fold fixes

2016-12-18 Thread Vitaly Wool
On Tue, Nov 29, 2016 at 11:39 PM, Andrew Morton wrote: > On Tue, 29 Nov 2016 17:33:19 -0500 Dan Streetman wrote: > >> On Sat, Nov 26, 2016 at 2:15 PM, Vitaly Wool wrote: >> > Here come 2 patches with z3fold fixes for chunks counting and locking. As >> > commi

[PATCH/RFC] z3fold: add kref refcounting

2016-12-08 Thread Vitaly Wool
-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 108 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 729a2da..8dcf35e 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -52,6 +52,7 @@ enum

[PATCH/RFC] z3fold: add kref refcounting

2016-12-08 Thread Vitaly Wool
-by: Vitaly Wool --- mm/z3fold.c | 108 1 file changed, 57 insertions(+), 51 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 729a2da..8dcf35e 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -52,6 +52,7 @@ enum buddy

Re: [PATCH 3/3] z3fold: discourage use of pages that weren't compacted

2016-11-28 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 7:25 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Tue, Nov 15, 2016 at 11:00 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> If a z3fold page couldn't be compacted, we don't want it to be >> used for next object allocation in the first plac

Re: [PATCH 3/3] z3fold: discourage use of pages that weren't compacted

2016-11-28 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 7:25 PM, Dan Streetman wrote: > On Tue, Nov 15, 2016 at 11:00 AM, Vitaly Wool wrote: >> If a z3fold page couldn't be compacted, we don't want it to be >> used for next object allocation in the first place. > > why? !compacted can only mean 1) already

[PATCH 2/2] z3fold: fix locking issues

2016-11-26 Thread Vitaly Wool
lru entry). [1] https://lkml.org/lkml/2016/11/25/628 [2] http://www.spinics.net/lists/linux-mm/msg117227.html Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold

[PATCH 2/2] z3fold: fix locking issues

2016-11-26 Thread Vitaly Wool
lru entry). [1] https://lkml.org/lkml/2016/11/25/628 [2] http://www.spinics.net/lists/linux-mm/msg117227.html Signed-off-by: Vitaly Wool --- mm/z3fold.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index efbcfcc..729a2da 10064

[PATCH 1/2] z3fold: fix header size related issues

2016-11-26 Thread Vitaly Wool
big"). Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 161 1 file changed, 87 insertions(+), 74 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 7ad70fa..efbcfcc 100644 --- a/mm/z3fold.c +++ b/mm

[PATCH 1/2] z3fold: fix header size related issues

2016-11-26 Thread Vitaly Wool
big"). Signed-off-by: Vitaly Wool --- mm/z3fold.c | 161 1 file changed, 87 insertions(+), 74 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 7ad70fa..efbcfcc 100644 --- a/mm/z3fold.c +++ b/mm/z3fol

[PATCH 0/2] z3fold fixes

2016-11-26 Thread Vitaly Wool
es that weren't compacted") and applied the coming 2 instead. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> [1] https://lkml.org/lkml/2016/11/25/595

[PATCH 0/2] z3fold fixes

2016-11-26 Thread Vitaly Wool
es that weren't compacted") and applied the coming 2 instead. Signed-off-by: Vitaly Wool [1] https://lkml.org/lkml/2016/11/25/595

Re: [PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-26 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 7:33 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Fri, Nov 25, 2016 at 11:25 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> On Fri, Nov 25, 2016 at 4:59 PM, Dan Streetman <ddstr...@ieee.org> wrote: >>> On Tue, Nov 15, 20

Re: [PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-26 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 7:33 PM, Dan Streetman wrote: > On Fri, Nov 25, 2016 at 11:25 AM, Vitaly Wool wrote: >> On Fri, Nov 25, 2016 at 4:59 PM, Dan Streetman wrote: >>> On Tue, Nov 15, 2016 at 11:00 AM, Vitaly Wool wrote: >>>> Currently the whole kernel bui

Re: [PATH] z3fold: extend compaction function

2016-11-26 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 10:17 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Fri, Nov 25, 2016 at 9:43 AM, Dan Streetman <ddstr...@ieee.org> wrote: >> On Thu, Nov 3, 2016 at 5:04 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >>> z3fold_compact_page() curre

Re: [PATH] z3fold: extend compaction function

2016-11-26 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 10:17 PM, Dan Streetman wrote: > On Fri, Nov 25, 2016 at 9:43 AM, Dan Streetman wrote: >> On Thu, Nov 3, 2016 at 5:04 PM, Vitaly Wool wrote: >>> z3fold_compact_page() currently only handles the situation when >>> there's a single middle c

Re: [PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-25 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 4:59 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Tue, Nov 15, 2016 at 11:00 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> Currently the whole kernel build will be stopped if the size of >> struct z3fold_header is greater than the size o

Re: [PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-25 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 4:59 PM, Dan Streetman wrote: > On Tue, Nov 15, 2016 at 11:00 AM, Vitaly Wool wrote: >> Currently the whole kernel build will be stopped if the size of >> struct z3fold_header is greater than the size of one chunk, which >> is 64 bytes by de

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-25 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 9:41 AM, Arnd Bergmann <a...@arndb.de> wrote: > On Friday, November 25, 2016 8:38:25 AM CET Vitaly Wool wrote: >> >> diff --git a/mm/z3fold.c b/mm/z3fold.c >> >> index e282ba073e77..66ac7a7dc934 100644 >> >> --- a/mm/z3fold.c &

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-25 Thread Vitaly Wool
On Fri, Nov 25, 2016 at 9:41 AM, Arnd Bergmann wrote: > On Friday, November 25, 2016 8:38:25 AM CET Vitaly Wool wrote: >> >> diff --git a/mm/z3fold.c b/mm/z3fold.c >> >> index e282ba073e77..66ac7a7dc934 100644 >> >> --- a/mm/z3fold.c >> >> +++

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-24 Thread Vitaly Wool
Hi Joe, On Thu, Nov 24, 2016 at 6:08 PM, Joe Perches wrote: > On Thu, 2016-11-24 at 17:31 +0100, Arnd Bergmann wrote: >> Printing a size_t requires the %zd format rather than %d: >> >> mm/z3fold.c: In function ‘init_z3fold’: >> include/linux/kern_levels.h:4:18: error: format

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-24 Thread Vitaly Wool
Hi Joe, On Thu, Nov 24, 2016 at 6:08 PM, Joe Perches wrote: > On Thu, 2016-11-24 at 17:31 +0100, Arnd Bergmann wrote: >> Printing a size_t requires the %zd format rather than %d: >> >> mm/z3fold.c: In function ‘init_z3fold’: >> include/linux/kern_levels.h:4:18: error: format ‘%d’ expects

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-24 Thread Vitaly Wool
t argument 2 has type ‘long unsigned int’ [-Werror=format=] > > Fixes: 50a50d2676c4 ("z3fold: don't fail kernel build if z3fold_header is too > big") > Signed-off-by: Arnd Bergmann <a...@arndb.de> Acked-by: Vitaly Wool <vitalyw...@gmail.com> And thanks :) ~v

Re: [PATCH] z3fold: use %z modifier for format string

2016-11-24 Thread Vitaly Wool
‘long unsigned int’ [-Werror=format=] > > Fixes: 50a50d2676c4 ("z3fold: don't fail kernel build if z3fold_header is too > big") > Signed-off-by: Arnd Bergmann Acked-by: Vitaly Wool And thanks :) ~vitaly > --- > mm/z3fold.c | 2 +- > 1 file changed, 1 insertion(

[PATCH 3/3] z3fold: discourage use of pages that weren't compacted

2016-11-15 Thread Vitaly Wool
5-7% improvement in randrw fio tests and about 10% improvement in fio sequential read/write. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index f

[PATCH 3/3] z3fold: discourage use of pages that weren't compacted

2016-11-15 Thread Vitaly Wool
5-7% improvement in randrw fio tests and about 10% improvement in fio sequential read/write. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index ffd9353..e282ba0 100644 --- a/mm

[PATCH 1/3] z3fold: use per-page spinlock

2016-11-15 Thread Vitaly Wool
by z3fold_alloc(), bail out from z3fold_free() early Changes from v3 [3]: - spinlock changed to raw spinlock to avoid BUILD_BUG_ON trigger [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 [3] https://lkml.org/lkml/2016/11/9/146 Signed-off-by: Vitaly Wool <vita

[PATCH 1/3] z3fold: use per-page spinlock

2016-11-15 Thread Vitaly Wool
by z3fold_alloc(), bail out from z3fold_free() early Changes from v3 [3]: - spinlock changed to raw spinlock to avoid BUILD_BUG_ON trigger [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 [3] https://lkml.org/lkml/2016/11/9/146 Signed-off-by: Vitaly Wool --- mm

[PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-15 Thread Vitaly Wool
. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 7ad70fa..ffd9353 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -870,10 +870,15 @@ MODULE_ALIAS("zpool-z3fold&q

[PATCH 2/3] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-15 Thread Vitaly Wool
. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 7ad70fa..ffd9353 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -870,10 +870,15 @@ MODULE_ALIAS("zpool-z3fold"); static int __init i

[PATCH 0/3] z3fold: per-page spinlock and other smaller optimizations

2016-11-15 Thread Vitaly Wool
Coming is the patchset with the per-page spinlock as the main modification, and two smaller dependent patches, one of which removes build error when the z3fold header size exceeds the size of a chunk, and the other puts non-compacted pages to the end of the unbuddied list. Signed-off-by: Vitaly

[PATCH 0/3] z3fold: per-page spinlock and other smaller optimizations

2016-11-15 Thread Vitaly Wool
Coming is the patchset with the per-page spinlock as the main modification, and two smaller dependent patches, one of which removes build error when the z3fold header size exceeds the size of a chunk, and the other puts non-compacted pages to the end of the unbuddied list. Signed-off-by: Vitaly

Re: [PATCH] z3fold: discourage use of pages that weren't compacted

2016-11-15 Thread Vitaly Wool
On Tue, Nov 15, 2016 at 1:33 AM, Andrew Morton <a...@linux-foundation.org> wrote: > On Fri, 11 Nov 2016 14:02:07 +0100 Vitaly Wool <vitalyw...@gmail.com> wrote: > >> If a z3fold page couldn't be compacted, we don't want it to be >> used for next object allocation in

Re: [PATCH] z3fold: discourage use of pages that weren't compacted

2016-11-15 Thread Vitaly Wool
On Tue, Nov 15, 2016 at 1:33 AM, Andrew Morton wrote: > On Fri, 11 Nov 2016 14:02:07 +0100 Vitaly Wool wrote: > >> If a z3fold page couldn't be compacted, we don't want it to be >> used for next object allocation in the first place. It makes more >> sense to add it to

[PATCH] z3fold: discourage use of pages that weren't compacted

2016-11-11 Thread Vitaly Wool
5-7% improvement in randrw fio tests and about 10% improvement in fio sequential read/write. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c

[PATCH] z3fold: discourage use of pages that weren't compacted

2016-11-11 Thread Vitaly Wool
5-7% improvement in randrw fio tests and about 10% improvement in fio sequential read/write. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 5fe2652..eb8f9a0 100644

[PATCH] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-09 Thread Vitaly Wool
-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index cd3713d..5fe2652 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -866,10 +866,15 @@ MODULE_ALIAS("zpool-z3fold"

[PATCH] z3fold: don't fail kernel build if z3fold_header is too big

2016-11-09 Thread Vitaly Wool
-off-by: Vitaly Wool --- mm/z3fold.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index cd3713d..5fe2652 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -866,10 +866,15 @@ MODULE_ALIAS("zpool-z3fold"); static int __init init_z

[PATCH v4] z3fold: use per-page spinlock

2016-11-09 Thread Vitaly Wool
by z3fold_alloc(), bail out from z3fold_free() early Changes from v3 [3]: - spinlock changed to raw spinlock to avoid BUILD_BUG_ON trigger [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 [3] https://lkml.org/lkml/2016/11/9/146 Signed-off-by: Vitaly Wool <vita

[PATCH v4] z3fold: use per-page spinlock

2016-11-09 Thread Vitaly Wool
by z3fold_alloc(), bail out from z3fold_free() early Changes from v3 [3]: - spinlock changed to raw spinlock to avoid BUILD_BUG_ON trigger [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 [3] https://lkml.org/lkml/2016/11/9/146 Signed-off-by: Vitaly Wool --- mm/z3fold.c

[PATCH v3] z3fold: use per-page read/write lock

2016-11-09 Thread Vitaly Wool
to spinlocks - no read/write locks, just per-page spinlock Changes from v2 [2]: - if a page is taken off its list by z3fold_alloc(), bail out from z3fold_free() early [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 Signed-off-by: Vitaly Wool <vitalyw...@gmail.

[PATCH v3] z3fold: use per-page read/write lock

2016-11-09 Thread Vitaly Wool
to spinlocks - no read/write locks, just per-page spinlock Changes from v2 [2]: - if a page is taken off its list by z3fold_alloc(), bail out from z3fold_free() early [1] https://lkml.org/lkml/2016/11/5/59 [2] https://lkml.org/lkml/2016/11/8/400 Signed-off-by: Vitaly Wool --- mm/z3fold.c | 137

[PATCH/RFC v2] z3fold: use per-page read/write lock

2016-11-08 Thread Vitaly Wool
to spinlocks - no read/write locks, just per-page spinlock [1] https://lkml.org/lkml/2016/11/5/59 Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 123 +--- 1 file changed, 85 insertions(+), 38 deletions(-) diff --gi

[PATCH/RFC v2] z3fold: use per-page read/write lock

2016-11-08 Thread Vitaly Wool
to spinlocks - no read/write locks, just per-page spinlock [1] https://lkml.org/lkml/2016/11/5/59 Signed-off-by: Vitaly Wool --- mm/z3fold.c | 123 +--- 1 file changed, 85 insertions(+), 38 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c

Re: [PATCH/RFC] z3fold: use per-page read/write lock

2016-11-06 Thread Vitaly Wool
On Sun, Nov 6, 2016 at 12:38 AM, Andi Kleen <a...@firstfloor.org> wrote: > Vitaly Wool <vitalyw...@gmail.com> writes: > >> Most of z3fold operations are in-page, such as modifying z3fold >> page header or moving z3fold objects within a page. Taking >> per-pool

Re: [PATCH/RFC] z3fold: use per-page read/write lock

2016-11-06 Thread Vitaly Wool
On Sun, Nov 6, 2016 at 12:38 AM, Andi Kleen wrote: > Vitaly Wool writes: > >> Most of z3fold operations are in-page, such as modifying z3fold >> page header or moving z3fold objects within a page. Taking >> per-pool spinlock to protect per-page objects is therefore >

[PATCH/RFC] z3fold: use per-page read/write lock

2016-11-05 Thread Vitaly Wool
one directly to the z3fold header makes the latter quite big on some systems so that it won't fit in a signle chunk. This patch implements custom per-page read/write locking mechanism which is lightweight enough to fit into the z3fold header. Signed-off-by: Vitaly Wool <vitalyw...@gmail.

[PATCH/RFC] z3fold: use per-page read/write lock

2016-11-05 Thread Vitaly Wool
one directly to the z3fold header makes the latter quite big on some systems so that it won't fit in a signle chunk. This patch implements custom per-page read/write locking mechanism which is lightweight enough to fit into the z3fold header. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 148

Re: [PATCH] z3fold: make pages_nr atomic

2016-11-04 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 11:17 PM, Andrew Morton <a...@linux-foundation.org> wrote: > On Thu, 3 Nov 2016 22:24:07 +0100 Vitaly Wool <vitalyw...@gmail.com> wrote: > >> On Thu, Nov 3, 2016 at 10:14 PM, Andrew Morton >> <a...@linux-foundation.org> wrote: >>

Re: [PATCH] z3fold: make pages_nr atomic

2016-11-04 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 11:17 PM, Andrew Morton wrote: > On Thu, 3 Nov 2016 22:24:07 +0100 Vitaly Wool wrote: > >> On Thu, Nov 3, 2016 at 10:14 PM, Andrew Morton >> wrote: >> > On Thu, 3 Nov 2016 22:00:58 +0100 Vitaly Wool wrote: >> > >> >&g

Re: [PATH] z3fold: extend compaction function

2016-11-03 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 10:16 PM, Andrew Morton <a...@linux-foundation.org> wrote: > On Thu, 3 Nov 2016 22:04:28 +0100 Vitaly Wool <vitalyw...@gmail.com> wrote: > >> z3fold_compact_page() currently only handles the situation when >> there's a single middle chunk w

Re: [PATH] z3fold: extend compaction function

2016-11-03 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 10:16 PM, Andrew Morton wrote: > On Thu, 3 Nov 2016 22:04:28 +0100 Vitaly Wool wrote: > >> z3fold_compact_page() currently only handles the situation when >> there's a single middle chunk within the z3fold page. However it >> may be worth it to

Re: [PATCH] z3fold: make pages_nr atomic

2016-11-03 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 10:14 PM, Andrew Morton <a...@linux-foundation.org> wrote: > On Thu, 3 Nov 2016 22:00:58 +0100 Vitaly Wool <vitalyw...@gmail.com> wrote: > >> This patch converts pages_nr per-pool counter to atomic64_t. > > Which is slower. > > Pre

Re: [PATCH] z3fold: make pages_nr atomic

2016-11-03 Thread Vitaly Wool
On Thu, Nov 3, 2016 at 10:14 PM, Andrew Morton wrote: > On Thu, 3 Nov 2016 22:00:58 +0100 Vitaly Wool wrote: > >> This patch converts pages_nr per-pool counter to atomic64_t. > > Which is slower. > > Presumably there is a reason for making this change. This reas

[PATH] z3fold: extend compaction function

2016-11-03 Thread Vitaly Wool
, using BIG_CHUNK_GAP define as a threshold for middle chunk to be worth moving. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 60 +++- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/mm/z3fold.

[PATH] z3fold: extend compaction function

2016-11-03 Thread Vitaly Wool
, using BIG_CHUNK_GAP define as a threshold for middle chunk to be worth moving. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 60 +++- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 4d02280

[PATCH] z3fold: make pages_nr atomic

2016-11-03 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 8f9e89c..4d02280 100644 --

[PATCH] z3fold: make pages_nr atomic

2016-11-03 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 8f9e89c..4d02280 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c

Re: [PATCHv3 2/3] z3fold: change per-pool spinlock to rwlock

2016-11-01 Thread Vitaly Wool
On Tue, Nov 1, 2016 at 9:16 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Thu, Oct 27, 2016 at 7:12 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> Mapping/unmapping goes with no actual modifications so it makes >> sense to only take a read lock in map/unmap functio

Re: [PATCHv3 2/3] z3fold: change per-pool spinlock to rwlock

2016-11-01 Thread Vitaly Wool
On Tue, Nov 1, 2016 at 9:16 PM, Dan Streetman wrote: > On Thu, Oct 27, 2016 at 7:12 AM, Vitaly Wool wrote: >> Mapping/unmapping goes with no actual modifications so it makes >> sense to only take a read lock in map/unmap functions. >> >> This change gives up to 10%

Re: [PATCHv3 1/3] z3fold: make counters atomic

2016-11-01 Thread Vitaly Wool
On Tue, Nov 1, 2016 at 9:03 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Thu, Oct 27, 2016 at 7:08 AM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> This patch converts pages_nr per-pool counter to atomic64_t. >> It also introduces a new counter, unbuddied_nr,

Re: [PATCHv3 1/3] z3fold: make counters atomic

2016-11-01 Thread Vitaly Wool
On Tue, Nov 1, 2016 at 9:03 PM, Dan Streetman wrote: > On Thu, Oct 27, 2016 at 7:08 AM, Vitaly Wool wrote: >> This patch converts pages_nr per-pool counter to atomic64_t. >> It also introduces a new counter, unbuddied_nr, which is >> atomic64_t, too, to track the number of u

[PATCHv3 3/3] z3fold: add compaction worker

2016-10-27 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 166 ++-- 1 file changed, 140 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 014d84f..cc26ff5 100644 --- a/mm/z3fold.c ++

[PATCHv3 3/3] z3fold: add compaction worker

2016-10-27 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 166 ++-- 1 file changed, 140 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 014d84f..cc26ff5 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -27,6 +27,7

[PATCHv3 1/3] z3fold: make counters atomic

2016-10-27 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.

[PATCHv3 1/3] z3fold: make counters atomic

2016-10-27 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 33 + 1 file changed

[PATCHv3 2/3] z3fold: change per-pool spinlock to rwlock

2016-10-27 Thread Vitaly Wool
=280249KB/s, maxb=281130KB/s, mint=839218msec, maxt=841856msec Run status group 1 (all jobs): READ: io=2700.0GB, aggrb=5210.7MB/s, minb=444640KB/s, maxb=447791KB/s, mint=526874msec, maxt=530607msec Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.

[PATCHv3 2/3] z3fold: change per-pool spinlock to rwlock

2016-10-27 Thread Vitaly Wool
=280249KB/s, maxb=281130KB/s, mint=839218msec, maxt=841856msec Run status group 1 (all jobs): READ: io=2700.0GB, aggrb=5210.7MB/s, minb=444640KB/s, maxb=447791KB/s, mint=526874msec, maxt=530607msec Signed-off-by: Vitaly Wool --- mm/z3fold.c | 44

[PATCHv3 0/3] z3fold: background page compaction

2016-10-27 Thread Vitaly Wool
. The patchset thus implements in-page compaction worker for z3fold, preceded by some code optimizations and preparations which, again, deserved to be separate patches. Changes compared to v2: - more accurate accounting of unbuddied_nr, per Dan's comments - various cleanups. Signed-off-by: Vitaly

[PATCHv3 0/3] z3fold: background page compaction

2016-10-27 Thread Vitaly Wool
. The patchset thus implements in-page compaction worker for z3fold, preceded by some code optimizations and preparations which, again, deserved to be separate patches. Changes compared to v2: - more accurate accounting of unbuddied_nr, per Dan's comments - various cleanups. Signed-off-by: Vitaly

Re: [PATCH 2/3] z3fold: remove redundant locking

2016-10-22 Thread Vitaly Wool
On Thu, Oct 20, 2016 at 10:15 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Wed, Oct 19, 2016 at 12:35 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> The per-pool z3fold spinlock should generally be taken only when >> a non-atomic pool variable is modifi

Re: [PATCH 2/3] z3fold: remove redundant locking

2016-10-22 Thread Vitaly Wool
On Thu, Oct 20, 2016 at 10:15 PM, Dan Streetman wrote: > On Wed, Oct 19, 2016 at 12:35 PM, Vitaly Wool wrote: >> The per-pool z3fold spinlock should generally be taken only when >> a non-atomic pool variable is modified. There's no need to take it >> to map/unmap an object.

Re: [PATCH 1/3] z3fold: make counters atomic

2016-10-22 Thread Vitaly Wool
On Thu, Oct 20, 2016 at 10:17 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Wed, Oct 19, 2016 at 12:35 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> This patch converts pages_nr per-pool counter to atomic64_t. >> It also introduces a new counter, unbuddied_nr,

Re: [PATCH 1/3] z3fold: make counters atomic

2016-10-22 Thread Vitaly Wool
On Thu, Oct 20, 2016 at 10:17 PM, Dan Streetman wrote: > On Wed, Oct 19, 2016 at 12:35 PM, Vitaly Wool wrote: >> This patch converts pages_nr per-pool counter to atomic64_t. >> It also introduces a new counter, unbuddied_nr, which is >> atomic64_t, too, to track th

[PATCHv2 3/3] z3fold: add compaction worker

2016-10-20 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 166 ++-- 1 file changed, 140 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 014d84f..cc26ff5 100644 --- a/mm/z3fold.c ++

[PATCHv2 3/3] z3fold: add compaction worker

2016-10-20 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 166 ++-- 1 file changed, 140 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 014d84f..cc26ff5 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -27,6 +27,7

[PATCHv2 2/3] z3fold: change per-pool spinlock to rwlock

2016-10-20 Thread Vitaly Wool
Mapping/unmapping goes with no actual modifications so it makes sense to only take a read lock in map/unmap functions. This change gives up to 15% performance gain in fio tests. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.

[PATCHv2 2/3] z3fold: change per-pool spinlock to rwlock

2016-10-20 Thread Vitaly Wool
Mapping/unmapping goes with no actual modifications so it makes sense to only take a read lock in map/unmap functions. This change gives up to 15% performance gain in fio tests. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 44 +++- 1 file changed, 23

[PATCHv2 1/3] z3fold: make counters atomic

2016-10-20 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.

[PATCHv2 1/3] z3fold: make counters atomic

2016-10-20 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 33 + 1 file changed

[PATCHv2 0/3] z3fold: background page compaction

2016-10-20 Thread Vitaly Wool
on x86_64 with gcc 6.0) and non-obvious performance benefits - instead, per-pool spinlock is substituted with rwlock. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> [1] https://lkml.org/lkml/2016/10/15/31

[PATCHv2 0/3] z3fold: background page compaction

2016-10-20 Thread Vitaly Wool
on x86_64 with gcc 6.0) and non-obvious performance benefits - instead, per-pool spinlock is substituted with rwlock. Signed-off-by: Vitaly Wool [1] https://lkml.org/lkml/2016/10/15/31

[PATCH 3/3] z3fold: add compaction worker

2016-10-19 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.c | 159 ++-- 1 file changed, 133 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 329bc26..580a732 100644 --- a/mm/z3fold.c ++

[PATCH 3/3] z3fold: add compaction worker

2016-10-19 Thread Vitaly Wool
Linus's tree. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 159 ++-- 1 file changed, 133 insertions(+), 26 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index 329bc26..580a732 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -27,6 +27,7

[PATCH 0/3] z3fold: background page compaction

2016-10-19 Thread Vitaly Wool
. The patchset thus implements in-page compaction worker for z3fold, preceded by some code optimizations and preparations which, again, deserved to be separate patches. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> [1] https://lkml.org/lkml/2016/10/15/31

[PATCH 2/3] z3fold: remove redundant locking

2016-10-19 Thread Vitaly Wool
The per-pool z3fold spinlock should generally be taken only when a non-atomic pool variable is modified. There's no need to take it to map/unmap an object. This patch introduces per-page lock that will be used instead to protect per-page variables in map/unmap functions. Signed-off-by: Vitaly

[PATCH 1/3] z3fold: make counters atomic

2016-10-19 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool <vitalyw...@gmail.com> --- mm/z3fold.

[PATCH 0/3] z3fold: background page compaction

2016-10-19 Thread Vitaly Wool
. The patchset thus implements in-page compaction worker for z3fold, preceded by some code optimizations and preparations which, again, deserved to be separate patches. Signed-off-by: Vitaly Wool [1] https://lkml.org/lkml/2016/10/15/31

[PATCH 2/3] z3fold: remove redundant locking

2016-10-19 Thread Vitaly Wool
The per-pool z3fold spinlock should generally be taken only when a non-atomic pool variable is modified. There's no need to take it to map/unmap an object. This patch introduces per-page lock that will be used instead to protect per-page variables in map/unmap functions. Signed-off-by: Vitaly

[PATCH 1/3] z3fold: make counters atomic

2016-10-19 Thread Vitaly Wool
This patch converts pages_nr per-pool counter to atomic64_t. It also introduces a new counter, unbuddied_nr, which is atomic64_t, too, to track the number of unbuddied (compactable) z3fold pages. Signed-off-by: Vitaly Wool --- mm/z3fold.c | 33 + 1 file changed

Re: [PATCH v5] z3fold: add shrinker

2016-10-18 Thread Vitaly Wool
On Tue, Oct 18, 2016 at 7:35 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Tue, Oct 18, 2016 at 12:26 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> 18 окт. 2016 г. 18:29 пользователь "Dan Streetman" <ddstr...@ieee.org> >> написал: >> >>

Re: [PATCH v5] z3fold: add shrinker

2016-10-18 Thread Vitaly Wool
On Tue, Oct 18, 2016 at 7:35 PM, Dan Streetman wrote: > On Tue, Oct 18, 2016 at 12:26 PM, Vitaly Wool wrote: >> 18 окт. 2016 г. 18:29 пользователь "Dan Streetman" >> написал: >> >> >>> >>> On Tue, Oct 18, 2016 at 10:51 AM, Vitaly Wool

Re: [PATCH] z3fold: limit first_num to the actual range of possible buddy indexes

2016-10-18 Thread Vitaly Wool
y: Dan Streetman <ddstr...@ieee.org> >> Signed-off-by: zhong jiang <zhongji...@huawei.com> > > Acked-by: Dan Streetman <ddstr...@ieee.org> Acked-by: Vitaly Wool <vitalyw...@gmail.com> >> ---> mm/z3fold.c | 10 +++--- >> 1 file changed, 7 insertions(+),

Re: [PATCH] z3fold: limit first_num to the actual range of possible buddy indexes

2016-10-18 Thread Vitaly Wool
of buddies. >> >> The patch limit the first_num to actual range of possible buddy indexes. >> and that is more reasonable and obvious without functional change. >> >> Suggested-by: Dan Streetman >> Signed-off-by: zhong jiang > > Acked-by: Dan Streetman Ac

Re: [PATCH v5 3/3] z3fold: add shrinker

2016-10-18 Thread Vitaly Wool
On Tue, Oct 18, 2016 at 4:27 PM, Dan Streetman <ddstr...@ieee.org> wrote: > On Mon, Oct 17, 2016 at 10:45 PM, Vitaly Wool <vitalyw...@gmail.com> wrote: >> Hi Dan, >> >> On Tue, Oct 18, 2016 at 4:06 AM, Dan Streetman <ddstr...@ieee.org> wrote: >>&

Re: [PATCH v5 3/3] z3fold: add shrinker

2016-10-18 Thread Vitaly Wool
On Tue, Oct 18, 2016 at 4:27 PM, Dan Streetman wrote: > On Mon, Oct 17, 2016 at 10:45 PM, Vitaly Wool wrote: >> Hi Dan, >> >> On Tue, Oct 18, 2016 at 4:06 AM, Dan Streetman wrote: >>> On Sat, Oct 15, 2016 at 8:05 AM, Vitaly Wool wrote: >>>>

<    1   2   3   4   5   >