Re: [PATCH v3 5/5] psi: introduce psi monitor

2019-01-28 Thread Minchan Kim
Hi Suren, When I review first time, it was rather hard to understand due to naming so below comments are mostly cleanup or minor. I'm not strong against if you don't think it's helpful. Feel free to select parts. Thanks. On Thu, Jan 24, 2019 at 01:15:18PM -0800, Suren Baghdasaryan wrote: > Psi

Re: [PATCH] zram: idle writeback fixes and cleanup

2018-12-27 Thread Minchan Kim
Hi Sergey, On Thu, Dec 27, 2018 at 11:26:24AM +0900, Sergey Senozhatsky wrote: > On (12/24/18 12:35), Minchan Kim wrote: > [..] > > @@ -645,10 +680,13 @@ static ssize_t writeback_store(struct device *dev, > > bvec.bv_len = PAGE_SIZE; > >

[PATCH] zram: idle writeback fixes and cleanup

2018-12-23 Thread Minchan Kim
ck idle/huge writeback mode check The mode in writeback_store is not bit opeartion any more so no need to use bit operations. Furthermore, current condition check is broken in that it does writeback every pages regardless of huge/idle. 3. clean up idle_store No need to use goto. Suggested-by: John

Re: [PATCH v3 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
On Mon, Dec 03, 2018 at 11:30:40AM +0900, Sergey Senozhatsky wrote: > On (12/03/18 08:18), Minchan Kim wrote: > > > > Per andrew's comment: > > https://lkml.org/lkml/2018/11/27/156 > > > > I need to fix it to represent 4K always. > > Aha. > > Th

Re: [PATCH v3 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
On Mon, Dec 03, 2018 at 11:30:40AM +0900, Sergey Senozhatsky wrote: > On (12/03/18 08:18), Minchan Kim wrote: > > > > Per andrew's comment: > > https://lkml.org/lkml/2018/11/27/156 > > > > I need to fix it to represent 4K always. > > Aha. > > Th

[PATCH v4 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
/zram0/writeback_limit The writeback_limit count will reset whenever you reset zram(e.g., system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of writeback happened until you reset the zram to allocate extra writeback budget in next setting is user's job. Signed-off-by: Minchan Kim --- I

[PATCH v4 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
/zram0/writeback_limit The writeback_limit count will reset whenever you reset zram(e.g., system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of writeback happened until you reset the zram to allocate extra writeback budget in next setting is user's job. Signed-off-by: Minchan Kim --- I

[PATCH v4 2/7] zram: fix double free backing device

2018-12-02 Thread Minchan Kim
wed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- 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 21a7046958a3..d1459cc1159f 100644 --- a/driver

[PATCH v4 4/7] zram: introduce ZRAM_IDLE flag

2018-12-02 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Reviewed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 +++ Documentation/blockdev/zram.txt|

[PATCH v4 5/7] zram: support idle/huge page writeback

2018-12-02 Thread Minchan Kim
back" around. ZRAM is especially popular on devices which do suffer from flash wearout, so I can see "incompressible writeback" path becoming a dead code, long term. == &< == Below concerns from Minchan: == &< == My concern is if we enable CONFIG_ZRAM_WRITEBACK in this

[PATCH v4 6/7] zram: add bd_stat statistics

2018-12-02 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v4 1/7] zram: fix lockdep warning of free block handling

2018-12-02 Thread Minchan Kim
n zram_slot_slot_free_notify. To make it safe is this patch introduces zram_slot_trylock where zram_slot_free_notify uses it. Although it's rare to be contented, this patch adds new debug stat "miss_free" to keep monitoring how often it happens. Reviewed-by: Joey Pabalinas Reviewed-by: Serge

[PATCH v4 2/7] zram: fix double free backing device

2018-12-02 Thread Minchan Kim
wed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- 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 21a7046958a3..d1459cc1159f 100644 --- a/driver

[PATCH v4 4/7] zram: introduce ZRAM_IDLE flag

2018-12-02 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Reviewed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 +++ Documentation/blockdev/zram.txt|

[PATCH v4 5/7] zram: support idle/huge page writeback

2018-12-02 Thread Minchan Kim
back" around. ZRAM is especially popular on devices which do suffer from flash wearout, so I can see "incompressible writeback" path becoming a dead code, long term. == &< == Below concerns from Minchan: == &< == My concern is if we enable CONFIG_ZRAM_WRITEBACK in this

[PATCH v4 6/7] zram: add bd_stat statistics

2018-12-02 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v4 1/7] zram: fix lockdep warning of free block handling

2018-12-02 Thread Minchan Kim
n zram_slot_slot_free_notify. To make it safe is this patch introduces zram_slot_trylock where zram_slot_free_notify uses it. Although it's rare to be contented, this patch adds new debug stat "miss_free" to keep monitoring how often it happens. Reviewed-by: Joey Pabalinas Reviewed-by: Serge

[PATCH v4 3/7] zram: refactoring flags and writeback stuff

2018-12-02 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Reviewed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers

[PATCH v4 0/7] zram idle page writeback

2018-12-02 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v3 - add more words in changelog - akpm - clarification writeback limit - akpm - fix 4k unit of bd_stat - akpm - change writeback_limit interface - minchan - add reviewed-by - sergey, joey * from

[PATCH v4 0/7] zram idle page writeback

2018-12-02 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v3 - add more words in changelog - akpm - clarification writeback limit - akpm - fix 4k unit of bd_stat - akpm - change writeback_limit interface - minchan - add reviewed-by - sergey, joey * from

[PATCH v4 3/7] zram: refactoring flags and writeback stuff

2018-12-02 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Reviewed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers

Re: [PATCH v3 0/7] zram idle page writeback

2018-12-02 Thread Minchan Kim
On Fri, Nov 30, 2018 at 01:36:56PM +0900, Sergey Senozhatsky wrote: > On (11/27/18 14:54), Minchan Kim wrote: > > Inherently, swap device has many idle pages which are rare touched since > > it was allocated. It is never problem if we use storage device as swap. > > How

Re: [PATCH v3 0/7] zram idle page writeback

2018-12-02 Thread Minchan Kim
On Fri, Nov 30, 2018 at 01:36:56PM +0900, Sergey Senozhatsky wrote: > On (11/27/18 14:54), Minchan Kim wrote: > > Inherently, swap device has many idle pages which are rare touched since > > it was allocated. It is never problem if we use storage device as swap. > > How

Re: [PATCH v3 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
On Thu, Nov 29, 2018 at 11:23:58AM +0900, Sergey Senozhatsky wrote: > On (11/27/18 14:54), Minchan Kim wrote: > > diff --git a/Documentation/ABI/testing/sysfs-block-zram > > b/Documentation/ABI/testing/sysfs-block-zram > > index 65fc33b2f53b..9d2339a485c8 100644 > &

Re: [PATCH v3 7/7] zram: writeback throttle

2018-12-02 Thread Minchan Kim
On Thu, Nov 29, 2018 at 11:23:58AM +0900, Sergey Senozhatsky wrote: > On (11/27/18 14:54), Minchan Kim wrote: > > diff --git a/Documentation/ABI/testing/sysfs-block-zram > > b/Documentation/ABI/testing/sysfs-block-zram > > index 65fc33b2f53b..9d2339a485c8 100644 > &

Re: [PATCH v3 7/7] zram: writeback throttle

2018-11-28 Thread Minchan Kim
On Wed, Nov 28, 2018 at 03:41:41PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 14:54:29 +0900 Minchan Kim wrote: > > > On small memory system, there are lots of write IO so if we use > > flash device as swap, there would be serious flash wearout. > > To over

Re: [PATCH v3 7/7] zram: writeback throttle

2018-11-28 Thread Minchan Kim
On Wed, Nov 28, 2018 at 03:41:41PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 14:54:29 +0900 Minchan Kim wrote: > > > On small memory system, there are lots of write IO so if we use > > flash device as swap, there would be serious flash wearout. > > To over

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-28 Thread Minchan Kim
On Wed, Nov 28, 2018 at 03:30:21PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 11:07:54 +0900 Minchan Kim wrote: > > > On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > > > On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > > > > &g

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-28 Thread Minchan Kim
On Wed, Nov 28, 2018 at 03:30:21PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 11:07:54 +0900 Minchan Kim wrote: > > > On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > > > On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > > > > &g

Re: [PATCH v3 5/7] zram: support idle/huge page writeback

2018-11-28 Thread Minchan Kim
Hi Andrew, On Wed, Nov 28, 2018 at 03:35:59PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 14:54:27 +0900 Minchan Kim wrote: > > > This patch supports new feature "zram idle/huge page writeback". > > On zram-swap usecase, zram has usually many idle/huge sw

Re: [PATCH v3 5/7] zram: support idle/huge page writeback

2018-11-28 Thread Minchan Kim
Hi Andrew, On Wed, Nov 28, 2018 at 03:35:59PM -0800, Andrew Morton wrote: > On Tue, 27 Nov 2018 14:54:27 +0900 Minchan Kim wrote: > > > This patch supports new feature "zram idle/huge page writeback". > > On zram-swap usecase, zram has usually many idle/huge sw

[PATCH v3 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 + Documentation/blockde

[PATCH v3 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 + Documentation/blockde

[PATCH v3 3/7] zram: refactoring flags and writeback stuff

2018-11-26 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers/block/zram/zram_drv.h | 8 +-- 2 files changed, 44

[PATCH v3 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v3 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
n't go to backing storage automatically. Instead, usre should do it via "echo huge" > /sys/block/zram/writeback" manually. If we hear some regression, we could restore the function. Reviewed-by: Joey Pabalinas Signed-off-by: Minchan Kim --- Documentation/ABI/testing/

[PATCH v3 2/7] zram: fix double free backing device

2018-11-26 Thread Minchan Kim
ges_ok+0x1e3/0x490 [ 31.112437] hardirqs last disabled at (4466): [] trace_hardirqs_off_thunk+0x1a/0x1c [ 31.113973] softirqs last enabled at (3420): [] __do_softirq+0x333/0x446 [ 31.115364] softirqs last disabled at (3407): [] irq_exit+0xd1/0xe0 Cc: sta...@vger.kernel.org # 4.14+ Signed-off

[PATCH v3 4/7] zram: introduce ZRAM_IDLE flag

2018-11-26 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 +++ Documentation/blockdev/zram.txt| 10 ++-- drivers/block/zram/zram_

[PATCH v3 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
n zram_slot_slot_free_notify. To make it safe is this patch introduces zram_slot_trylock where zram_slot_free_notify uses it. Although it's rare to be contented, this patch adds new debug stat "miss_free" to keep monitoring how often it happens. Signed-off-b

[PATCH v3 2/7] zram: fix double free backing device

2018-11-26 Thread Minchan Kim
ges_ok+0x1e3/0x490 [ 31.112437] hardirqs last disabled at (4466): [] trace_hardirqs_off_thunk+0x1a/0x1c [ 31.113973] softirqs last enabled at (3420): [] __do_softirq+0x333/0x446 [ 31.115364] softirqs last disabled at (3407): [] irq_exit+0xd1/0xe0 Cc: sta...@vger.kernel.org # 4.14+ Signed-off

[PATCH v3 4/7] zram: introduce ZRAM_IDLE flag

2018-11-26 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 +++ Documentation/blockdev/zram.txt| 10 ++-- drivers/block/zram/zram_

[PATCH v3 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
n zram_slot_slot_free_notify. To make it safe is this patch introduces zram_slot_trylock where zram_slot_free_notify uses it. Although it's rare to be contented, this patch adds new debug stat "miss_free" to keep monitoring how often it happens. Signed-off-b

[PATCH v3 3/7] zram: refactoring flags and writeback stuff

2018-11-26 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers/block/zram/zram_drv.h | 8 +-- 2 files changed, 44

[PATCH v3 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v3 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
n't go to backing storage automatically. Instead, usre should do it via "echo huge" > /sys/block/zram/writeback" manually. If we hear some regression, we could restore the function. Reviewed-by: Joey Pabalinas Signed-off-by: Minchan Kim --- Documentation/ABI/testing/

[PATCH v3 0/7] zram idle page writeback

2018-11-26 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v2 - use strscpy instead of strlcpy - Joey Pabalinas - remove irqlock for bitmap op - akpm - don't use page as stat unit - akpm * from v1 - add fix dobule free backing device - minchan - change writ

[PATCH v3 0/7] zram idle page writeback

2018-11-26 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v2 - use strscpy instead of strlcpy - Joey Pabalinas - remove irqlock for bitmap op - akpm - don't use page as stat unit - akpm * from v1 - add fix dobule free backing device - minchan - change writ

Re: [PATCH v2 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
On Sun, Nov 25, 2018 at 11:47:37PM -1000, Joey Pabalinas wrote: > On Mon, Nov 26, 2018 at 05:28:11PM +0900, Minchan Kim wrote: > > + strlcpy(mode_buf, buf, sizeof(mode_buf)); > > + /* ignore trailing newline */ > > + sz = strlen(mode_buf); > > One possible i

Re: [PATCH v2 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
On Sun, Nov 25, 2018 at 11:47:37PM -1000, Joey Pabalinas wrote: > On Mon, Nov 26, 2018 at 05:28:11PM +0900, Minchan Kim wrote: > > + strlcpy(mode_buf, buf, sizeof(mode_buf)); > > + /* ignore trailing newline */ > > + sz = strlen(mode_buf); > > One possible i

Re: [PATCH v2 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:54:46PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:13 +0900 Minchan Kim wrote: > > > On small memory system, there are lots of write IO so if we use > > flash device as swap, there would be serious flash wearout. > > To over

Re: [PATCH v2 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:54:46PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:13 +0900 Minchan Kim wrote: > > > On small memory system, there are lots of write IO so if we use > > flash device as swap, there would be serious flash wearout. > > To over

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > > > +File /sys/block/zram/bd_stat > > + > > +The stat file represents device's backing device statistics. It consists of > > +a single line of t

Re: [PATCH v2 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > > > +File /sys/block/zram/bd_stat > > + > > +The stat file represents device's backing device statistics. It consists of > > +a single line of t

Re: [PATCH v2 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:49:28PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:07 +0900 Minchan Kim wrote: > > > > > ... > > > > With writeback feature, zram_slot_free_notify could be called > > in softirq context by end_swap_bio_read. H

Re: [PATCH v2 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
On Mon, Nov 26, 2018 at 12:49:28PM -0800, Andrew Morton wrote: > On Mon, 26 Nov 2018 17:28:07 +0900 Minchan Kim wrote: > > > > > ... > > > > With writeback feature, zram_slot_free_notify could be called > > in softirq context by end_swap_bio_read. H

[PATCH v2 3/7] zram: refactoring flags and writeback stuff

2018-11-26 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers/block/zram/zram_drv.h | 8 +-- 2 files changed, 44

[PATCH v2 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
n't go to backing storage automatically. Instead, usre should do it via "echo huge" > /sys/block/zram/writeback" manually. If we hear some regression, we could restore the function. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 7 + Documentation/b

[PATCH v2 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
ather than bottom half is swap_slot_free_notify could be called with irq disabled so it breaks local_bh_enable's rule. The irqlock works on only writebacked zram slot entry so it should be not frequent lock. Cc: sta...@vger.kernel.org # 4.14+ Signed-off-by: Minchan Kim --- drivers/block/zram/zra

[PATCH v2 2/7] zram: fix double free backing device

2018-11-26 Thread Minchan Kim
ges_ok+0x1e3/0x490 [ 31.112437] hardirqs last disabled at (4466): [] trace_hardirqs_off_thunk+0x1a/0x1c [ 31.113973] softirqs last enabled at (3420): [] __do_softirq+0x333/0x446 [ 31.115364] softirqs last disabled at (3407): [] irq_exit+0xd1/0xe0 Cc: sta...@vger.kernel.org # 4.14+ Signed-off

[PATCH v2 3/7] zram: refactoring flags and writeback stuff

2018-11-26 Thread Minchan Kim
This patch does renaming some variables and restructuring some codes for better redability in writeback and zs_free_page. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 105 +- drivers/block/zram/zram_drv.h | 8 +-- 2 files changed, 44

[PATCH v2 5/7] zram: support idle/huge page writeback

2018-11-26 Thread Minchan Kim
n't go to backing storage automatically. Instead, usre should do it via "echo huge" > /sys/block/zram/writeback" manually. If we hear some regression, we could restore the function. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 7 + Documentation/b

[PATCH v2 1/7] zram: fix lockdep warning of free block handling

2018-11-26 Thread Minchan Kim
ather than bottom half is swap_slot_free_notify could be called with irq disabled so it breaks local_bh_enable's rule. The irqlock works on only writebacked zram slot entry so it should be not frequent lock. Cc: sta...@vger.kernel.org # 4.14+ Signed-off-by: Minchan Kim --- drivers/block/zram/zra

[PATCH v2 2/7] zram: fix double free backing device

2018-11-26 Thread Minchan Kim
ges_ok+0x1e3/0x490 [ 31.112437] hardirqs last disabled at (4466): [] trace_hardirqs_off_thunk+0x1a/0x1c [ 31.113973] softirqs last enabled at (3420): [] __do_softirq+0x333/0x446 [ 31.115364] softirqs last disabled at (3407): [] irq_exit+0xd1/0xe0 Cc: sta...@vger.kernel.org # 4.14+ Signed-off

[PATCH v2 0/7] zram idle page writeback

2018-11-26 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v1 - add fix dobule free backing device - minchan - change writeback/idle interface - minchan - remove direct incompressible page writeback - sergey Minchan Kim (7): zram: fix lockdep warning of

[PATCH v2 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 + Documentation/blockde

[PATCH v2 4/7] zram: introduce ZRAM_IDLE flag

2018-11-26 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 Documentation/blockdev/zram.txt| 10 ++-- drivers/block/zram/zram_

[PATCH v2 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v2 4/7] zram: introduce ZRAM_IDLE flag

2018-11-26 Thread Minchan Kim
0th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 Documentation/blockdev/zram.txt| 10 ++-- drivers/block/zram/zram_

[PATCH v2 6/7] zram: add bd_stat statistics

2018-11-26 Thread Minchan Kim
bd_stat represents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH v2 0/7] zram idle page writeback

2018-11-26 Thread Minchan Kim
ix lockdep warning of free block handling zram: fix double free backing device * from v1 - add fix dobule free backing device - minchan - change writeback/idle interface - minchan - remove direct incompressible page writeback - sergey Minchan Kim (7): zram: fix lockdep warning of

[PATCH v2 7/7] zram: writeback throttle

2018-11-26 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 + Documentation/blockde

[PATCH] [PATCH for v3.18] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 7e94459a489a..5f4e6a3c2dde 100644 --- a/drivers/block

[PATCH] [PATCH for v3.18] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 7e94459a489a..5f4e6a3c2dde 100644 --- a/drivers/block

[PATCH] [PATCH for v4.4] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 502406c9e6e1..616ee4f9c233 100644

[PATCH] [PATCH for v4.4] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 502406c9e6e1..616ee4f9c233 100644

[PATCH for 4.9] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index b7c0b69a02f5..d64a53d3270a 100644

[PATCH for 4.9] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index b7c0b69a02f5..d64a53d3270a 100644

[PATCH for v4.14] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 1e2648e4c286..27b202c64c84 100644

[PATCH for v4.14] zram: close udev startup race condition as default groups

2018-11-22 Thread Minchan Kim
Reinecke Tested-by: Howard Chen Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 1e2648e4c286..27b202c64c84 100644

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-22 Thread Minchan Kim
On Thu, Nov 22, 2018 at 03:59:26PM +0900, Sergey Senozhatsky wrote: > On (11/22/18 15:31), Minchan Kim wrote: > > > > > > I got what you mean now. Let's call it as "incompressible page wrieback" > > > to prevent confusing. > > > > > >

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-22 Thread Minchan Kim
On Thu, Nov 22, 2018 at 03:59:26PM +0900, Sergey Senozhatsky wrote: > On (11/22/18 15:31), Minchan Kim wrote: > > > > > > I got what you mean now. Let's call it as "incompressible page wrieback" > > > to prevent confusing. > > > > > >

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 03:15:42PM +0900, Minchan Kim wrote: > On Thu, Nov 22, 2018 at 02:40:40PM +0900, Sergey Senozhatsky wrote: > > On (11/22/18 14:04), Minchan Kim wrote: > > > > > > > additionally, it's too simple. It writes-back pages which can be > &g

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 03:15:42PM +0900, Minchan Kim wrote: > On Thu, Nov 22, 2018 at 02:40:40PM +0900, Sergey Senozhatsky wrote: > > On (11/22/18 14:04), Minchan Kim wrote: > > > > > > > additionally, it's too simple. It writes-back pages which can be > &g

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 02:40:40PM +0900, Sergey Senozhatsky wrote: > On (11/22/18 14:04), Minchan Kim wrote: > > > > > additionally, it's too simple. It writes-back pages which can be > > > swapped in immediately; which basically means that we do pointless > &g

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 02:40:40PM +0900, Sergey Senozhatsky wrote: > On (11/22/18 14:04), Minchan Kim wrote: > > > > > additionally, it's too simple. It writes-back pages which can be > > > swapped in immediately; which basically means that we do pointless > &g

Re: [PATCH 3/6] zram: introduce ZRAM_IDLE flag

2018-11-21 Thread Minchan Kim
On Tue, Nov 20, 2018 at 11:46:59AM +0900, Sergey Senozhatsky wrote: > Hello, > > On (11/16/18 16:20), Minchan Kim wrote: > [..] > > +static ssize_t idle_store(struct device *dev, > > + struct device_attribute *attr, const char *buf, size_t len) > >

Re: [PATCH 3/6] zram: introduce ZRAM_IDLE flag

2018-11-21 Thread Minchan Kim
On Tue, Nov 20, 2018 at 11:46:59AM +0900, Sergey Senozhatsky wrote: > Hello, > > On (11/16/18 16:20), Minchan Kim wrote: > [..] > > +static ssize_t idle_store(struct device *dev, > > + struct device_attribute *attr, const char *buf, size_t len) > >

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 11:14:43AM +0900, Sergey Senozhatsky wrote: > On (11/21/18 05:34), Minchan Kim wrote: > > > > > > Just a thought, > > > > > > I wonder if it will make sense (and if it will be possible) to writeback > > > idle _c

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Thu, Nov 22, 2018 at 11:14:43AM +0900, Sergey Senozhatsky wrote: > On (11/21/18 05:34), Minchan Kim wrote: > > > > > > Just a thought, > > > > > > I wonder if it will make sense (and if it will be possible) to writeback > > > idle _c

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Wed, Nov 21, 2018 at 01:55:51PM +0900, Sergey Senozhatsky wrote: > On (11/16/18 16:20), Minchan Kim wrote: > > + zram_set_flag(zram, index, ZRAM_UNDER_WB); > > + zram_slot_unlock(zram, index); > > + if (zram_bvec_read(z

Re: [PATCH 4/6] zram: support idle page writeback

2018-11-21 Thread Minchan Kim
On Wed, Nov 21, 2018 at 01:55:51PM +0900, Sergey Senozhatsky wrote: > On (11/16/18 16:20), Minchan Kim wrote: > > + zram_set_flag(zram, index, ZRAM_UNDER_WB); > > + zram_slot_unlock(zram, index); > > + if (zram_bvec_read(z

Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-16 Thread Minchan Kim
On Thu, Nov 15, 2018 at 12:45:04PM -0500, Sasha Levin wrote: > On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote: > > commit fef912bf860e upstream. > > commit 98af4d4df889 upstream. > > > > I got a report from Howard Chen that he saw zram and sysfs race(ie,

Re: [PATCH] zram: close udev startup race condition as default groups

2018-11-16 Thread Minchan Kim
On Thu, Nov 15, 2018 at 12:45:04PM -0500, Sasha Levin wrote: > On Wed, Nov 14, 2018 at 02:52:23PM +0900, Minchan Kim wrote: > > commit fef912bf860e upstream. > > commit 98af4d4df889 upstream. > > > > I got a report from Howard Chen that he saw zram and sysfs race(ie,

[PATCH 5/6] zram: add bd_stat statistics

2018-11-15 Thread Minchan Kim
bd_stat reprenents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH 6/6] zram: writeback throttle

2018-11-15 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 Documentation/blockde

[PATCH 5/6] zram: add bd_stat statistics

2018-11-15 Thread Minchan Kim
bd_stat reprenents things happened in backing device. Currently, it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 8 ++ Documentation/blockdev

[PATCH 6/6] zram: writeback throttle

2018-11-15 Thread Minchan Kim
"writeback_limit" on zram. With that, if current writeback IO count(/sys/block/zramX/io_stat) excceds the limitation, zram stops further writeback until admin can reset the limit. Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 9 Documentation/blockde

[PATCH 4/6] zram: support idle page writeback

2018-11-15 Thread Minchan Kim
writeback both pages Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 7 + Documentation/blockdev/zram.txt| 19 +++ drivers/block/zram/Kconfig | 5 +- drivers/block/zram/zram_drv.c | 166 +++-- d

[PATCH 4/6] zram: support idle page writeback

2018-11-15 Thread Minchan Kim
writeback both pages Signed-off-by: Minchan Kim --- Documentation/ABI/testing/sysfs-block-zram | 7 + Documentation/blockdev/zram.txt| 19 +++ drivers/block/zram/Kconfig | 5 +- drivers/block/zram/zram_drv.c | 166 +++-- d

[PATCH 1/6] zram: fix lockdep warning of free block handling

2018-11-15 Thread Minchan Kim
ather than bottom half is swap_slot_free_notify could be called with irq disabled so it breaks local_bh_enable's rule. The irqlock works on only writebacked zram slot entry so it should be not frequent lock. Cc: sta...@vger.kernel.org # 4.14+ Signed-off-by: Minchan Kim --- drivers/block/zram/zra

<    1   2   3   4   5   6   7   8   9   10   >