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 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
se incompressible pages doesn't go to backing storage automatically. Instead, user should do it via "echo huge" > /sys/block/zram/writeback" manually. == &< == If we may hear some regression, we could restore the function with different implemenataion. [1], https://lore

[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
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 writeback/idle interface - minchan - remove direct incompressible page writeback - sergey Minc

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-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 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 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 0/7] zram idle page writeback

2018-11-26 Thread Minchan Kim
eback/idle interface - minchan - remove direct incompressible page writeback - sergey Minchan Kim (7): zram: fix lockdep warning of free block handling zram: fix double free backing device zram: refactoring flags and writeback stuff zram: introduce ZRAM_IDLE flag zram: support idle

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 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

[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] [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 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

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 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 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] 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 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

[PATCH 3/6] zram: introduce ZRAM_IDLE flag

2018-11-15 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 2/6] zram: refactoring flags and writeback stuff

2018-11-15 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 0/6] zram idle page writeback

2018-11-15 Thread Minchan Kim
since X time ago" * Admin can define when zram should writeback them * Admin can define when zram should stop writeback to prevent wearout Detail is on each patch's description. Minchan Kim (6): zram: fix lockdep warning of free block handling zram: refactoring flags and writeback st

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

2018-11-13 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 a1d6b5597c17..66921427d109 100644

Re: [PATCH v1 1/3] arm: mm: reordering memory type table

2018-09-28 Thread Minchan Kim
Hi Catalin, Sorry for the late response. It was big holiday here. I will correct what you pointed out and resubmit patch next week. Thanks for the review! On Mon, Sep 24, 2018 at 05:22:03PM +0100, Catalin Marinas wrote: > On Mon, Sep 17, 2018 at 09:44:49AM +0900, Minchan Kim wrote: > &g

Re: [PATCH] zram: fix missing zero pages for memory tracking

2018-09-21 Thread Minchan Kim
On Wed, Sep 19, 2018 at 04:29:16PM +0900, Sergey Senozhatsky wrote: > On (09/19/18 14:18), Minchan Kim wrote: > > We need to count zero filled pages as well as other pages in zram. > > A nit, > > 'ZRAM_FLAG_SHIFT + 1' covers all ZRAM_SAME pages, not only > zero fill

Re: [PATCH v1 1/3] arm: mm: reordering memory type table

2018-09-20 Thread Minchan Kim
Hi Guys, Could you have a chance to review this patchset? Thanks! On Mon, Sep 17, 2018 at 09:44:49AM +0900, Minchan Kim wrote: > To use bit 5 in page table as L_PTE_SPECIAL, we need a room for that. > It seems we don't need 4 bits for the memory type with ARMv6+. > If it's true, let'

Re: [PATCH] zram: fix missing zero pages for memory tracking

2018-09-20 Thread Minchan Kim
Hi Sergey, On Wed, Sep 19, 2018 at 04:29:16PM +0900, Sergey Senozhatsky wrote: > On (09/19/18 14:18), Minchan Kim wrote: > > We need to count zero filled pages as well as other pages in zram. > > A nit, > > 'ZRAM_FLAG_SHIFT + 1' covers all ZRAM_SAME pages, not onl

[PATCH] zram: fix missing zero pages for memory tracking

2018-09-18 Thread Minchan Kim
We need to count zero filled pages as well as other pages in zram. Otherwise, it doesn't match swap page count via pagemap of process so that memory tracking feature in zram doesn't provide accurate information. Cc: Sergey Senozhatsky Cc: [4.18+] Signed-off-by: Minchan Kim --- drivers

[PATCH v1 3/3] arm: mm: support get_user_pages_fast

2018-09-16 Thread Minchan Kim
: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Signed-off-by: Minchan Kim --- arch/arm/mm/Makefile | 6 ++ arch/arm/mm/gup.c| 221 +++ 2 files changed, 227 insertions(+) create mode 100644 arch/arm/mm/gup.c diff --git a/arch/arm/mm/Makefile b/arch/arm

[PATCH v1 1/3] arm: mm: reordering memory type table

