Re: [PATCH v5 2/2] lib: stackdepot: Add support to disable stack depot

2021-01-21 Thread Minchan Kim
On Mon, Jan 18, 2021 at 03:26:42PM +0530, vji...@codeaurora.org wrote: > From: Vijayanand Jitta > > Add a kernel parameter stack_depot_disable to disable > stack depot. So that stack hash table doesn't consume > any memory when stack depot is disabled. The usecase is CONFIG_PAGE_OWNER without

Re: [PATCH v5 1/2] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2021-01-21 Thread Minchan Kim
k Menon > Signed-off-by: Vijayanand Jitta Reviewed-by: Minchan Kim

Re: [PATCH v4 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn

2021-01-21 Thread Minchan Kim
On Thu, Jan 21, 2021 at 09:54:59AM -0800, Minchan Kim wrote: > The upcoming patch will introduce __GFP_NORETRY semantic > in alloc_contig_range which is a failfast mode of the API. > Instead of adding a additional parameter for gfp, replace > no_warn with gfp flag. > > To

[PATCH v4 0/4] Chunk Heap Support on DMA-HEAP

2021-01-21 Thread Minchan Kim
dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim (2): mm: cma: introduce gfp flag in cma_alloc instead of no_warn mm: failfast mode with __GFP_NORETRY in alloc_contig_range .../reserved-memory/dma_heap_chunk.yaml | 56 ++ drivers/dma-buf/heaps/Kconfig | 8 + d

[PATCH v4 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn

2021-01-21 Thread Minchan Kim
false GFP_KERNEL true GFP_KERNEL|__GFP_NOWARN gfp & __GFP_NOWARNGFP_KERNEL | (gfp & __GFP_NOWARN) Reviewed-by: Suren Baghdasaryan Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps/cma_heap.c | 2 +- drivers/s390/cha

[PATCH v4 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range

2021-01-21 Thread Minchan Kim
the request in different range where would have easy migratable pages without stalling. This patch introduce __GFP_NORETRY as compaction gfp_mask in alloc_contig_range so it will fail fast without blocking when it encounters pages needed waiting. Signed-off-by: Minchan Kim --- mm/page_alloc.c | 8

[PATCH v4 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-21 Thread Minchan Kim
/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d Reviewed-by: Suren Baghdasaryan Signed-off-by: Hyesoo Yu Signed-off-by: Hridya Valsaraju Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps/Kconfig | 8 + drivers/dma-buf/heaps/Makefile | 1 + drivers

[PATCH v4 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable

2021-01-21 Thread Minchan Kim
the user-space, there is no other appropriate device-driver that we can use to register the chunk CMA heap and configure the reserved memory region for its use. Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim Signed-off-by: Hridya Valsaraju --- .../reserved-memory/dma_heap_chunk.yaml

Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread Minchan Kim
On Tue, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote: > On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim wrote: > > > > From: Hyesoo Yu > > > > This patch supports chunk heap that allocates the buffers that > > arranged into a list a fixed size chunks taken

Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-19 Thread Minchan Kim
On Tue, Jan 12, 2021 at 05:21:43PM -0800, Minchan Kim wrote: > From: Hyesoo Yu > > This patch supports chunk heap that allocates the buffers that > arranged into a list a fixed size chunks taken from CMA. > > The chunk heap driver is bound directly to a reserved_memory >

Re: [PATCH v3 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range

2021-01-14 Thread Minchan Kim
On Wed, Jan 13, 2021 at 09:39:26AM +0100, David Hildenbrand wrote: > On 13.01.21 02:21, Minchan Kim wrote: > > Contiguous memory allocation can be stalled due to waiting > > on page writeback and/or page lock which causes unpredictable > > delay. It's a unavoidable cost for

Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-13 Thread Minchan Kim
x-mm/master v5.11-rc3 v5.11-rc2 v5.11-rc1 v5.11-rc3] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > > url: > https://github.com/0day-

Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-13 Thread Minchan Kim
On Tue, Jan 12, 2021 at 07:38:40PM -0800, Randy Dunlap wrote: > On 1/12/21 5:21 PM, Minchan Kim wrote: > > +config DMABUF_HEAPS_CHUNK > > + bool "DMA-BUF CHUNK Heap" > > + depends on DMABUF_HEAPS && DMA_CMA > > + help > > + Choose

[PATCH v3 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable

2021-01-12 Thread Minchan Kim
From: Hyesoo Yu Document devicetree binding for chunk cma heap on dma heap framework. The DMA chunk heap supports the bulk allocation of higher order pages. Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim Signed-off-by: Hridya Valsaraju Change-Id

[PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2021-01-12 Thread Minchan Kim
/20191025225009.50305-2-john.stu...@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d Signed-off-by: Hyesoo Yu Signed-off-by: Hridya Valsaraju Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps/Kconfig | 8 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/chunk_heap.c | 477

[PATCH v3 2/4] mm: failfast mode with __GFP_NORETRY in alloc_contig_range

2021-01-12 Thread Minchan Kim
the request in diffrent range where would have easy migratable pages without stalling. This patch introduce __GFP_NORETRY as compaction gfp_mask in alloc_contig_range so it will fail fast without blocking when it encounters pages needed waitting. Signed-off-by: Minchan Kim --- mm/page_alloc.c | 8

[PATCH v3 0/4] Chunk Heap Support on DMA-HEAP

2021-01-12 Thread Minchan Kim
MA-BUF CMA heap DT-configurable dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim (2): mm: cma: introduce gfp flag in cma_alloc instead of no_warn mm: failfast mode with __GFP_NORETRY in alloc_contig_range .../reserved-memory/dma_heap_chunk.yaml | 58 +++ drivers/dma-buf/hea

[PATCH v3 1/4] mm: cma: introduce gfp flag in cma_alloc instead of no_warn

2021-01-12 Thread Minchan Kim
false GFP_KERNEL true GFP_KERNEL|__GFP_NOWARN gfp & __GFP_NOWARNGFP_KERNEL | (gfp & __GFP_NOWARN) Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps/cma_heap.c | 2 +- drivers/s390/char/vmcp.c | 2 +- include/lin

Re: [PATCH 1/1] mm/madvise: replace ptrace attach requirement for process_madvise

2021-01-08 Thread Minchan Kim
y folks don't see any concern and fix below, Acked-by: Minchan Kim > @@ -1197,12 +1197,22 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const > struct iovec __user *, vec, > goto release_task; > } > > - mm = mm_access(task, PTRACE_MODE_ATTACH_FSCREDS

Re: [PATCH v3] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-12-21 Thread Minchan Kim
On Mon, Dec 21, 2020 at 04:04:09PM +0100, Alexander Potapenko wrote: > On Mon, Dec 21, 2020 at 12:15 PM Vijayanand Jitta > wrote: > > > > > > > > On 12/18/2020 2:10 PM, Vijayanand Jitta wrote: > > > > > > > > > On 12/17/2020 4:24 PM, Alexander Potapenko wrote: > > Can you provide an example

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Minchan Kim
On Mon, Dec 21, 2020 at 08:20:26PM +0100, Vitaly Wool wrote: > On Mon, Dec 21, 2020 at 6:24 PM Minchan Kim wrote: > > > > On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > > > zsmalloc takes bit spinlock in its _map() callback and releases it > > >

Re: [PATCH] zsmalloc: do not use bit_spin_lock

2020-12-21 Thread Minchan Kim
On Sun, Dec 20, 2020 at 02:22:28AM +0200, Vitaly Wool wrote: > zsmalloc takes bit spinlock in its _map() callback and releases it > only in unmap() which is unsafe and leads to zswap complaining > about scheduling in atomic context. > > To fix that and to improve RT properties of zsmalloc, remove

Re: [PATCH] mm/zsmalloc: replace if (cond) BUG() with BUG_ON()

2020-12-21 Thread Minchan Kim
On Sat, Dec 12, 2020 at 11:26:25AM +0800, Alex Shi wrote: > coccinelle reports some warning: > WARNING: Use BUG_ON instead of if condition followed by BUG. > > It could be fixed by BUG_ON(). > > Reported-by: ab...@linux.alibaba.com > Signed-off-by: Alex Shi Acked-by: Minchan Kim Thanks.

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-12-11 Thread Minchan Kim
On Fri, Dec 11, 2020 at 09:27:46PM +0100, Jann Horn wrote: > +CC Christoph Hellwig for opinions on compat > > On Thu, Nov 26, 2020 at 12:22 AM Minchan Kim wrote: > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > > process_madvise requires a

Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap

2020-12-10 Thread Minchan Kim
On Thu, Dec 10, 2020 at 02:40:38PM -0800, John Stultz wrote: > On Thu, Dec 10, 2020 at 8:06 AM Minchan Kim wrote: > > On Thu, Dec 10, 2020 at 12:15:15AM -0800, John Stultz wrote: > > > Well, while I agree that conceptually the dmabuf heaps allow for > > > allocations

Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap

2020-12-10 Thread Minchan Kim
On Thu, Dec 10, 2020 at 12:15:15AM -0800, John Stultz wrote: > On Wed, Dec 9, 2020 at 3:53 PM Minchan Kim wrote: > > On Wed, Nov 18, 2020 at 07:19:07PM -0800, John Stultz wrote: > > > The CMA heap currently only registers the default CMA heap, as we > > > didn't wan

Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap

2020-12-09 Thread Minchan Kim
On Wed, Nov 18, 2020 at 07:19:07PM -0800, John Stultz wrote: > On Wed, Nov 18, 2020 at 5:22 PM Hyesoo Yu wrote: > > > > On Tue, Nov 17, 2020 at 07:00:54PM -0800, John Stultz wrote: > > > So I suspect Rob will push back on this as he has for other dt > > > bindings related to ion/dmabuf heaps (I

[PATCH] mm/madvise: remove racy mm ownership check

2020-12-08 Thread Minchan Kim
comes up. Cc: secur...@kernel.org Fixes: ecb8ac8b1f14 ("mm/madvise: introduce process_madvise() syscall: an external memory hinting API") Reported-by: Jann Horn Suggested-by: Jann Horn Signed-off-by: Minchan Kim --- mm/madvise.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletion

Re: [PATCH v7] zram: break the strict dependency from lzo

2020-12-08 Thread Minchan Kim
On Tue, Dec 08, 2020 at 09:26:55AM -0800, Minchan Kim wrote: > On Mon, Dec 07, 2020 at 12:12:45PM +, Rui Salvaterra wrote: > > From the beginning, the zram block device always enabled CRYPTO_LZO, since > > lzo-rle is hardcoded as the fallback compression algorithm. As a

Re: [PATCH v7] zram: break the strict dependency from lzo

2020-12-08 Thread Minchan Kim
default algorithm is still lzo-rle. > > Suggested-by: Sergey Senozhatsky > Suggested-by: Minchan Kim > Signed-off-by: Rui Salvaterra Acked-by: Minchan Kim Thanks, Rui.

Re: [PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-02 Thread Minchan Kim
On Wed, Dec 02, 2020 at 09:22:36PM +0100, David Hildenbrand wrote: > On 02.12.20 20:26, Minchan Kim wrote: > > On Wed, Dec 02, 2020 at 07:51:07PM +0100, Michal Hocko wrote: > >> On Wed 02-12-20 09:54:29, Minchan Kim wrote: > >>> On Wed, Dec 02, 2020 at 05:48:

Re: [PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-02 Thread Minchan Kim
On Wed, Dec 02, 2020 at 07:51:07PM +0100, Michal Hocko wrote: > On Wed 02-12-20 09:54:29, Minchan Kim wrote: > > On Wed, Dec 02, 2020 at 05:48:34PM +0100, Michal Hocko wrote: > > > On Wed 02-12-20 08:15:49, Minchan Kim wrote: > > > > On Wed, Dec 02, 2020 at 04:49:

Re: [PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-02 Thread Minchan Kim
On Wed, Dec 02, 2020 at 05:48:34PM +0100, Michal Hocko wrote: > On Wed 02-12-20 08:15:49, Minchan Kim wrote: > > On Wed, Dec 02, 2020 at 04:49:15PM +0100, Michal Hocko wrote: > [...] > > > Well, what I can see is that this new interface is an antipatern to our > > >

Re: [PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-02 Thread Minchan Kim
On Wed, Dec 02, 2020 at 04:49:15PM +0100, Michal Hocko wrote: > On Wed 02-12-20 10:14:41, David Hildenbrand wrote: > > On 01.12.20 18:51, Minchan Kim wrote: > > > There is a need for special HW to require bulk allocation of > > > high-order pages. For example,

Re: [PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-02 Thread Minchan Kim
On Wed, Dec 02, 2020 at 10:14:41AM +0100, David Hildenbrand wrote: > On 01.12.20 18:51, Minchan Kim wrote: > > There is a need for special HW to require bulk allocation of > > high-order pages. For example, 4800 * order-4 pages, which > > would be minimum, someti

Re: [PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2020-12-01 Thread Minchan Kim
On Tue, Dec 01, 2020 at 04:33:14PM -0800, John Stultz wrote: > On Tue, Dec 1, 2020 at 4:13 PM Minchan Kim wrote: > > > > On Tue, Dec 01, 2020 at 03:38:14PM -0800, John Stultz wrote: > > > On Tue, Dec 1, 2020 at 2:55 PM Minchan Kim wrote: > > > > On Tue, De

Re: [PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2020-12-01 Thread Minchan Kim
On Tue, Dec 01, 2020 at 03:38:14PM -0800, John Stultz wrote: > On Tue, Dec 1, 2020 at 2:55 PM Minchan Kim wrote: > > On Tue, Dec 01, 2020 at 11:48:15AM -0800, John Stultz wrote: > > > On Tue, Dec 1, 2020 at 9:51 AM Minchan Kim wrote: > > > > > >

Re: [PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2020-12-01 Thread Minchan Kim
On Tue, Dec 01, 2020 at 11:48:15AM -0800, John Stultz wrote: > On Tue, Dec 1, 2020 at 9:51 AM Minchan Kim wrote: > > Thanks for reworking and resending this! > > ... > > +static int __init chunk_heap_init(void) > > +{ > > + struct cma *de

[PATCH v2 0/4] Chunk Heap Support on DMA-HEAP

2020-12-01 Thread Minchan Kim
...@kernel.org/ * introduce alloc_contig_mode - David * use default CMA instead of device tree - John Hyesoo Yu (2): dma-buf: add export symbol for dma-heap dma-buf: heaps: add chunk heap to dmabuf heaps Minchan Kim (2): mm: introduce alloc_contig_mode mm: introduce cma_alloc_bulk

[PATCH v2 2/4] mm: introduce cma_alloc_bulk API

2020-12-01 Thread Minchan Kim
ith "false" to increase success ratio if they are okay to expense the overhead for the success ratio. Signed-off-by: Minchan Kim --- include/linux/cma.h | 5 ++ include/linux/gfp.h | 2 + mm/cma.c| 126 ++-- mm/page_alloc.c | 19

[PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2020-12-01 Thread Minchan Kim
the default CMA heap to allocate chunk pages. We will add another CMA memory regions to the dmabuf heaps interface with a later patch (which requires a dt binding) [1] https://lore.kernel.org/patchwork/patch/1336002 Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps

[PATCH v2 3/4] dma-buf: add export symbol for dma-heap

2020-12-01 Thread Minchan Kim
Signed-off-by: Minchan Kim --- drivers/dma-buf/dma-heap.c | 2 ++ kernel/dma/contiguous.c| 1 + mm/cma.c | 5 + 3 files changed, 8 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9dbdcf..cc6339cbca09 100644 --- a/drivers/dma-buf

[PATCH v2 1/4] mm: introduce alloc_contig_mode

2020-12-01 Thread Minchan Kim
. Suggested-by: David Hildenbrand Signed-off-by: Minchan Kim --- drivers/virtio/virtio_mem.c | 2 +- include/linux/gfp.h | 8 +++- mm/cma.c| 3 ++- mm/page_alloc.c | 6 -- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/virtio

[PATCH] zram: add stat to gather incompressible pages since zram set up

2020-11-30 Thread Minchan Kim
. Signed-off-by: Minchan Kim --- Documentation/admin-guide/blockdev/zram.rst | 1 + drivers/block/zram/zram_drv.c | 6 -- drivers/block/zram/zram_drv.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/blockdev/zram.rst b

Re: [PATCH] tracing: Fix align of static buffer

2020-11-26 Thread Minchan Kim
On Thu, Nov 26, 2020 at 10:04:28PM +0900, Youngmin Nam wrote: > Hi Minchan, > > Feel free to add my: > > Tested-by: Youngmin Nam Thanks for the testing, Youngmin!

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-25 Thread Minchan Kim
On Wed, Nov 25, 2020 at 03:23:40PM -0800, Suren Baghdasaryan wrote: > On Wed, Nov 25, 2020 at 3:13 PM Minchan Kim wrote: > > > > On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > > > process_madvise requires a vector of address ranges to be provided

Re: [PATCH 1/2] mm/madvise: allow process_madvise operations on entire memory range

2020-11-25 Thread Minchan Kim
On Mon, Nov 23, 2020 at 09:39:42PM -0800, Suren Baghdasaryan wrote: > process_madvise requires a vector of address ranges to be provided for > its operations. When an advice should be applied to the entire process, > the caller process has to obtain the list of VMAs of the target process > by

[PATCH] tracing: Fix align of static buffer

2020-11-25 Thread Minchan Kim
the output will be broken by shifting some bytes. This patch fixes it. Cc: Fixes: 8e99cf91b99bb ("tracing: Do not allocate buffer in trace_find_next_entry() in atomic") Signed-off-by: Namhyung Kim Signed-off-by: Minchan Kim --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH 4/6] mm: proc: Invalidate TLB after clearing soft-dirty page state

2020-11-25 Thread Minchan Kim
On Mon, Nov 23, 2020 at 06:41:14PM +, Will Deacon wrote: > On Fri, Nov 20, 2020 at 07:55:14AM -0800, Minchan Kim wrote: > > On Fri, Nov 20, 2020 at 04:00:23PM +0100, Peter Zijlstra wrote: > > > On Fri, Nov 20, 2020 at 02:35:55PM +, Will Deacon wrote: > > > > S

Re: [PATCH 6/6] mm: proc: Avoid fullmm flush for young/dirty bit toggling

2020-11-25 Thread Minchan Kim
On Mon, Nov 23, 2020 at 06:13:34PM -0700, Yu Zhao wrote: > On Mon, Nov 23, 2020 at 09:17:51PM +, Will Deacon wrote: > > On Mon, Nov 23, 2020 at 01:04:03PM -0700, Yu Zhao wrote: > > > On Mon, Nov 23, 2020 at 06:35:55PM +, Will Deacon wrote: > > > > On Fri, Nov 20, 2020 at 01:40:05PM -0700,

Re: [PATCH 1/4] mm: introduce cma_alloc_bulk API

2020-11-25 Thread Minchan Kim
On Mon, Nov 23, 2020 at 03:15:37PM +0100, David Hildenbrand wrote: > On 17.11.20 19:19, Minchan Kim wrote: > > There is a need for special HW to require bulk allocation of > > high-order pages. For example, 4800 * order-4 pages, which > > would be minimum, someti

Re: [PATCH v6] zram: break the strict dependency from lzo

2020-11-25 Thread Minchan Kim
default algorithm is still lzo-rle. > > Suggested-by: Sergey Senozhatsky > Suggested-by: Minchan Kim > Signed-off-by: Rui Salvaterra Acked-by: Minchan Kim Thanks, Rui!

Re: [PATCH v5] zram: break the strict dependency from lzo

2020-11-20 Thread Minchan Kim
On Fri, Nov 20, 2020 at 09:10:13AM +, Rui Salvaterra wrote: > Hi, Minchan, > > On Thu, 19 Nov 2020 at 22:26, Minchan Kim wrote: > > > > What's the purpose of ZRAM_AUTOSEL_ALGO? > > If you and Sergey already discussed, sorry about the missing it. > >

Re: [PATCH 2/6] arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()

2020-11-20 Thread Minchan Kim
On Fri, Nov 20, 2020 at 02:35:53PM +, Will Deacon wrote: > With hardware dirty bit management, calling pte_wrprotect() on a writable, > dirty PTE will lose the dirty state and return a read-only, clean entry. > > Move the logic from ptep_set_wrprotect() into pte_wrprotect() to ensure that >

Re: [PATCH 1/6] arm64: pgtable: Fix pte_accessible()

2020-11-20 Thread Minchan Kim
lise the aging path, adjust pte_accessible() to return > true for any valid pte, even if the access flag is cleared. > > Cc: > Fixes: 76c714be0e5e ("arm64: pgtable: implement pte_accessible()") > Reported-by: Yu Zhao > Signed-off-by: Will Deacon Reviewed-by: Minchan Kim

Re: [PATCH 4/6] mm: proc: Invalidate TLB after clearing soft-dirty page state

2020-11-20 Thread Minchan Kim
On Fri, Nov 20, 2020 at 04:00:23PM +0100, Peter Zijlstra wrote: > On Fri, Nov 20, 2020 at 02:35:55PM +, Will Deacon wrote: > > Since commit 0758cd830494 ("asm-generic/tlb: avoid potential double flush"), > > TLB invalidation is elided in tlb_finish_mmu() if no entries were batched > > via the

Re: [PATCH] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-11-19 Thread Minchan Kim
On Thu, Nov 19, 2020 at 11:34:32AM +0800, Zhenhua Huang wrote: > On Wed, Nov 04, 2020 at 07:27:03AM +0800, Minchan Kim wrote: > > Sorry if this mail corrupts the mail thread or had heavy mangling > > since I lost this mail from my mailbox so I am sending this mail by > > web g

Re: [PATCH v5] zram: break the strict dependency from lzo

2020-11-19 Thread Minchan Kim
default algorithm is still lzo-rle. > > Suggested-by: Sergey Senozhatsky > Suggested-by: Minchan Kim > Signed-off-by: Rui Salvaterra > --- > v5: incorporate Minchan's feedback. Allow the user to choose a default > algorithm. > v4: incorporate Sergey's feedback and fix a s

Re: [PATCH] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-11-17 Thread Minchan Kim
On Thu, Nov 12, 2020 at 02:56:49PM -0800, Andrew Morton wrote: > On Thu, 12 Nov 2020 18:26:24 +0530 Vijayanand Jitta > wrote: > > > >> 1. page_owner=off, stackdepot_stack_hash=0 -> no more wasted memory > > >> when we don't use page_owner > > >> 2. page_owner=on, stackdepot_stack_hash=8M ->

Re: [PATCH v9 3/3] mm/madvise: introduce process_madvise() syscall: an external memory hinting API

2020-11-17 Thread Minchan Kim
On Tue, Nov 17, 2020 at 12:06:48PM -0800, Linus Torvalds wrote: > On Mon, Nov 16, 2020 at 7:51 AM Minchan Kim wrote: > > > > Let me send a patch with your SoB if you don't mind. > > Eric, can you ack this SoB and I'll apply it to me tree? > > Or is it already queued

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-17 Thread Minchan Kim
53ab22d0b0bdadd8d0 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Tue, 17 Nov 2020 11:58:51 -0800 Subject: [PATCH] mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING Even though this option showed some amount improvement(e.g., 30%) in some arm32 platforms, it has been headache to maintain since it

[PATCH 4/4] dma-heap: Devicetree binding for chunk heap

2020-11-17 Thread Minchan Kim
From: Hyesoo Yu Document devicetree binding for chunk heap on dma heap framework Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim --- .../bindings/dma-buf/chunk_heap.yaml | 52 +++ 1 file changed, 52 insertions(+) create mode 100644 Documentation/devicetree

[PATCH 2/4] dma-buf: add export symbol for dma-heap

2020-11-17 Thread Minchan Kim
Signed-off-by: Minchan Kim --- drivers/dma-buf/dma-heap.c | 2 ++ mm/cma.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9dbdcf..cc6339cbca09 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma

[PATCH 3/4] dma-buf: heaps: add chunk heap to dmabuf heaps

2020-11-17 Thread Minchan Kim
://lore.kernel.org/patchwork/patch/1336002 Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim --- drivers/dma-buf/heaps/Kconfig | 9 + drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/chunk_heap.c | 458 + 3 files changed, 468 insertions(+) create mode 100644

[PATCH 1/4] mm: introduce cma_alloc_bulk API

2020-11-17 Thread Minchan Kim
, they could call it without __GFP_NORETRY to increase success ratio this time if they are okay to expense the overhead for the success ratio. Signed-off-by: Minchan Kim --- include/linux/cma.h| 5 ++ include/linux/page-isolation.h | 1 + mm/cma.c | 126

[PATCH 0/4] Chunk Heap Support on DMA-HEAP

2020-11-17 Thread Minchan Kim
): dma-buf: add export symbol for dma-heap dma-buf: heaps: add chunk heap to dmabuf heaps dma-heap: Devicetree binding for chunk heap Minchan Kim (1): mm: introduce cma_alloc_bulk API .../bindings/dma-buf/chunk_heap.yaml | 52 ++ drivers/dma-buf/dma-heap.c

Re: [PATCH 1/1] RFC: add pidfd_send_signal flag to reclaim mm while killing a process

2020-11-16 Thread Minchan Kim
On Fri, Nov 13, 2020 at 06:16:32PM -0800, Andrew Morton wrote: > On Fri, 13 Nov 2020 17:57:02 -0800 Suren Baghdasaryan > wrote: > > > On Fri, Nov 13, 2020 at 5:18 PM Andrew Morton > > wrote: > > > > > > On Fri, 13 Nov 2020 17:09:37 -0800 Suren Baghdasaryan > > > wrote: > > > > > > > > > >

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-16 Thread Minchan Kim
On Fri, Nov 13, 2020 at 08:25:29AM -0800, Minchan Kim wrote: > On Thu, Nov 12, 2020 at 02:49:19PM -0800, Andrew Morton wrote: > > On Thu, 12 Nov 2020 12:01:01 -0800 Minchan Kim wrote: > > > > > > > > On Sat, Nov 07, 2020 at 12:39:39AM -0800, Min

Re: [PATCH v9 3/3] mm/madvise: introduce process_madvise() syscall: an external memory hinting API

2020-11-16 Thread Minchan Kim
On Mon, Nov 16, 2020 at 10:02:42AM +0100, Eric Dumazet wrote: < snip > > > From 02d63c6b3f61a1085f4eab80f5171bd2627b5ab0 Mon Sep 17 00:00:00 2001 > > From: Minchan Kim > > Date: Mon, 21 Sep 2020 09:31:25 -0700 > > Subject: [PATCH] mm: do not use helper

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-13 Thread Minchan Kim
On Thu, Nov 12, 2020 at 02:49:19PM -0800, Andrew Morton wrote: > On Thu, 12 Nov 2020 12:01:01 -0800 Minchan Kim wrote: > > > > > On Sat, Nov 07, 2020 at 12:39:39AM -0800, Minchan Kim wrote: > > > Hi Andrew, > > > > > > On Fri, Nov 06,

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-12 Thread Minchan Kim
Hi Andrew, How should we proceed this problem? On Sat, Nov 07, 2020 at 12:39:39AM -0800, Minchan Kim wrote: > Hi Andrew, > > On Fri, Nov 06, 2020 at 05:59:33PM -0800, Andrew Morton wrote: > > On Thu, 5 Nov 2020 09:02:49 -0800 Minchan Kim wrote: > > >

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-12 Thread Minchan Kim
On Wed, Nov 11, 2020 at 03:33:18PM +0100, Arnd Bergmann wrote: > On Wed, Nov 11, 2020 at 2:39 PM Thomas Bogendoerfer > wrote: > > On Wed, Nov 11, 2020 at 11:57:02AM +0100, Arnd Bergmann wrote: > > > On Wed, Nov 11, 2020 at 11:26 AM Mike Rapoport wrote: > > > > > > > > On Wed, Nov 11, 2020 at

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-12 Thread Minchan Kim
Hi, On Wed, Nov 11, 2020 at 08:52:00AM +0200, Mike Rapoport wrote: > Hi, > > On Tue, Nov 10, 2020 at 03:36:20PM -0800, Minchan Kim wrote: > > On Tue, Nov 10, 2020 at 06:21:55PM +0200, Mike Rapoport wrote: > > > On Tue, Nov 10, 2020 at 12:21:11PM +0100, Arnd Bergmann wrote

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-10 Thread Minchan Kim
t neither those nor > > 64-bit mode have so far made it into the kernel. > > > > To be on the safe side, we could provoke a compile-time error > > when CONFIG_PHYS_ADDR_T_64BIT is set on a 32-bit > > architecture, but MAX_POSSIBLE_PHYSMEM_BITS is not set. > > Mayb

Re: [PATCH] mm/zsmalloc: include sparsemem.h for MAX_PHYSMEM_BITS

2020-11-09 Thread Minchan Kim
On Sun, Nov 08, 2020 at 02:16:37AM +0100, Stefan Agner wrote: > On 2020-11-08 01:56, Andrew Morton wrote: > > On Sat, 7 Nov 2020 16:22:06 +0100 Stefan Agner wrote: > > > >> Most architectures define MAX_PHYSMEM_BITS in asm/sparsemem.h and don't > >> include it in asm/pgtable.h. Include

Re: [PATCH] mm: introduce oom_kill_disable sysctl knob

2020-11-09 Thread Minchan Kim
On Mon, Nov 09, 2020 at 05:06:18PM +0100, Michal Hocko wrote: > On Mon 09-11-20 07:39:33, Minchan Kim wrote: > > On Mon, Nov 09, 2020 at 08:37:06AM +0100, Michal Hocko wrote: > > > On Fri 06-11-20 12:32:38, Minchan Kim wrote: > > > > It's hard to have some tests to b

Re: [PATCH] mm: introduce oom_kill_disable sysctl knob

2020-11-09 Thread Minchan Kim
On Mon, Nov 09, 2020 at 08:37:06AM +0100, Michal Hocko wrote: > On Fri 06-11-20 12:32:38, Minchan Kim wrote: > > It's hard to have some tests to be supposed to work under heavy > > memory pressure(e.g., injecting some memory hogger) because > > out-of-memory killer

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-07 Thread Minchan Kim
Hi Andrew, On Fri, Nov 06, 2020 at 05:59:33PM -0800, Andrew Morton wrote: > On Thu, 5 Nov 2020 09:02:49 -0800 Minchan Kim wrote: > > > This reverts commit e47110e90584a22e9980510b00d0dfad3a83354e. > > > > While I was doing zram testing, I found sometimes decomp

Re: [PATCH] mm: introduce oom_kill_disable sysctl knob

2020-11-06 Thread Minchan Kim
On Fri, Nov 06, 2020 at 12:46:47PM -0800, Randy Dunlap wrote: > Hi, > > Fix a few typos: > > On 11/6/20 12:32 PM, Minchan Kim wrote: > > --- > > Documentation/admin-guide/sysctl/vm.rst | 14 ++ > > include/linux/mm.h

[PATCH] mm: introduce oom_kill_disable sysctl knob

2020-11-06 Thread Minchan Kim
we could mark existing process's oom_adj to -1000, it couldn't cover upcoming processes to be forked for the job. This knob is handy to keep system memory pressure. Signed-off-by: Minchan Kim --- Documentation/admin-guide/sysctl/vm.rst | 14 ++ include/linux/mm.h

Re: [RFC]: userspace memory reaping

2020-11-05 Thread Minchan Kim
On Thu, Nov 05, 2020 at 09:21:13AM -0800, Suren Baghdasaryan wrote: > On Thu, Nov 5, 2020 at 9:16 AM Michal Hocko wrote: > > > > On Thu 05-11-20 08:50:58, Suren Baghdasaryan wrote: > > > On Thu, Nov 5, 2020 at 4:20 AM Michal Hocko wrote: > > > > > >

Re: [PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-05 Thread Minchan Kim
On Thu, Nov 05, 2020 at 05:16:02PM +, Matthew Wilcox wrote: > On Thu, Nov 05, 2020 at 09:02:49AM -0800, Minchan Kim wrote: > > This reverts commit e47110e90584a22e9980510b00d0dfad3a83354e. > > > > While I was doing zram testing, I found sometimes decompression failed >

Re: [RFC]: userspace memory reaping

2020-11-05 Thread Minchan Kim
On Thu, Nov 05, 2020 at 08:50:58AM -0800, Suren Baghdasaryan wrote: > On Thu, Nov 5, 2020 at 4:20 AM Michal Hocko wrote: > > > > On Wed 04-11-20 12:40:51, Minchan Kim wrote: > > > On Wed, Nov 04, 2020 at 07:58:44AM +0100, Michal Hocko wrote: > > > > On Tue

[PATCH] Revert "mm/vunmap: add cond_resched() in vunmap_pmd_range"

2020-11-05 Thread Minchan Kim
e_list+0xb94/0xd60^M [ 55.134626] shrink_inactive_list+0x158/0x460^M Cc: Aneesh Kumar K.V Cc: Harish Sriram Cc: Signed-off-by: Minchan Kim --- mm/vmalloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6ae491a8b210..a4f1d39ce710 100644 --- a/mm/vma

Re: [PATCH v4] zram: break the strict dependency from lzo

2020-11-04 Thread Minchan Kim
On Wed, Nov 04, 2020 at 02:12:35PM +, Rui Salvaterra wrote: > Hi, Minchan, > > On Tue, 3 Nov 2020 at 21:29, Minchan Kim wrote: > > > > Can't we just provide choice/endchoice in Kconfig to select default > > comp algorithm from admin? > > I'm fine with what

Re: [RFC]: userspace memory reaping

2020-11-04 Thread Minchan Kim
On Wed, Nov 04, 2020 at 07:58:44AM +0100, Michal Hocko wrote: > On Tue 03-11-20 13:32:28, Minchan Kim wrote: > > On Tue, Nov 03, 2020 at 10:35:50AM +0100, Michal Hocko wrote: > > > On Mon 02-11-20 12:29:24, Suren Baghdasaryan wrote: > > > [...] > > > > To

Re: [PATCH] lib: stackdepot: Add support to configure STACK_HASH_SIZE

2020-11-03 Thread Minchan Kim
er, we want to have reasonable stackdeport hash array With this configuration, it couldn't meet since we always need to reserve a reasonable size for the array. Can't we make the hash size as a kernel parameter? With it, we could use it like this. 1. page_owner=off, stackdepot_stack_hash=0 -> no more wasted memory when we don't use page_owner 2. page_owner=on, stackdepot_stack_hash=8M -> reasonable hash size when we use page_owner. -- Kind regards, Minchan Kim

Re: [RFC]: userspace memory reaping

2020-11-03 Thread Minchan Kim
On Tue, Nov 03, 2020 at 01:40:41PM -0800, Suren Baghdasaryan wrote: > On Tue, Nov 3, 2020 at 1:32 PM Minchan Kim wrote: > > > > On Tue, Nov 03, 2020 at 10:35:50AM +0100, Michal Hocko wrote: > > > On Mon 02-11-20 12:29:24, Suren Baghdasaryan wrote: > > > [...] >

Re: [RFC]: userspace memory reaping

2020-11-03 Thread Minchan Kim
On Tue, Nov 03, 2020 at 10:35:50AM +0100, Michal Hocko wrote: > On Mon 02-11-20 12:29:24, Suren Baghdasaryan wrote: > [...] > > To follow up on this. Should I post an RFC implementing SIGKILL_SYNC > > which in addition to sending a kill signal would also reap the > > victim's mm in the context of

Re: [PATCH v4] zram: break the strict dependency from lzo

2020-11-03 Thread Minchan Kim
Hi Sergey and Rui, On Thu, Oct 29, 2020 at 03:59:27AM +0900, Sergey Senozhatsky wrote: > Cc-ing Andrew > > message-id: 20201028115921.848-1-rsalvate...@gmail.com > > On (20/10/28 11:59), Rui Salvaterra wrote: > > There's nothing special about zram and lzo. It works just fine without it, > > so

[PATCH v2] zram: support a page writeback

2020-10-20 Thread Minchan Kim
page writeback. Cc: Sergey Senozhatsky Signed-off-by: Minchan Kim --- * from v1 * use "page_index=" signature for future extension - Sergey Documentation/admin-guide/blockdev/zram.rst | 5 + drivers/block/zram/zram_drv.c | 21 + 2 files c

Re: [PATCH] zram: Fix __zram_bvec_{read,write}() locking order

2020-10-19 Thread Minchan Kim
jlstra (Intel) > Tested-by: Mikhail Gavrilov Acked-by: Minchan Kim Thanks for the fix.

Re: [External] Re: [PATCH] mm: proc: add Sock to /proc/meminfo

2020-10-16 Thread Minchan Kim
On Fri, Oct 16, 2020 at 05:38:26PM +0200, Vlastimil Babka wrote: > On 10/13/20 10:09 AM, Mike Rapoport wrote: > > > We are not complaining about TCP using too much memory, but how do > > > we know that TCP uses a lot of memory. When I firstly face this problem, > > > I do not know who uses the

Re: [PATCH] zram: support a page writeback

2020-10-16 Thread Minchan Kim
Hi Sergey, On Fri, Oct 16, 2020 at 09:25:47AM +0900, Sergey Senozhatsky wrote: > On (20/10/12 00:14), Minchan Kim wrote: > > > > With the command, zram writeback idle pages from memory to the storage. > > > > +If admin want to write a specific page in zr

Re: swapon/913 is trying to acquire lock at zcomp_stream_get+0x5/0x90 [zram] but task is already holding lock at zs_map_object+0x7a/0x2e0

2020-10-16 Thread Minchan Kim
On Fri, Oct 16, 2020 at 02:40:09PM +0200, Peter Zijlstra wrote: > On Fri, Oct 16, 2020 at 11:21:47AM +0500, Mikhail Gavrilov wrote: > > Hi folks, > > today I joined to testing Kernel 5.10 and see that every boot happens > > this warning: > > > > [9.032096]

Re: [PATCH] zsmalloc: Rework the list_add code in insert_zspage()

2020-10-15 Thread Minchan Kim
On Thu, Oct 15, 2020 at 09:01:07AM -0400, Miaohe Lin wrote: > Rework the list_add code to make it more readable and simplicity. > > Signed-off-by: Miaohe Lin Acked-by: Minchan Kim

Re: [PATCH v4] zram: add restriction on dynamic zram device creation

2020-10-15 Thread Minchan Kim
On Mon, Oct 12, 2020 at 02:04:00PM +0800, Yi Wang wrote: > From: zhanglin > > Add max_num_devices to limit dynamic zram device creation to prevent > potential OOM > > Signed-off-by: zhanglin > Signed-off-by: Yi Wang Acked-by: Minchan Kim

Re: [RFC]: userspace memory reaping

2020-10-15 Thread Minchan Kim
On Thu, Oct 15, 2020 at 11:20:30AM +0200, Michal Hocko wrote: > > > I do have a vague recollection that we have discussed a kill(2) based > > > approach as well in the past. Essentially SIG_KILL_SYNC which would > > > not only send the signal but it would start a teardown of resources > > > owned

[PATCH] zram: support a page writeback

2020-10-12 Thread Minchan Kim
writeback. Cc: Sergey Senozhatsky Signed-off-by: Minchan Kim --- Documentation/admin-guide/blockdev/zram.rst | 5 + drivers/block/zram/zram_drv.c | 14 ++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/blockdev/zram.rst b

[PATCH] mm: validate inode in mapping_set_error

2020-10-09 Thread Minchan Kim
The swap address_space doesn't have host. Thus, it makes kernel crash once swap write meets error. Fix it. [1] 735e4ae5ba28, vfs: track per-sb writeback errors and report them to syncfs Signed-off-by: Minchan Kim --- include/linux/pagemap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

  1   2   3   4   5   6   7   8   9   10   >