Re: [PATCH 0/4] percpu: add basic stats and tracepoints to percpu allocator

2017-06-20 Thread Dennis Zhou
On 6/20/17, 1:45 PM, "Tejun Heo" wrote: > Applied to percpu/for-4.13. I had to update 0002 because of the > recent __ro_after_init changes. Can you please see whether I made any > mistakes while updating it? There is a tagging mismatch in 0002. Can you please change or remove the __read_mostly

[PATCH 1/1] percpu: resolve err may not be initialized in pcpu_alloc

2017-06-21 Thread Dennis Zhou
>From 4a42ecc735cff0015cc73c3d87edede631f4b885 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Wed, 21 Jun 2017 08:07:15 -0700 Add error message to out of space failure for atomic allocations in percpu allocation path to fix -Wmaybe-uninitialized. Signed-off-by: Dennis Zhou Reported

[PATCH 1/1] percpu: fix early calls for spinlock in pcpu_stats

2017-06-21 Thread Dennis Zhou
>From 2c06e795162cb306c9707ec51d3e1deadb37f573 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Wed, 21 Jun 2017 10:17:09 -0700 Commit 30a5b5367ef9 ("percpu: expose statistics about percpu memory via debugfs") introduces percpu memory statistics. pcpu_stats_chunk_alloc takes the

Re: [PATCH net 0/3] Fix for BPF devmap percpu allocation splat

2017-10-18 Thread Dennis Zhou
Hi Daniel and Tejun, On Wed, Oct 18, 2017 at 06:25:26AM -0700, Tejun Heo wrote: > > Daniel Borkmann (3): > > mm, percpu: add support for __GFP_NOWARN flag > > This looks fine. > Looks good to me too. > > bpf: fix splat for illegal devmap percpu allocation > > bpf: do not test for PCPU_MI

[PATCH] proc: add percpu populated pages count to meminfo

2018-08-06 Thread Dennis Zhou
From: "Dennis Zhou (Facebook)" Currently, percpu memory only exposes allocation and utilization information via debugfs. This more or less is only really useful for understanding the fragmentation and allocation information at a per-chunk level with a few global counters. This is

Re: [PATCH] proc: add percpu populated pages count to meminfo