2018-09-16 Thread Minchan Kim
L_PTE_MT_DEV_SHARED, unless I miss any place where > DEV_NONSHARED is relevant on ARMv6 (adding Simon to confirm on shmbile). " Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Cc: Simon Horman Signed-off-by: Minchan Kim --- arch/arm/inclu

[PATCH v1 2/3] arm: mm: introduce L_PTE_SPECIAL

2018-09-16 Thread Minchan Kim
This patch introduces L_PTE_SPECIAL and pte functions for supporting get_user_pages_fast. Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Signed-off-by: Minchan Kim --- arch/arm/Kconfig | 2 +- arch/arm/include/asm/pgtable-2level.h | 3 +-- arch

[PATCH v1 0/3] arm: support get_user_pages_fast

2018-09-16 Thread Minchan Kim
://lkml.kernel.org/r/20180910165011.zcighyuabshsm...@armageddon.cambridge.arm.com Minchan Kim (3): arm: mm: reordering memory type table arm: mm: introduce L_PTE_SPECIAL arm: mm: support get_user_pages_fast arch/arm/Kconfig | 2 +- arch/arm/include/asm/pgtable-2level.h

Re: [RFC 1/3] arm: mm: reordering memory type table

2018-09-14 Thread Minchan Kim
On Mon, Sep 10, 2018 at 05:50:11PM +0100, Catalin Marinas wrote: > On Thu, Sep 06, 2018 at 07:22:10PM +0900, Minchan Kim wrote: > > diff --git a/arch/arm/include/asm/pgtable-2level.h > > b/arch/arm/include/asm/pgtable-2level.h > > index 92fd2c8a9af0..91b99fadcba1 100644 >

Re: KASAN: null-ptr-deref Write in binder_update_page_range

2018-09-06 Thread Minchan Kim
Thanks, Martijn, Greg, could you have a look to pick up? On Mon, Aug 27, 2018 at 03:35:24PM +0200, Martijn Coenen wrote: > Thanks Minchan! > > On Thu, Aug 23, 2018 at 7:29 AM, Minchan Kim wrote: > > Signed-off-by: Todd Kjos > > Signed-off-by: Minchan Kim > Rev

[RFC 3/3] arm: mm: support get_user_pages_fast

2018-09-06 Thread Minchan Kim
: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Signed-off-by: Minchan Kim --- arch/arm/mm/Makefile | 6 ++ arch/arm/mm/gup.c| 221 +++ 2 files changed, 227 insertions(+) create mode 100644 arch/arm/mm/gup.c diff --git a/arch/arm/mm/Makefile b/arch/arm

[RFC 1/3] arm: mm: reordering memory type table

2018-09-06 Thread Minchan Kim
Signed-off-by: Minchan Kim --- arch/arm/include/asm/pgtable-2level.h | 13 +++-- arch/arm/mm/proc-macros.S | 16 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h index

[RFC 2/3] arm: mm: introduce L_PTE_SPECIAL

2018-09-06 Thread Minchan Kim
This patch introduces L_PTE_SPECIAL and pte functions for supporting get_user_pages_fast. Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Signed-off-by: Minchan Kim --- arch/arm/Kconfig | 2 +- arch/arm/include/asm/pgtable-2level.h | 3 +-- arch

[RFC 0/3] arm: support get_user_pages_fast

2018-09-06 Thread Minchan Kim
. It seems we don't use the bit in ARMv6+ but it needs double check from maintainers. Second patch introduces L_PTE_SPECIAL for arm so that last patch can support get_user_pags_fast. I would greatly appreciate if guys review that I screw up something, especially, architecture stuffs. Thanks. Minchan

Re: KASAN: null-ptr-deref Write in binder_update_page_range

2018-08-23 Thread Minchan Kim
On Thu, Aug 23, 2018 at 07:03:34PM +0900, Dae R. Jeong wrote: > > Could you test this patch? I found that bug a month ago but didn't submit > > yet. > > I don't have a reproducer now. I manually analzed a root cause of the > crash using a fuzzer's log. The log reported a race on 'alloc->vma'. >

Re: KASAN: null-ptr-deref Write in binder_update_page_range

2018-08-22 Thread Minchan Kim
because, while RaceFuzzer precisely interleaves the scheduling at the > kernel's instruction level when finding this bug, C repro cannot fully > utilize such a feature. Please disregard all code related to > "should_hypercall" in the C repro, as this is only for our debugging > purpos

