Re: [PATCH] dax: remove SLAB_MEM_SPREAD flag usage

2024-02-27 Thread Chengming Zhou
On 2024/2/28 00:29, Dave Jiang wrote: > > > On 2/24/24 6:47 AM, chengming.z...@linux.dev wrote: >> From: Chengming Zhou >> >> The SLAB_MEM_SPREAD flag is already a no-op as of 6.8-rc1, remove >> its usage so we can delete it from slab. No functional change. &

[PATCH] tracefs: remove SLAB_MEM_SPREAD flag usage

2024-02-24 Thread chengming . zhou
From: Chengming Zhou The SLAB_MEM_SPREAD flag is already a no-op as of 6.8-rc1, remove its usage so we can delete it from slab. No functional change. Signed-off-by: Chengming Zhou --- fs/tracefs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c

[PATCH] dax: remove SLAB_MEM_SPREAD flag usage

2024-02-24 Thread chengming . zhou
From: Chengming Zhou The SLAB_MEM_SPREAD flag is already a no-op as of 6.8-rc1, remove its usage so we can delete it from slab. No functional change. Signed-off-by: Chengming Zhou --- drivers/dax/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/super.c b

Re: [PATCH v11 1/5] lib: objpool added: ring-array based lockless MPMC

2023-10-17 Thread Chengming Zhou
On 2023/10/17 21:56, wuqiang.matt wrote: > objpool is a scalable implementation of high performance queue for > object allocation and reclamation, such as kretprobe instances. > > With leveraging percpu ring-array to mitigate hot spots of memory > contention, it delivers near-linear scalability fo

[PATCH] cgroup-v2: Add taskstats counters in cgroup.stat

2021-03-10 Thread Chengming Zhou
these counters maintained in psi subsystem, so this patch sum them up and export in the cgroup.stat interface. Signed-off-by: Chengming Zhou --- Documentation/admin-guide/cgroup-v2.rst | 9 +++ include/linux/psi.h | 1 + kernel/cgroup/cgroup.c

[tip: sched/core] psi: Optimize task switch inside shared cgroups

2021-03-06 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: 4117cebf1a9fcbf35b9aabf0e37b6c5eea296798 Gitweb: https://git.kernel.org/tip/4117cebf1a9fcbf35b9aabf0e37b6c5eea296798 Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:59 +08:00

[tip: sched/core] psi: Add PSI_CPU_FULL state

2021-03-06 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: e7fcd762282332f765af2035a9568fb126fa3c01 Gitweb: https://git.kernel.org/tip/e7fcd762282332f765af2035a9568fb126fa3c01 Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:56 +08:00

[tip: sched/core] psi: Use ONCPU state tracking machinery to detect reclaim

2021-03-06 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: 7fae6c8171d20ac55402930ee8ae760cf85dff7b Gitweb: https://git.kernel.org/tip/7fae6c8171d20ac55402930ee8ae760cf85dff7b Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:57 +08:00

[tip: sched/core] psi: Optimize task switch inside shared cgroups

2021-03-04 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: e6560d58334ca463061ade733674abc8dd0df9bd Gitweb: https://git.kernel.org/tip/e6560d58334ca463061ade733674abc8dd0df9bd Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:59 +08:00

[tip: sched/core] psi: Use ONCPU state tracking machinery to detect reclaim

2021-03-04 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: f3f7feec57b9141dfed9825874d0191b1ac18ad2 Gitweb: https://git.kernel.org/tip/f3f7feec57b9141dfed9825874d0191b1ac18ad2 Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:57 +08:00

[tip: sched/core] psi: Add PSI_CPU_FULL state

2021-03-04 Thread tip-bot2 for Chengming Zhou
The following commit has been merged into the sched/core branch of tip: Commit-ID: 311b293811a31929c72c790eff48cf767561589f Gitweb: https://git.kernel.org/tip/311b293811a31929c72c790eff48cf767561589f Author:Chengming Zhou AuthorDate:Wed, 03 Mar 2021 11:46:56 +08:00

Re: [External] Re: [PATCH v2 0/4] psi: Add PSI_CPU_FULL state and some code optimization

2021-03-03 Thread Chengming Zhou
在 2021/3/4 上午12:05, Peter Zijlstra 写道: > On Wed, Mar 03, 2021 at 04:32:18PM +0100, Peter Zijlstra wrote: > >> Yes, I can do that. Thanks! > Please double check the patches as found here: > > > https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=sched/core > > I've manually e

[PATCH v2 3/4] psi: pressure states are unlikely

2021-03-03 Thread Chengming Zhou
From: Johannes Weiner Move the unlikely branches out of line. This eliminates undesirable jumps during wakeup and sleeps for workloads that aren't under any sort of resource pressure. Signed-off-by: Johannes Weiner --- kernel/sched/psi.c | 14 +++--- 1 file changed, 7 insertions(+), 7