2018-08-07 Thread Dennis Zhou
Hi Vlastimil, On Tue, Aug 07, 2018 at 03:18:31PM +0200, Vlastimil Babka wrote: > > Documentation/filesystems/proc.txt should be updated as well > Will do. > > > > +/* > > + * The number of populated pages in use by the allocator, protected by > > + * pcpu_lock. This number is kept per a uni

Re: [PATCH] proc: add percpu populated pages count to meminfo

2018-08-07 Thread Dennis Zhou
Hi Christopher, On Tue, Aug 07, 2018 at 02:12:06PM +, Christopher Lameter wrote: > On Mon, 6 Aug 2018, Dennis Zhou wrote: > > show_val_kb(m, "VmallocUsed:", 0ul); > > show_val_kb(m, "VmallocChunk: ", 0ul); > > + show_val_kb(m, &q

Re: [PATCH] proc: add percpu populated pages count to meminfo

2018-08-07 Thread Dennis Zhou
Hi Tejun, On Tue, Aug 07, 2018 at 08:11:46AM -0700, Tejun Heo wrote: > Hello, > > On Tue, Aug 07, 2018 at 02:12:06PM +, Christopher Lameter wrote: > > > @@ -121,6 +122,7 @@ static int meminfo_proc_show(struct seq_file *m, void > > > *v) > > > (unsigned long)VMALLOC_TOTAL >> 10);

[PATCH v2] proc: add percpu populated pages count to meminfo

2018-08-07 Thread Dennis Zhou
From: "Dennis Zhou (Facebook)" Currently, percpu memory only exposes allocation and utilization information via debugfs. This more or less is only really useful for understanding the fragmentation and allocation information at a per-chunk level with a few global counters. This is

LPC Traffic Shaping w/ BPF Talk - percpu followup

2018-11-20 Thread Dennis Zhou
Hi Eddie, Vlad, and Willem, A few people mentioned to me that you guys were experiencing issues with the percpu memory allocator. I saw the talk slides mention the following two bullets: 1) allocation pattern makes the per cpu allocator reach a highly fragmented state 2) sometimes takes a long

[PATCH 12/14] blkcg: remove bio_disassociate_task()

2018-12-05 Thread Dennis Zhou
Now that a bio only holds a blkg reference, so clean up is simply putting back that reference. Remove bio_disassociate_task() as it just calls bio_disassociate_blkg() and call the latter directly. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik --- block/bio.c

[PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check()

2018-12-06 Thread Dennis Zhou
I was a little overzealous in removing the rcu_read_lock() call from blkcg_bio_issue_check() and it broke blk-throttle. Put it back. Fixes: e35403a034bf ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou --- include/linux/blk-cgroup.h | 3 +++ 1 file

Re: [PATCH] blkcg: handle dying request_queue when associating a blkg

2018-12-11 Thread Dennis Zhou
Hi Bart, On Tue, Dec 11, 2018 at 03:16:13PM -0800, Bart Van Assche wrote: > On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote: > > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c > > index 6bd0619a7d6e..c30661ddc873 100644 > > --- a/block/blk-cgroup.c > &g

Re: [PATCH] blkcg: handle dying request_queue when associating a blkg

2018-12-13 Thread Dennis Zhou
On Wed, Dec 12, 2018 at 03:54:52PM -0800, Bart Van Assche wrote: > On Tue, 2018-12-11 at 23:06 -0500, Dennis Zhou wrote: > > Hi Bart, > > > > On Tue, Dec 11, 2018 at 03:16:13PM -0800, Bart Van Assche wrote: > > > On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote:

Re: [PATCH v3] block: fix blk-iolatency accounting underflow

2018-12-17 Thread Dennis Zhou
On Mon, Dec 17, 2018 at 11:42:28AM -0800, Liu Bo wrote: > On Mon, Dec 17, 2018 at 8:04 AM Dennis Zhou wrote: > > > > The blk-iolatency controller measures the time from rq_qos_throttle() to > > rq_qos_done_bio() and attributes this time to the first bio that needs > >

[PATCH] blkcg: clean up blkg_tryget_closest()

2018-12-19 Thread Dennis Zhou
The implementation of blkg_tryget_closest() wasn't super obvious and became a point of suspicion when debugging [1]. So let's clean it up so it's obviously not the problem. [1] https://lore.kernel.org/linux-block/a7e97e4b-0dd8-3a54-23b7-a0f27b17f...@kernel.dk/ Signed-off-

[PATCH] blkcg: remove unused __blkg_release_rcu()

2018-12-19 Thread Dennis Zhou
An earlier commit 7fcf2b033b84 ("blkcg: change blkg reference counting to use percpu_ref") moved around the release call from blkg_put() to be a part of the percpu_ref cleanup. Remove the additional unused code which should have been removed earlier. Signed-off-by: Dennis Zhou ---

[PATCH v3] block: fix blk-iolatency accounting underflow

2018-12-17 Thread Dennis Zhou
https://lore.kernel.org/lkml/20181205171039.73066-1-den...@kernel.org/ Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou Cc: Josef Bacik --- block/blk-iolatency.c | 2 +- block/blk-rq-qos.h| 5 + include/linux/blk_types.h | 1 +

[PATCH] block: fix iolat timestamp and restore accounting semantics

2018-12-10 Thread Dennis Zhou
-iolatency in rq_qos_done_bio(). [1] https://lore.kernel.org/lkml/20181205171039.73066-1-den...@kernel.org/ Signed-off-by: Dennis Zhou Cc: Josef Bacik --- block/blk-iolatency.c | 17 ++--- include/linux/blk_types.h | 12 2 files changed, 18 insertions(+), 11 deletions

Re: [PATCH] block: fix iolat timestamp and restore accounting semantics

2018-12-10 Thread Dennis Zhou
Hi Josef, On Mon, Dec 10, 2018 at 01:25:08PM -0500, Josef Bacik wrote: > On Mon, Dec 10, 2018 at 11:35:10AM -0500, Dennis Zhou wrote: > > The blk-iolatency controller measures the time from rq_qos_throttle() to > > rq_qos_done_bio() and attributes this time to the first bio th

[PATCH v2] block: fix iolat timestamp and restore accounting semantics

2018-12-11 Thread Dennis Zhou
https://lore.kernel.org/lkml/20181205171039.73066-1-den...@kernel.org/ Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou Cc: Josef Bacik --- v2: - Switched to reusing BIO_QUEUE_ENTERED rather than adding a second timestamp to the bio stru

[PATCH] blkcg: handle dying request_queue when associating a blkg

2018-12-11 Thread Dennis Zhou
ead request_queue. [1] https://lore.kernel.org/lkml/20180911184137.35897-1-dennissz...@gmail.com/ [2] https://lore.kernel.org/lkml/20181126211946.77067-1-den...@kernel.org/ Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Reported-and-tested-by: Ming Lei Signed-off-by

[PATCH] blkcg: add rcu lock to bio_clone_blkg_association()

2018-12-21 Thread Dennis Zhou
d the blkg->parent pointers are unused. This adds the appropriate read lock in bio_clone_blkg_association(). Fixes: 80fd3c272c1a ("blkcg: clean up blkg_tryget_closest()") Reported-by: syzbot+a36a3ba92bea3b315...@syzkaller.appspotmail.com Signed-off-by: Dennis Zhou --- block/bio.c | 4

Re: [PATCH] blkcg: add rcu lock to bio_clone_blkg_association()

2018-12-21 Thread Dennis Zhou
On Fri, Dec 21, 2018 at 08:26:02AM -0700, Jens Axboe wrote: > On 12/21/18 7:54 AM, Dennis Zhou wrote: > > I cleaned up blkg_tryget_closest() to require rcu_read_lock() earlier. > > However, this was a subtle case too which clearly was too subtle for me. > > The idea was

Re: [GIT PULL] percpu changes for v4.21-rc1

2018-12-28 Thread Dennis Zhou
On Thu, Dec 27, 2018 at 11:04:32AM -0600, Dennis Zhou wrote: > Hi Linus, > > Michael Cree noted generic UP Alpha has been broken since v3.18. This is > a small fix for locking in UP percpu code that fixes the issue. > > Thanks, > Dennis > > The fol

Re: [PATCH] percpu: plumb gfp flag to pcpu_get_pages

2018-12-29 Thread Dennis Zhou
Hi Shakeel, On Fri, Dec 28, 2018 at 05:31:47PM -0800, Shakeel Butt wrote: > __alloc_percpu_gfp() can be called from atomic context, so, make > pcpu_get_pages use the gfp provided to the higher layer. > > Signed-off-by: Shakeel Butt > --- > mm/percpu-vm.c | 9 + > 1 file changed, 5 inser

Re: [PATCH] percpu: plumb gfp flag to pcpu_get_pages

2018-12-29 Thread Dennis Zhou
Hi Andrew, On Sat, Dec 29, 2018 at 01:03:52PM -0800, Andrew Morton wrote: > On Fri, 28 Dec 2018 17:31:47 -0800 Shakeel Butt wrote: > > > __alloc_percpu_gfp() can be called from atomic context, so, make > > pcpu_get_pages use the gfp provided to the higher layer. > > Does this fix any user-visib

[GIT PULL] percpu fixes for-4.19-rc8

2018-10-09 Thread Dennis Zhou
Hi Greg, The new percpu allocator introduced in 4.14 had a missing free for the percpu metadata. This caused a memory leak when percpu memory is being churned resulting in the allocation and deallocation of percpu memory chunks. Thanks, Dennis The following changes since commit 0238df646e6224016

Re: [PATCH] percpu: stop leaking bitmap metadata blocks

2018-10-07 Thread Dennis Zhou
Hi Mike, On Sun, Oct 07, 2018 at 11:31:51AM +0300, Mike Rapoport wrote: > The commit ca460b3c9627 ("percpu: introduce bitmap metadata blocks") > introduced bitmap metadata blocks. These metadata blocks are allocated > whenever a new chunk is created, but they are never freed. Fix it. > > Fixes: c

[GIT PULL] percpu changes for v4.20-rc1

2018-11-01 Thread Dennis Zhou
Hi Linus, Two small things for v4.20. The first fixes a clang uninitialized variable warning for arm64 in the default path calls BUILD_BUG(). The second removes an unnecessary unlikely() in a WARN_ON() use. Thanks, Dennis The following changes since commit 11da3a7f84f19c26da6f86af878298694ede080

Re: linux-next: changes in the maintainership of the percpu tree

2018-09-17 Thread Dennis Zhou
Hi Stephen, On Tue, Sep 18, 2018 at 12:00:03AM +1000, Stephen Rothwell wrote: > Hi Dennis, > > On Mon, 17 Sep 2018 07:53:29 -0400 Tejun Heo wrote: > > > > Ah, yeah, please switch the tree to Dennis's for-next branch instead of > > mine. > > > > Thanks. > > > > On Mon, Sep 17, 2018 at 7:03 AM S

Re: [PATCH] percpu: improve percpu_alloc_percpu_fail event trace

2024-01-24 Thread Dennis Zhou
Hello, On Mon, Jan 22, 2024 at 08:55:39PM -0500, Steven Rostedt wrote: > On Tue, 23 Jan 2024 09:44:43 +0800 > George Guo wrote: > > > There are two reasons of percpu_alloc failed without warnings: > > > > 1. do_warn is false > > 2. do_warn is true and warn_limit is reached the limit. > > Yes

Re: [PATCH v4 0/4] percpu: partial chunk depopulation

2021-04-20 Thread Dennis Zhou
On Tue, Apr 20, 2021 at 04:37:02PM +0530, Pratik Sampat wrote: > > On 20/04/21 4:27 am, Dennis Zhou wrote: > > On Mon, Apr 19, 2021 at 10:50:43PM +0000, Dennis Zhou wrote: > > > Hello, > > > > > > This series is a continuation of Roman's series in [1]

[PATCH] percpu: fix clang modpost section mismatch

2021-02-14 Thread Dennis Zhou
xjzfpqx0eu...@mail.gmail.com/ Reported-by: kernel test robot Cc: Arnd Bergmann Cc: Nick Desaulniers Signed-off-by: Dennis Zhou --- include/linux/compiler_attributes.h | 6 ++ mm/percpu.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/inc

Re: [PATCH v2 5/5] percpu: implement partial chunk depopulation

2021-04-07 Thread Dennis Zhou
slot. > > On the allocation path, if there are no suitable chunks found, > the list of sidelined chunks in scanned prior to creating a new chunk. > If there is a good sidelined chunk, it's placed back to the slot > and the scanning is restarted. > > Many thanks to Dennis

[PATCH 00/12] introduce percpu block scan_hint

2019-02-27 Thread Dennis Zhou
sponsible for more bits. 0011-0012 add chunk scan_hints. This patchset is on top of percpu#master a3b22b9f11d9. diffstats below: Dennis Zhou (12): percpu: update free path with correct new free region percpu: do not search past bitmap when allocating an area percpu: introduce helper to det

[PATCH 01/12] percpu: update free path with correct new free region

2019-02-27 Thread Dennis Zhou
the start. Fix this by using (end - start) as this is only called when updating a hint within a block. Signed-off-by: Dennis Zhou --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c index db86282fd024..53bd79a617b1 100644 --- a/mm/percpu.

[PATCH 06/12] percpu: set PCPU_BITMAP_BLOCK_SIZE to PAGE_SIZE

2019-02-27 Thread Dennis Zhou
by only scanning forward using the scan_hint introduced later too. Signed-off-by: Dennis Zhou --- include/linux/percpu.h | 12 ++--- mm/percpu-km.c | 2 +- mm/percpu.c| 111 + 3 files changed, 49 insertions(+), 76 deletions(-) diff --gi

[PATCH 09/12] percpu: use block scan_hint to only scan forward

2019-02-27 Thread Dennis Zhou
regions are updated manually in pcpu_block_update_hint_free(). Signed-off-by: Dennis Zhou --- mm/percpu.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index dac18968d79f..e51c151ed692 100644 --- a/mm/percpu.c +++ b/mm/percpu.c

[PATCH 10/12] percpu: make pcpu_block_md generic

2019-02-27 Thread Dennis Zhou
nts to be managed as a pcpu_block_md. Signed-off-by: Dennis Zhou --- mm/percpu-internal.h | 1 + mm/percpu.c | 20 +--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mm/percpu-internal.h b/mm/percpu-internal.h index ec58b244545d..119bd1119aa7 100644 --- a

[PATCH 02/12] percpu: do not search past bitmap when allocating an area

2019-02-27 Thread Dennis Zhou
t_off >= end and the correctness of the hints from pcpu_find_block_fit(). This patch fixes this by bounding the end offset by the number of bits in a chunk. Signed-off-by: Dennis Zhou --- mm/percpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu

[PATCH 08/12] percpu: remember largest area skipped during allocation

2019-02-27 Thread Dennis Zhou
possible free areas, smaller allocations will eventually fill those holes. Signed-off-by: Dennis Zhou --- mm/percpu.c | 101 ++-- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index df1aacf58ac8..dac18968d79f

[PATCH 05/12] percpu: relegate chunks unusable when failing small allocations

2019-02-27 Thread Dennis Zhou
the chunk is moved to the empty list. Once an allocation is freed from that chunk, it is placed back into rotation. Signed-off-by: Dennis Zhou --- mm/percpu.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c in

[PATCH 03/12] percpu: introduce helper to determine if two regions overlap

2019-02-27 Thread Dennis Zhou
While block hints were always accurate, it's possible when spanning across blocks that we miss updating the chunk's contig_hint. Rather than rely on correctness of the boundaries of hints, do a full overlap comparison. Signed-off-by: Dennis Zhou --- mm/per

[PATCH 11/12] percpu: convert chunk hints to be based on pcpu_block_md

2019-02-27 Thread Dennis Zhou
y the chunk's pcpu_block_md. Signed-off-by: Dennis Zhou --- mm/percpu-internal.h | 5 +- mm/percpu-stats.c| 5 +- mm/percpu.c | 120 +++ 3 files changed, 57 insertions(+), 73 deletions(-) diff --git a/mm/percpu-internal.h b/mm/percpu-intern

[PATCH 04/12] percpu: manage chunks based on contig_bits instead of free_bytes

2019-02-27 Thread Dennis Zhou
the allocation request. Signed-off-by: Dennis Zhou --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c index b40112b2fc59..c996bcffbb2a 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -234,7 +234,7 @@ static int pcpu_chunk_slot(const struct

[PATCH 12/12] percpu: use chunk scan_hint to skip some scanning

2019-02-27 Thread Dennis Zhou
locks. Signed-off-by: Dennis Zhou --- mm/percpu.c | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index 197479f2c489..40d49d7fb286 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -711,20 +711,31 @@ static

[PATCH 07/12] percpu: add block level scan_hint

2019-02-27 Thread Dennis Zhou
contig_hint == scan_hint, then scan_hint_start > contig_hint_start. This is necessary for scan_hint discovery when refreshing a block. Signed-off-by: Dennis Zhou --- mm/percpu-internal.h | 9 mm/percpu.c | 101 --- 2 files changed,

Re: [PATCH] percpu/module resevation: change resevation size iff X86_VSMP is set

2019-03-01 Thread Dennis Zhou
might get lost. To get > the appropriate people and lists, run: > > scripts/get_maintainer.pl YOUR_PATCH.patch. > > For this patch, you'll get this: > > Dennis Zhou (maintainer:PER-CPU MEMORY ALLOCATOR) > Tejun Heo (maintainer:PER-CPU MEMORY ALLOCATOR) > Chr

Re: [PATCH 02/12] percpu: do not search past bitmap when allocating an area

2019-03-02 Thread Dennis Zhou
On Sat, Mar 02, 2019 at 01:32:04PM +, Peng Fan wrote: > Hi Dennis, > > > -Original Message- > > From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On > > Behalf Of Dennis Zhou > > Sent: 2019年2月28日 10:18 > > To: Dennis Zhou ; Tejun

Re: [PATCH 03/12] percpu: introduce helper to determine if two regions overlap

2019-03-02 Thread Dennis Zhou
On Sat, Mar 02, 2019 at 01:37:37PM +, Peng Fan wrote: > Hi Dennis, > > > -Original Message- > > From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On > > Behalf Of Dennis Zhou > > Sent: 2019年2月28日 10:19 > > To: Dennis Zhou ; Tejun

Re: [PATCH 04/12] percpu: manage chunks based on contig_bits instead of free_bytes

2019-03-02 Thread Dennis Zhou
On Sat, Mar 02, 2019 at 01:48:20PM +, Peng Fan wrote: > > > > -Original Message- > > From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On > > Behalf Of Dennis Zhou > > Sent: 2019年2月28日 10:19 > > To: Dennis Zhou ; Tejun Heo ; Christ

Re: [PATCH 05/12] percpu: relegate chunks unusable when failing small allocations

2019-03-02 Thread Dennis Zhou
On Sat, Mar 02, 2019 at 01:55:54PM +, Peng Fan wrote: > Hi Dennis, > > > -Original Message- > > From: owner-linux...@kvack.org [mailto:owner-linux...@kvack.org] On > > Behalf Of Dennis Zhou > > Sent: 2019年2月28日 10:19 > > To: Dennis Zhou ; Tejun

Re: [PATCH 00/12] introduce percpu block scan_hint

2019-03-13 Thread Dennis Zhou
On Wed, Feb 27, 2019 at 09:18:27PM -0500, Dennis Zhou wrote: > Hi everyone, > > It was reported a while [1] that an increase in allocation alignment > requirement [2] caused the percpu memory allocator to do significantly > more work. > > After spending quite a bit of ti

[PATCH 10/12] btrfs: zstd use the passed through level instead of default

2019-02-04 Thread Dennis Zhou
Zstd currently only supports the default level of compression. This patch switches to using the level passed in for btrfs zstd configuration. Zstd workspaces now keep track of the requested level as this can differ from the size of the workspace. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay

[PATCH 06/12] btrfs: add compression interface in (get/put)_workspace()

2019-02-04 Thread Dennis Zhou
neric implementations of the higher interface. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik --- fs/btrfs/compression.c | 57 +- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index b213d1e

[PATCH 11/12] btrfs: make zstd memory requirements monotonic

2019-02-04 Thread Dennis Zhou
and memory required. This is also done in upstream zstd in [1]. [1] https://github.com/facebook/zstd/commit/a68b76afefec6876f8e8a538155109a5aeac0143 Signed-off-by: Dennis Zhou Cc: Nick Terrell --- fs/btrfs/zstd.c | 38 +- 1 file changed, 33 insertions(+), 5

[PATCH 08/12] btrfs: plumb level through the compression interface

2019-02-04 Thread Dennis Zhou
zstd. This pach plumbs compression level through the interface as a parameter in preparation for zstd compression levels. This gives the compression types opportunity to create/manage based on the compression level. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay Borisov Reviewed-by: Josef

[PATCH 07/12] btrfs: move to fn pointers for get/put workspaces

2019-02-04 Thread Dennis Zhou
s are abstracted so each compression algorithm can decide how they want to manage their workspaces. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik --- fs/btrfs/compression.c | 101 +++-- fs/btrfs/compression.h | 26 +++ fs/btrfs/lzo.c

[PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-04 Thread Dennis Zhou
. Signed-off-by: Dennis Zhou --- fs/btrfs/compression.c | 21 + fs/btrfs/compression.h | 10 -- fs/btrfs/lzo.c | 3 ++- fs/btrfs/super.c | 4 +++- fs/btrfs/zlib.c| 18 ++ fs/btrfs/zstd.c| 3 ++- 6 files changed, 38 insertions

[PATCH 04/12] btrfs: unify compression ops with workspace_manager

2019-02-04 Thread Dennis Zhou
Make the workspace_manager own the interface operations rather than managing index-paired arrays for the workspace_manager and compression operations. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik --- fs/btrfs/compression.c | 11 +++ 1 file changed

[PATCH 01/12] btrfs: add helpers for compression type and level

2019-02-04 Thread Dennis Zhou
It is very easy to miss places that rely on a certain bitshifting for decyphering the type_level overloading. Add helpers to do this instead. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Cc: Omar Sandoval --- fs/btrfs/compression.c | 2 +- fs/btrfs

[PATCH 05/12] btrfs: add helper methods for workspace manager init and cleanup

2019-02-04 Thread Dennis Zhou
. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik --- fs/btrfs/compression.c | 81 ++ 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index ef560b47b9c5

[PATCH 02/12] btrfs: rename workspaces_list to workspace_manager

2019-02-04 Thread Dennis Zhou
This is in preparation for zstd compression levels. As each level will require different sized workspaces, workspaces_list is no longer a really fitting name. Signed-off-by: Dennis Zhou Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik --- fs/btrfs/compression.c | 46

[PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-04 Thread Dennis Zhou
0011 makes zstd compression level memory monotonic. 00012 adds zstd compression level support. This patchset is on top of kdave#master d73aba1115cf. diffstats below: Dennis Zhou (12): btrfs: add helpers for compression type and level btrfs: rename workspaces_list to workspace_manager bt

Re: [PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 03:57:53PM +0100, David Sterba wrote: > On Mon, Feb 04, 2019 at 03:19:56PM -0500, Dennis Zhou wrote: > > Hi everyone, > > > > V2 had only a handful of changes outside of minor feedback. > > 0001: > > - use functions over macros > >

Re: [PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 05:27:34PM +0100, David Sterba wrote: > On Tue, Feb 05, 2019 at 11:03:02AM -0500, Dennis Zhou wrote: > > On Tue, Feb 05, 2019 at 03:57:53PM +0100, David Sterba wrote: > > > On Mon, Feb 04, 2019 at 03:19:56PM -0500, Dennis Zhou wrote: > > > > Hi

Re: [PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 07:27:49PM +0100, David Sterba wrote: > On Tue, Feb 05, 2019 at 06:07:49PM +0100, David Sterba wrote: > > On Tue, Feb 05, 2019 at 05:51:13PM +0100, David Sterba wrote: > > > On Tue, Feb 05, 2019 at 11:30:12AM -0500, Dennis Zhou wrote: > > > >

[PATCH v2 12/12] btrfs: add zstd compression level support

2019-02-05 Thread Dennis Zhou
>From 0d8684d1d7b18dfa9d5bc9c74033c6c3b6fecd92 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Sat, 19 Jan 2019 18:51:39 -0800 Zstd compression requires different amounts of memory for each level of compression. The prior patches implemented indirection to allow for each compression type

Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 08:06:37PM +0100, David Sterba wrote: > On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: > > -unsigned int btrfs_compress_str2level(const char *str) > > +unsigned int btrfs_compress_str2level(unsigned int type, const char *str) > > { &g

Re: [PATCH 09/12] btrfs: change set_level() to bound the level passed in

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 08:54:15PM +0100, David Sterba wrote: > On Tue, Feb 05, 2019 at 02:32:54PM -0500, Dennis Zhou wrote: > > On Tue, Feb 05, 2019 at 08:06:37PM +0100, David Sterba wrote: > > > On Mon, Feb 04, 2019 at 03:20:05PM -0500, Dennis Zhou wrote: >

Re: [PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-05 Thread Dennis Zhou
On Tue, Feb 05, 2019 at 01:30:27PM -0500, Dennis Zhou wrote: > On Tue, Feb 05, 2019 at 07:27:49PM +0100, David Sterba wrote: > > On Tue, Feb 05, 2019 at 06:07:49PM +0100, David Sterba wrote: > > > On Tue, Feb 05, 2019 at 05:51:13PM +0100, David Sterba wrote: > > > >

Re: [PATCH v3 12/12] btrfs: add zstd compression level support

2019-02-06 Thread Dennis Zhou
>From 16b7c3fe05984a95436da1e9e01c80de1fdbba25 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Sat, 19 Jan 2019 18:51:39 -0800 Zstd compression requires different amounts of memory for each level of compression. The prior patches implemented indirection to allow for each compression type

Re: [PATCH v2 09/12] btrfs: change set_level() to bound the level passed in

2019-02-06 Thread Dennis Zhou
>From ef64a8d1f4ec44f52bd13a825288a91667121708 Mon Sep 17 00:00:00 2001 From: Dennis Zhou Date: Thu, 17 Jan 2019 12:13:27 -0800 Currently, the only user of set_level() is zlib which sets an internal workspace parameter. As level is now plumbed into get_workspace(), this can be handled th

Re: [PATCH v2 00/12] btrfs: add zstd compression level support

2019-02-06 Thread Dennis Zhou
On Wed, Feb 06, 2019 at 04:15:52PM +0100, David Sterba wrote: > On Tue, Feb 05, 2019 at 03:48:48PM -0500, Dennis Zhou wrote: > > > Ok great! I'm going to add a v2 for 0012 to add taking the spin_lock > > > just to be safe in cleanup. I should have t

Re: [PATCH 1/2] percpu: km: remove SMP check

2019-02-25 Thread Dennis Zhou
On Sun, Feb 24, 2019 at 01:13:43PM +, Peng Fan wrote: > percpu-km could only be selected by NEED_PER_CPU_KM which > depends on !SMP, so CONFIG_SMP will be false when choose percpu-km. > > Signed-off-by: Peng Fan > --- > mm/percpu-km.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

Re: [PATCH 2/2] percpu: km: no need to consider pcpu_group_offsets[0]

2019-02-26 Thread Dennis Zhou
On Tue, Feb 26, 2019 at 03:15:50PM +, Christopher Lameter wrote: > On Mon, 25 Feb 2019, den...@kernel.org wrote: > > > > @@ -67,7 +67,7 @@ static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp) > > > pcpu_set_page_chunk(nth_page(pages, i), chunk); > > > > > > chunk->data = pages; >

Re: [PATCH 1/2] percpu: km: remove SMP check

2019-02-26 Thread Dennis Zhou
On Tue, Feb 26, 2019 at 03:16:44PM +, Christopher Lameter wrote: > On Mon, 25 Feb 2019, Dennis Zhou wrote: > > > > @@ -27,7 +27,7 @@ > > > * chunk size is not aligned. percpu-km code will whine about it. > > > */ > > >