Re: Re: [PATCH] zsmalloc: fix linking bug in init_zspage

2018-08-15 Thread Minchan Kim
71f 9783 > (d421)[pid:3471,cpu4,thread-3]---[ end trace 652caafc4c4b6d06 ]--- > Hi Sergey, > > On Mon, Aug 13, 2018 at 07:55:36PM +0900, Sergey Senozhatsky wrote: > On (08/13/18 15:05), Minchan Kim wrote: >From: zhouxianrong > >The last partial obj

Re: [PATCH] zsmalloc: fix linking bug in init_zspage

2018-08-13 Thread Minchan Kim
Hi Sergey, On Mon, Aug 13, 2018 at 07:55:36PM +0900, Sergey Senozhatsky wrote: > On (08/13/18 15:05), Minchan Kim wrote: > > > From: zhouxianrong > > > > > > The last partial object in last subpage of zspage should not be linked > > > in allocation

Re: [PATCH] zram: fix bug storing backing_dev

2018-08-13 Thread Minchan Kim
> the new file_name buffer. This makes it possible to set the backing_dev > as follows: > > echo /dev/sdX > /sys/block/zram0/backing_dev > > Signed-off-by: Peter Kalauskas Acked-by: Minchan Kim Cc: Andrew Morton Cc: Sergey Senozhatsky CC: LKML Cc: [4.14+] > --- >

Re: [PATCH] zsmalloc: fix linking bug in init_zspage

2018-08-13 Thread Minchan Kim
Hi, On Thu, Aug 09, 2018 at 08:28:17PM -0400, zhouxianrong wrote: > From: zhouxianrong > > The last partial object in last subpage of zspage should not be linked > in allocation list. Otherwise it could trigger BUG_ON explicitly at > function zs_map_object. But it happened rarely. Could you be