[PATCH v2 0/4] psi: Add PSI_CPU_FULL state and some code optimization

2021-03-03 Thread Chengming Zhou
branches out of line to eliminate undesirable jumps during wakeup and sleeps. Patch 4 optimize the voluntary sleep switch by remove one call of psi_group_change() for every common cgroup ancestor of the two tasks. Chengming Zhou (3): psi: Add PSI_CPU_FULL state psi: Use ONCPU state tracking

[PATCH v2 4/4] psi: Optimize task switch inside shared cgroups

2021-03-03 Thread Chengming Zhou
)) # all ancestors psi_group_change(prev, .clear=common?TSK_RUNNING:TSK_RUNNING|TSK_ONCPU) When a voluntary sleep switches to another task, we remove one call of psi_group_change() for every common cgroup ancestor of the two tasks. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- Updat

[PATCH v2 2/4] psi: Use ONCPU state tracking machinery to detect reclaim

2021-03-03 Thread Chengming Zhou
nting out the psi_task_switch() optimization things and the clearer changelog. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- Updates since v1: - Fold changes from Johannes that compare task psi_flags instead of in_memstall in the psi_task_switch() optimization and move it out o

[PATCH v2 1/4] psi: Add PSI_CPU_FULL state

2021-03-03 Thread Chengming Zhou
Song Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou Acked-by: Johannes Weiner --- include/linux/psi_types.h | 3 ++- kernel/sched/psi.c| 14 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h

[PATCH v2] psi: Optimize task switch inside shared cgroups

2021-02-16 Thread Chengming Zhou
code from Johannes. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- kernel/sched/psi.c | 35 +-- kernel/sched/stats.h | 28 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/kernel/sched/psi.c b/kerne

Re: [External] Re: [PATCH] psi: Optimize task switch inside shared cgroups