Re: [RFC] percpu: decrease pcpu_nr_slots by 1

2019-02-26 Thread Dennis Zhou
On Tue, Feb 26, 2019 at 12:09:28AM +, Peng Fan wrote: > Hi Dennis, > > > -Original Message- > > From: den...@kernel.org [mailto:den...@kernel.org] > > Sent: 2019年2月25日 23:24 > > To: Peng Fan > > Cc: t...@kernel.org; c...@linux.com; linux...@kvack.org; > > linux-kernel@vger.kernel.org;

Re: [PATCH 1/2] percpu: km: remove SMP check

2019-02-27 Thread Dennis Zhou
On Wed, Feb 27, 2019 at 01:02:16PM +, Peng Fan wrote: > Hi Dennis > > > -Original Message- > > From: Dennis Zhou [mailto:den...@kernel.org] > > Sent: 2019年2月27日 1:04 > > To: Christopher Lameter > > Cc: Peng Fan ; t...@kernel.org; linux...@kvack.o

Re: [RFC] percpu: decrease pcpu_nr_slots by 1

2019-02-27 Thread Dennis Zhou
On Wed, Feb 27, 2019 at 01:33:15PM +, Peng Fan wrote: > Hi Dennis, > > > -Original Message- > > From: Dennis Zhou [mailto:den...@kernel.org] > > Sent: 2019年2月27日 1:33 > > To: Peng Fan > > Cc: den...@kernel.org; t...@kernel.org; c...@linux.com;