[PATCH v2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-05 Thread Minchan Kim
.org/r/20180802051112.86174-1-minc...@kernel.org Signed-off-by: Minchan Kim Reported-by: Tino Lehnig Tested-by: Tino Lehnig Cc: Sergey Senozhatsky Cc: Jens Axboe Cc: [4.15+] Signed-off-by: Andrew Morton --- drivers/block/zram/zram_drv.c | 15 ++- 1 file changed, 14 insertions

Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-05 Thread Minchan Kim
Hi Andrew, On Fri, Aug 03, 2018 at 04:28:18PM -0700, Andrew Morton wrote: > On Fri, 3 Aug 2018 11:51:43 +0900 Minchan Kim wrote: > > > > Is it legitimate to be altering the bdi capabilities at this level? Or > > > is this hacky? > > > > Most of device

Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-02 Thread Minchan Kim
On Fri, Aug 03, 2018 at 01:13:02PM +0900, Sergey Senozhatsky wrote: > Hi Minchan, > > On (08/03/18 12:00), Minchan Kim wrote: > > > "Device is so fast that asynchronous IO would be inefficient." > > > > > > Which is not the reason why BDI_CAP_

Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-02 Thread Minchan Kim
Hi Sergey, On Fri, Aug 03, 2018 at 11:39:29AM +0900, Sergey Senozhatsky wrote: > On (08/02/18 14:13), Andrew Morton wrote: > [..] > > That changelog is rather hard to follow. Please review my edits: > > > > : If zram supports writeback feature, it's no longer a BD_CAP_SYNCHRONOUS_IO >

Re: [PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-02 Thread Minchan Kim
Hi Andrew, On Thu, Aug 02, 2018 at 02:13:04PM -0700, Andrew Morton wrote: > On Thu, 2 Aug 2018 14:11:12 +0900 Minchan Kim wrote: > > > If zram supports writeback feature, it's no more syncrhonous > > device beause zram does synchronous IO opeation for > > incompre

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-08-01 Thread Minchan Kim
On Mon, Jul 30, 2018 at 08:09:33AM +0200, Tino Lehnig wrote: > On 07/28/2018 12:58 AM, Minchan Kim wrote: > > I made a mistake on previous patch. > > Could you test this patches? > > Thanks! Looking good so far! No errors whatsoever with the new patch. I will > let

[PATCH 1/2] zram: remove BD_CAP_SYNCHRONOUS_IO with writeback feature

2018-08-01 Thread Minchan Kim
c66000 R14: R15: 5652b984e0f0 Link: https://lore.kernel.org/lkml/0516ae2d-b0fd-92c5-aa92-112ba7bd3...@contabo.de/ Reported-by: Tino Lehnig Cc: Sergey Senozhatsky Cc: Tino Lehnig Cc: # v4.15+ Tested-by: Tino Lehnig Signed-off-by: Minchan Kim --- drivers/block/zram/zram

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-27 Thread Minchan Kim
On Fri, Jul 27, 2018 at 02:13:57PM +0200, Tino Lehnig wrote: > On 07/27/2018 02:05 PM, Minchan Kim wrote: > > And bad page is always with writeback enable? > > > > writeback enable means "echo "some dev" > /sys/block/zram0/backing_dev, > > not just en

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-27 Thread Minchan Kim
On Fri, Jul 27, 2018 at 01:00:01PM +0200, Tino Lehnig wrote: > On 07/27/2018 11:14 AM, Minchan Kim wrote: > > I tried to reproduce with KVM but was not successful and I don't have > > real mahcine to reproduce it. I am asking one device for it. > > > > Anyway, I want t

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-27 Thread Minchan Kim
PM, Minchan Kim wrote: > > Huh, you see it without writeback? It's weird. Without writeback feature, > > zram operaion is always synchronous on memory compression/decompression > > so you shouldn't see below io_schedule logic which happens only for > > asynchronous IO operation. &

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-26 Thread Minchan Kim
On Thu, Jul 26, 2018 at 12:00:44PM +0200, Tino Lehnig wrote: > On 07/26/2018 08:10 AM, Tino Lehnig wrote: > > > A thing I could imagine is > > > [0bcac06f27d75, skip swapcache for swapin of synchronous device] > > > It was merged into v4.15. Could you check it by bisecting? > > > > Thanks, I will

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-26 Thread Minchan Kim
On Thu, Jul 26, 2018 at 08:10:41AM +0200, Tino Lehnig wrote: > Hi, > > On 07/26/2018 04:03 AM, Minchan Kim wrote: > > A thing I could imagine is > > [0bcac06f27d75, skip swapcache for swapin of synchronous device] > > It was merged into v4.15. Could you check it b

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-25 Thread Minchan Kim
Hi Tino, On Wed, Jul 25, 2018 at 05:12:13PM +0200, Tino Lehnig wrote: > Hi, > > On 07/25/2018 03:21 PM, Minchan Kim wrote: > > It would be much helpful if you could check more versions with git-bisect. > > I started bisecting today, but my results are not conclusive

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-25 Thread Minchan Kim
ested some heavy swap workload(kernel build with multiple CPU on small memory) but I failed to reproduce, too. Please could you told me your method more detail? Thanks. > > On 07/24/2018 03:03 AM, Minchan Kim wrote: > > We didn't release v4.18 yet. Could you say what kern

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-24 Thread Minchan Kim
On Tue, Jul 24, 2018 at 07:55:25PM -0700, Matthew Wilcox wrote: > On Wed, Jul 25, 2018 at 11:51:06AM +0900, Minchan Kim wrote: > > On Tue, Jul 24, 2018 at 07:35:32PM -0700, Matthew Wilcox wrote: > > > There is NOTHING in a union with _refcount. > > > > Confusi

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-24 Thread Minchan Kim
On Tue, Jul 24, 2018 at 07:35:32PM -0700, Matthew Wilcox wrote: > On Wed, Jul 25, 2018 at 11:16:57AM +0900, Minchan Kim wrote: > > On Tue, Jul 24, 2018 at 06:55:02PM -0700, Matthew Wilcox wrote: > > > On Wed, Jul 25, 2018 at 10:32:50AM +0900, Minchan Kim wrot

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-24 Thread Minchan Kim
On Tue, Jul 24, 2018 at 06:55:02PM -0700, Matthew Wilcox wrote: > On Wed, Jul 25, 2018 at 10:32:50AM +0900, Minchan Kim wrote: > > Hi Tino, > > > > On Tue, Jul 24, 2018 at 09:30:34AM +0200, Tino Lehnig wrote: > > > Hi, > > > > > > The first build I

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-24 Thread Minchan Kim
e is an easier way to write this. The innermost union is of four things which are the size of an int, so > > On 07/24/2018 03:03 AM, Minchan Kim wrote: > > We didn't release v4.18 yet. Could you say what kernel tree/what version > > you used? > > -- > > [ 804.48

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-24 Thread Minchan Kim
On Tue, Jul 24, 2018 at 11:53:30AM +0900, Sergey Senozhatsky wrote: > On (07/24/18 10:03), Minchan Kim wrote: > > On Mon, Jul 23, 2018 at 02:29:32PM +0200, Tino Lehnig wrote: > > > Hello, > > > > > > after enabling the writeback feature in zram, I encountered t

Re: Zram writeback feature unstable with heavy swap utilization - BUG: Bad page state in process...

2018-07-23 Thread Minchan Kim
Hi Tino, Thanks for the report. On Mon, Jul 23, 2018 at 02:29:32PM +0200, Tino Lehnig wrote: > Hello, > > after enabling the writeback feature in zram, I encountered the kernel bug > below with heavy swap utilization. There is one specific workload that > triggers the bug reliably and that is

Re: [PATCH v2 6/7] mm, proc: add KReclaimable to /proc/meminfo

2018-06-19 Thread Minchan Kim
On Tue, Jun 19, 2018 at 09:30:03AM +0200, Vlastimil Babka wrote: > On 06/18/2018 11:33 PM, Andrew Morton wrote: > > On Mon, 18 Jun 2018 11:18:07 +0200 Vlastimil Babka wrote: > > > >> The vmstat NR_KERNEL_MISC_RECLAIMABLE counter is for kernel non-slab > >> allocations that can be reclaimed via

Re: [PATCH] memcg: force charge kmem counter too

2018-05-31 Thread Minchan Kim
On Thu, May 31, 2018 at 08:56:42AM +0200, Michal Hocko wrote: > On Thu 31-05-18 15:01:33, Minchan Kim wrote: > > On Wed, May 30, 2018 at 11:14:33AM -0700, Shakeel Butt wrote: > > > On Tue, May 29, 2018 at 1:31 AM, Michal Hocko wrote: > > > > On Mon 28-05-1

Re: [PATCH] memcg: force charge kmem counter too

2018-05-31 Thread Minchan Kim
On Wed, May 30, 2018 at 11:14:33AM -0700, Shakeel Butt wrote: > On Tue, May 29, 2018 at 1:31 AM, Michal Hocko wrote: > > On Mon 28-05-18 10:23:07, Shakeel Butt wrote: > >> On Mon, May 28, 2018 at 2:11 AM, Michal Hocko wrote: > >> Though is there a precedence where the broken feature is not fixed

Re: [PATCH] mm: fix the NULL mapping case in __isolate_lru_page()

2018-05-30 Thread Minchan Kim
mpaction's async migration in 4.16. > > Fixes: 69d763fc6d3a ("mm: pin address_space before dereferencing it while > isolating an LRU page") > Signed-off-by: Hugh Dickins Acked-by: Minchan Kim Thanks, Hugh.

Re: [PATCH v6] ANDROID: binder: change down_write to down_read

2018-05-15 Thread Minchan Kim
On Tue, May 15, 2018 at 09:46:01AM +0200, Martijn Coenen wrote: < snip > > >> About the unmap at runtime part, your commit message was a bit confusing. > >> You > >> said "every binder buffers should be mapped in advance by binder_mmap." > >> but I > >> think the new binder shrinker mechanism

Re: [PATCH v6] ANDROID: binder: change down_write to down_read

2018-05-15 Thread Minchan Kim
Hi Joel, Sorry for the late response. I was off. On Wed, May 09, 2018 at 04:19:41PM -0700, Joel Fernandes wrote: > On Wed, May 09, 2018 at 03:40:23PM +0900, Minchan Kim wrote: > > On Tue, May 08, 2018 at 04:08:13PM -0700, Joel Fernandes wrote: > > > On Tue, May 08, 2018 a

  1   2   3   4   5   6   7   8   9   10   >