2021-02-16 Thread Chengming Zhou
Hello Johannes, 在 2021/2/17 上午4:00, Johannes Weiner 写道: > Hello Chengming, > > This patch looks useful to me. A couple of comments below: > > On Tue, Feb 09, 2021 at 03:14:13PM +0800, Chengming Zhou wrote: >> The commit 36b238d57172 ("psi: Optimize switching tasks insid

[PATCH v2] psi: Use ONCPU state tracking machinery to detect reclaim

2021-02-12 Thread Chengming Zhou
from Johannes too, and the detailed bench results can be seen from here: https://lore.kernel.org/patchwork/patch/1378653/#1577607 Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- include/linux/psi.h | 1 - kernel/sched/core.c | 1 - kernel/sched/psi.c

Re: [External] Re: [PATCH] psi: Use ONCPU state tracking machinery to detect reclaim

2021-02-11 Thread Chengming Zhou
Hello Johannes, 在 2021/2/11 上午4:37, Johannes Weiner 写道: > On Wed, Feb 10, 2021 at 12:06:05PM +0800, Chengming Zhou wrote: >> Move the reclaim detection from the timer tick to the task state >> tracking machinery using the recently added ONCPU state. And we >> also add m

[PATCH] psi: Use ONCPU state tracking machinery to detect reclaim

2021-02-09 Thread Chengming Zhou
psi_task_switch() optimization things and the clearer changelog. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- include/linux/psi.h | 1 - kernel/sched/core.c | 1 - kernel/sched/psi.c | 52 kernel/sched/stats.h | 9 - 4

Re: [External] Re: [PATCH v2] psi: Remove the redundant psi_task_tick

2021-02-09 Thread Chengming Zhou
Hello Johannes, 在 2021/2/9 下午11:48, Johannes Weiner 写道: > Hello Chengming, > > On Tue, Feb 09, 2021 at 03:10:33PM +0800, Chengming Zhou wrote: >> When the current task in a cgroup is in_memstall, the corresponding groupc >> on that cpu is in PSI_MEM_FULL state, so we can e

[PATCH] psi: Optimize task switch inside shared cgroups

2021-02-08 Thread Chengming Zhou
t and prev task in sleep case, that can save many psi_group_change especially when most activity comes from one leaf cgroup. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- kernel/sched/psi.c | 27 +-- kernel/sched/stats.h | 17 +++-- 2 fi

[PATCH v2] psi: Remove the redundant psi_task_tick

2021-02-08 Thread Chengming Zhou
When the current task in a cgroup is in_memstall, the corresponding groupc on that cpu is in PSI_MEM_FULL state, so we can exploit that to remove the redundant psi_task_tick from scheduler_tick to save this periodic cost. Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- include

Re: [External] Re: [PATCH] psi: Remove the redundant psi_task_tick

2021-02-08 Thread Chengming Zhou
在 2021/2/9 上午12:45, Johannes Weiner 写道: > On Sun, Feb 07, 2021 at 07:56:42PM +0800, Chengming Zhou wrote: >> From: zhouchengming >> >> When the current task in a cgroup is in_memstall, the corresponding psi_group >> is in PSI_MEM_FULL state > This is correct. >

[PATCH v2] psi: Add PSI_CPU_FULL state

2021-02-08 Thread Chengming Zhou
Song Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou Acked-by: Johannes Weiner --- include/linux/psi_types.h | 3 ++- kernel/sched/psi.c| 14 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h

Re: [External] Re: [PATCH] psi: Add PSI_CPU_FULL state

2021-02-08 Thread Chengming Zhou
在 2021/2/9 上午2:18, Johannes Weiner 写道: > On Sun, Feb 07, 2021 at 03:24:02PM +0800, Chengming Zhou wrote: >> The FULL state doesn't exist for the CPU resource at the system level, >> but exist at the cgroup level, means all non-idle tasks in a cgroup are >> delayed on t

[PATCH] psi: Remove the redundant psi_task_tick

2021-02-07 Thread Chengming Zhou
From: zhouchengming When the current task in a cgroup is in_memstall, the corresponding psi_group is in PSI_MEM_FULL state, so we can remove the redundant psi_task_tick from scheduler_tick to save this periodic cost. Signed-off-by: Chengming Zhou --- include/linux/psi.h | 1 - kernel/sched

[PATCH] psi: Add PSI_CPU_FULL state

2021-02-06 Thread Chengming Zhou
The FULL state doesn't exist for the CPU resource at the system level, but exist at the cgroup level, means all non-idle tasks in a cgroup are delayed on the CPU resource which used by others outside of the cgroup. Co-developed-by: Muchun Song Signed-off-by: Muchun Song Signed-off-by: Chen

[PATCH] psi: Add PSI_CPU_FULL state

2020-12-24 Thread Chengming Zhou
From: zhouchengming When I run a simple "perf bench sched pipe" test in a cgroup on my machine, the output of "watch -d -n 1 cpu.pressure" of this cgroup will report some avg10 10%-20%. It's strange because there is not any other process in the cgroup. Then I found that cpu contention/wait percen

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Chengming Zhou
在 2020/9/28 下午5:01, Peter Zijlstra 写道: > On Mon, Sep 28, 2020 at 04:54:53PM +0800, Chengming Zhou wrote: >> 在 2020/9/28 下午3:32, Peter Zijlstra 写道: >>> On Mon, Sep 28, 2020 at 12:11:30AM +0800, Chengming Zhou wrote: >>>> The WARN_ON/WARN_ON_ONCE with rq lock

Re: [External] Re: [PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-28 Thread Chengming Zhou
在 2020/9/28 下午3:32, Peter Zijlstra 写道: > On Mon, Sep 28, 2020 at 12:11:30AM +0800, Chengming Zhou wrote: >> The WARN_ON/WARN_ON_ONCE with rq lock held in __schedule() should be >> deferred by marking the PRINTK_DEFERRED_CONTEXT_MASK, or will cause >> deadlock on rq lock in

[PATCH 1/2] printk: Add printk_deferred_{enter, exit}

2020-09-27 Thread Chengming Zhou
dlock when warn condition met. If we can mark the printk_deferred area when rq lock held using pintk_deferred_{enter, exit}, all console output in that area will be deferred. Signed-off-by: Chengming Zhou Signed-off-by: MuChun Song --- include/linux/printk.h | 8 kernel/p

[PATCH 2/2] sched: mark PRINTK_DEFERRED_CONTEXT_MASK in __schedule()

2020-09-27 Thread Chengming Zhou
The WARN_ON/WARN_ON_ONCE with rq lock held in __schedule() should be deferred by marking the PRINTK_DEFERRED_CONTEXT_MASK, or will cause deadlock on rq lock in the printk path. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/sched/core.c | 2 ++ 1 file changed, 2 insertions

Re: [Phishing Risk] [External] Re: [PATCH] cgroup: Add cgroupstats numbers to cgroup.stat file

2020-09-23 Thread Chengming Zhou
在 2020/9/21 下午10:50, Tejun Heo 写道: > Hello, > > On Tue, Sep 15, 2020 at 11:53:49PM +0800, Chengming Zhou wrote: >> In the cgroup v1, we can use netlink interface to get cgroupstats for >> a cgroup. But it has been excluded from cgroup v2 interface intentionally >>

[PATCH] cgroup: Add cgroupstats numbers to cgroup.stat file

2020-09-15 Thread Chengming Zhou
add these cgroupstats numbers to the cgroup.stat file, and change the admin-guide doc accordingly. Reported-by: Daowen Luo Tested-by: Chengming Zhou Signed-off-by: Muchun Song Signed-off-by: Chengming Zhou --- Documentation/admin-guide/cgroup-v2.rst | 15 ++ kernel/cgrou

Re: [Phishing Risk] [External] Re: [PATCH] taskstats: fix CGROUPSTATS_CMD_GET for cgroup v2

2020-09-14 Thread Chengming Zhou
在 2020/9/10 下午10:32, Tejun Heo 写道: > On Thu, Sep 10, 2020 at 01:52:07PM +0800, Chengming Zhou wrote: >> We found cgroupstats_build would return -EINVAL when using netlink >> CGROUPSTATS_CMD_GET interface to get stats on cgroup v2. Fix it by >> supporting cgroup v

[PATCH] taskstats: fix CGROUPSTATS_CMD_GET for cgroup v2

2020-09-09 Thread Chengming Zhou
: Chengming Zhou Signed-off-by: Chengming Zhou --- kernel/cgroup/cgroup-internal.h | 1 + kernel/cgroup/cgroup-v1.c | 5 +++-- kernel/cgroup/cgroup.c | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/cgroup/cgroup-internal.h b/kernel/cgroup/cgroup-internal.h

[PATCH] iocost: Only inc nr_shortages when have io waited

2020-08-01 Thread Chengming Zhou
The last else branch of current code may have not io waited in iocg, in which case we should not inc nr_shortages, or the device vrate will speed up even this iocg is not shortage of vtime. Signed-off-by: Chengming Zhou --- block/blk-iocost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [External] Re: [PATCH 1/2] ftrace: clear module from hash of all ftrace ops

2020-07-30 Thread Chengming Zhou
在 2020/7/29 上午1:26, Steven Rostedt 写道: > On Wed, 29 Jul 2020 00:59:33 +0800 > Chengming Zhou wrote: > > >>> i.e. >>> >>> # echo some_module_function > set_ftrace_filter >>> # rmmod module_with_that_function >>> # insmo

[PATCH] iocost_monitor: start from the oldest usage index

2020-07-30 Thread Chengming Zhou
iocg usage_idx is the latest usage index, we should start from the oldest usage index to show the consecutive NR_USAGE_SLOTS usages. Signed-off-by: Chengming Zhou --- tools/cgroup/iocost_monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cgroup

[PATCH] iocost: Fix check condition of iocg abs_vdebt

2020-07-30 Thread Chengming Zhou
We shouldn't skip iocg when its abs_vdebt is not zero. Fixes: 0b80f9866e6b ("iocost: protect iocg->abs_vdebt with iocg->waitq.lock") Signed-off-by: Chengming Zhou --- block/blk-iocost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-iocost.c

[PATCH 2/2] ftrace: skip special ftrace_ops when enable module

2020-07-28 Thread Chengming Zhou
, in which case we can use trampoline as an optimization. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/trace/ftrace.c | 8 1 file changed, 8 insertions(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a3d141f53c9e..8c1d9e3daa67 100644 --- a

[PATCH 1/2] ftrace: setup correct FTRACE_FL_REGS flags for module

2020-07-28 Thread Chengming Zhou
has FTRACE_OPS_FL_SAVE_REGS to be called with pt_regs set to NULL. So setup correct FTRACE_FL_REGS flags for rec when we call referenced_filters to find ftrace_ops references it. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/trace/ftrace.c | 11 +++ 1 file changed

Re: [External] Re: [PATCH 2/2] ftrace: setup correct flags before replace code of module rec

2020-07-28 Thread Chengming Zhou
在 2020/7/28 下午9:02, Steven Rostedt 写道: > On Tue, 28 Jul 2020 18:27:20 +0800 > Chengming Zhou wrote: > >> When module loaded and enabled, we will use __ftrace_replace_code >> for module if any ftrace_ops referenced it found. But we will get >> wrong ft

Re: [External] Re: [PATCH 1/2] ftrace: clear module from hash of all ftrace ops

2020-07-28 Thread Chengming Zhou
在 2020/7/28 下午8:53, Steven Rostedt 写道: On Tue, 28 Jul 2020 18:27:19 +0800 Chengming Zhou wrote: We should clear module from hash of all ops on ftrace_ops_list when module going, or the ops including these modules will be matched wrongly by new module loaded later. This is really up to the

[PATCH 1/2] ftrace: clear module from hash of all ftrace ops

2020-07-28 Thread Chengming Zhou
We should clear module from hash of all ops on ftrace_ops_list when module going, or the ops including these modules will be matched wrongly by new module loaded later. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/trace/ftrace.c | 22 -- 1 file

[PATCH 2/2] ftrace: setup correct flags before replace code of module rec

2020-07-28 Thread Chengming Zhou
ilters to find ftrace_ops references it. Signed-off-by: Chengming Zhou Signed-off-by: Muchun Song --- kernel/trace/ftrace.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index fca01a168ae5..00087dea0174 100644