Re: [PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned up

2019-02-27 Thread Dennis Zhou
On Wed, Feb 27, 2019 at 05:44:41PM +0100, David Sterba wrote: > On Fri, Feb 22, 2019 at 02:53:48PM -0500, Dennis Zhou wrote: > > The timer function, zstd_reclaim_timer_fn(), reschedules itself under > > certain conditions. When cleaning up, take the lock and remove all >

[PATCH] btrfs: remove indirect function calls from zstd

2019-02-27 Thread Dennis Zhou
While calling functions inside zstd, we don't need to use the indirection provided by the workspace_manager. Forward declarations are added to maintain the function order of btrfs_compress_op. Signed-off-by: Dennis Zhou --- fs/btrfs/zstd.c | 11 +++ 1 file changed, 7 insertions(

Re: [PATCH v2] btrfs: zstd ensure reclaim timer is properly cleaned up

2019-02-27 Thread Dennis Zhou
On Wed, Feb 27, 2019 at 07:36:50PM +0100, David Sterba wrote: > On Wed, Feb 27, 2019 at 01:29:16PM -0500, Dennis Zhou wrote: > > > I've noticed while reading the code, why do you use the indirect call > > > here? The wsm.ops points to btrfs_zstd_compress so free

[GIT PULL] percpu changes for v5.12-rc1

2021-02-22 Thread Dennis Zhou
aa52f: percpu: fix clang modpost section mismatch (2021-02-14 18:15:15 +) Dennis Zhou (1): percpu: fix clang modpost section mismatch Wonhyuk Yang (1): percpu: reduce the number of cpu distance comparisons include/

[PATCH] percpu: fix clang modpost warning in pcpu_build_alloc_info()

2020-12-31 Thread Dennis Zhou
rk: cpumask_clear_cpu not inlined into pcpu_build_alloc_info because too costly to inline (cost=725, threshold=325) [-Rpass-missed=inline] [1] https://lore.kernel.org/linux-mm/202012220454.9f6bkz9q-...@intel.com/ Reported-by: kernel test robot Signed-off-by: Dennis Zhou --- This is on top of percp

Re: [PATCH rfc 1/4] percpu: implement partial chunk depopulation

2021-03-29 Thread Dennis Zhou
On Wed, Mar 24, 2021 at 12:06:23PM -0700, Roman Gushchin wrote: > This patch implements partial depopulation of percpu chunks. > > As now, a chunk can be depopulated only as a part of the final > destruction, when there are no more outstanding allocations. However > to minimize a memory waste, it

Re: [PATCH rfc 2/4] percpu: split __pcpu_balance_workfn()

2021-03-29 Thread Dennis Zhou
) > { > enum pcpu_chunk_type type; > > - for (type = 0; type < PCPU_NR_CHUNK_TYPES; type++) > - __pcpu_balance_workfn(type); > + for (type = 0; type < PCPU_NR_CHUNK_TYPES; type++) { > + mutex_lock(&pcpu_alloc_mutex); > +

Re: [PATCH rfc 3/4] percpu: on demand chunk depopulation

2021-03-29 Thread Dennis Zhou
On Wed, Mar 24, 2021 at 12:06:25PM -0700, Roman Gushchin wrote: > To return unused memory to the system schedule an async > depopulation of percpu chunks. > > To balance between scanning too much and creating an overhead because > of the pcpu_lock contention and scanning not enough, let's track an

Re: [PATCH rfc 1/4] percpu: implement partial chunk depopulation

2021-03-29 Thread Dennis Zhou
On Mon, Mar 29, 2021 at 11:29:22AM -0700, Roman Gushchin wrote: > On Mon, Mar 29, 2021 at 05:20:55PM +0000, Dennis Zhou wrote: > > On Wed, Mar 24, 2021 at 12:06:23PM -0700, Roman Gushchin wrote: > > > This patch implements partial depopulation of percpu chunks. > > > &

Re: [PATCH rfc 3/4] percpu: on demand chunk depopulation

2021-03-29 Thread Dennis Zhou
On Mon, Mar 29, 2021 at 01:10:10PM -0700, Roman Gushchin wrote: > On Mon, Mar 29, 2021 at 07:21:24PM +0000, Dennis Zhou wrote: > > On Wed, Mar 24, 2021 at 12:06:25PM -0700, Roman Gushchin wrote: > > > To return unused memory to the system schedule an async > > > de

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-15 Thread Dennis Zhou
On Thu, Apr 15, 2021 at 01:24:31PM +0800, Huang, Ying wrote: > Dennis Zhou writes: > > > On Wed, Apr 14, 2021 at 01:44:58PM +0800, Huang, Ying wrote: > >> Dennis Zhou writes: > >> > >> > On Wed, Apr 14, 2021 at 11:59:03AM +0800, Huan

Re: [PATCH v3 0/6] percpu: partial chunk depopulation

2021-04-16 Thread Dennis Zhou
Hello, On Fri, Apr 16, 2021 at 06:26:15PM +0530, Pratik Sampat wrote: > Hello Roman, > > I've tried the v3 patch series on a POWER9 and an x86 KVM setup. > > My results of the percpu_test are as follows: > Intel KVM 4CPU:4G > Vanilla 5.12-rc6 > # ./percpu_test.sh > Percpu: 1952 kB >

Re: [PATCH v3 1/6] percpu: fix a comment about the chunks ordering

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:31PM -0700, Roman Gushchin wrote: > Since the commit 3e54097beb22 ("percpu: manage chunks based on > contig_bits instead of free_bytes") chunks are sorted based on the > size of the biggest continuous free area instead of the total number > of free bytes. Updat

Re: [PATCH v3 2/6] percpu: split __pcpu_balance_workfn()

2021-04-16 Thread Dennis Zhou
ep the current synchronization in place. > > Signed-off-by: Roman Gushchin > Reviewed-by: Dennis Zhou > --- > mm/percpu.c | 46 +- > 1 file changed, 29 insertions(+), 17 deletions(-) > > diff --git a/mm/percpu.c b/mm/percpu.

Re: [PATCH v3 3/6] percpu: make pcpu_nr_empty_pop_pages per chunk type

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:33PM -0700, Roman Gushchin wrote: > nr_empty_pop_pages is used to guarantee that there are some free > populated pages to satisfy atomic allocations. Accounted and > non-accounted allocations are using separate sets of chunks, > so both need to have a surplus o

Re: [PATCH v3 4/6] percpu: generalize pcpu_balance_populated()

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:34PM -0700, Roman Gushchin wrote: > To prepare for the depopulation of percpu chunks, split out the > populating part of the pcpu_balance_populated() into the new > pcpu_grow_populated() (with an intention to add > pcpu_shrink_populated() in the next commit). >

Re: [PATCH v3 5/6] percpu: factor out pcpu_check_chunk_hint()

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:35PM -0700, Roman Gushchin wrote: > Factor out the pcpu_check_chunk_hint() helper, which will be useful > in the future. The new function checks if the allocation can likely > fit the given chunk. > > Signed-off-by: Roman Gushchin > --- > mm/percpu.c | 30 ++

Re: [PATCH v3 0/6] percpu: partial chunk depopulation

2021-04-16 Thread Dennis Zhou
; > > > > > > > > > I apologize for the clutter of logs before, I'm pasting the logs > > > > > > > of before and > > > > > > > after the percpu test in the case of the patchset being applied > > > > > > >

Re: [PATCH 1/5] mm/swapfile: add percpu_ref support for swap

2021-04-13 Thread Dennis Zhou
Hello, On Wed, Apr 14, 2021 at 10:06:48AM +0800, Huang, Ying wrote: > Miaohe Lin writes: > > > On 2021/4/14 9:17, Huang, Ying wrote: > >> Miaohe Lin writes: > >> > >>> On 2021/4/12 15:24, Huang, Ying wrote: > "Huang, Ying" writes: > > > Miaohe Lin writes: > > > >> We wi

  1   2   3   >