[PATCH v3] checkpatch: ignore warning designated initializers using NR_CPUS

2020-12-30 Thread Peng Wang
n_seq_show, .write = cpuset_write_resmask, .max_write_len = (100U + 6 * NR_CPUS), .private = FILE_CPULIST, }, ... } Signed-off-by: Peng Wang --- scripts/checkpatch.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2] checkpatch: ignore warning designated initializers using NR_CPUS

2020-12-29 Thread Peng Wang
n_seq_show, .write = cpuset_write_resmask, .max_write_len = (100U + 6 * NR_CPUS), .private = FILE_CPULIST, }, ... } Signed-off-by: Peng Wang --- scripts/checkpatch.pl | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] checkpatch: ignore warning designated initializers using NR_CPUS

2020-12-29 Thread Peng Wang
Hi, Joe On 12/30/20 1:35 PM, , Joe Perches wrote: On Wed, 2020-12-30 at 12:13 +0800, Peng Wang wrote: Some max_length wants to hold as large room as possible to ensure enough size to tackle with the biggest NR_CPUS. As an example below: kernel/cgroup/cpuset.c: static struct cftype

[PATCH] checkpatch: ignore warning designated initializers using NR_CPUS

2020-12-29 Thread Peng Wang
n_seq_show, .write = cpuset_write_resmask, .max_write_len = (100U + 6 * NR_CPUS), .private = FILE_CPULIST, }, ... } Signed-off-by: Peng Wang --- scripts/checkpatch.pl | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[tip: sched/core] sched/fair: Reorder throttle_cfs_rq() path

2020-11-10 Thread tip-bot2 for Peng Wang
The following commit has been merged into the sched/core branch of tip: Commit-ID: b6d37a764a5b852db63101b3f2db0e699574b903 Gitweb: https://git.kernel.org/tip/b6d37a764a5b852db63101b3f2db0e699574b903 Author:Peng Wang AuthorDate:Tue, 10 Nov 2020 10:11:59 +08:00 Committer

[PATCH] sched/fair: Reorder throttle_cfs_rq() path

2020-11-09 Thread Peng Wang
As commit 39f23ce07b93 ("sched/fair: Fix unthrottle_cfs_rq() for leaf_cfs_rq list") does in unthrottle_cfs_rq(), throttle_cfs_rq() can also use the same pattern as dequeue_task_fair(). There is no functional changes. Signed-off-by: Peng Wang --- kernel/sched/f

[tip: sched/core] sched/fair: Optimize dequeue_task_fair()

2020-06-25 Thread tip-bot2 for Peng Wang
The following commit has been merged into the sched/core branch of tip: Commit-ID: 423d02e1463b21109106f52d94f7396b63731f3b Gitweb: https://git.kernel.org/tip/423d02e1463b21109106f52d94f7396b63731f3b Author:Peng Wang AuthorDate:Tue, 16 Jun 2020 14:04:07 +08:00 Committer

Re: [PATCH] sched/fair: Optimize dequeue_task_fair()

2020-06-16 Thread Peng Wang
On 6/15/20 11:09 PM, Vincent Guittot wrote: On Mon, 15 Jun 2020 at 16:20, Peng Wang wrote: While looking at enqueue_task_fair and dequeue_task_fair, it occurred to me that dequeue_task_fair can also be optimized as Vincent described in commit 7d148be69e3a ("sched/fair: Opt

[PATCH v2] sched/fair: Optimize dequeue_task_fair()

2020-06-16 Thread Peng Wang
ensure se not to be NULL, and rq->nr_running remains unchanged, so we can also skip the early balance check. Signed-off-by: Peng Wang --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cbcb2f7..05242b7 100644

[PATCH] sched/fair: Optimize dequeue_task_fair()

2020-06-15 Thread Peng Wang
NULL when reaching root level. Signed-off-by: Peng Wang --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index cbcb2f7..e6be952 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5614,10 +5614,10 @@ s

[tip: sched/core] sched/fair: Simplify the code of should_we_balance()

2020-05-01 Thread tip-bot2 for Peng Wang
The following commit has been merged into the sched/core branch of tip: Commit-ID: 64297f2b03cc7a6d0184a435f1b296beca1bedd1 Gitweb: https://git.kernel.org/tip/64297f2b03cc7a6d0184a435f1b296beca1bedd1 Author:Peng Wang AuthorDate:Sat, 11 Apr 2020 17:20:20 +08:00 Committer

[PATCH] cgroup: remove early strstrip in cgroup_threads_write

2019-07-24 Thread Peng Wang
cgroup_procs_write_start() will process leading and trailing whitespace when necessary. Signed-off-by: Peng Wang --- kernel/cgroup/cgroup.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 753afbca549f..49f2b133cf67 100644 --- a/kernel

[PATCH] cgroup: remove redundant assignment in while loop of cgroup_calc_subtree_ss_mask()

2019-07-22 Thread Peng Wang
new_ss_mask is always not less than cur_ss_mask. We don not need to update it with cur_ss_mask's value. Signed-off-by: Peng Wang --- kernel/cgroup/cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 300b0c416341

RE: [PATCH] cgroup: simplify code for cgroup_subtree_control_write()

2019-07-08 Thread Peng Wang
On Monday, July 8, 2019 10:41 PM, Tejun Heo wrote: > On Mon, Jul 08, 2019 at 09:01:32PM +0800, Peng Wang wrote: > > Process "enable" and "disable" earlier to simplify code. > > I don't think this is correct and even if it were the value of this > change is c

[PATCH v2] kernfs: fix potential null pointer dereference

2019-07-08 Thread Peng Wang
Get root safely after kn is ensureed to be not null. Signed-off-by: Peng Wang --- fs/kernfs/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index a387534c9577..ddf537923a0a 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -430,7

[PATCH] cgroup: simplify code for cgroup_subtree_control_write()

2019-07-08 Thread Peng Wang
Process "enable" and "disable" earlier to simplify code. Signed-off-by: Peng Wang --- kernel/cgroup/cgroup.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index bf9dbffd46b1.

[PATCH] kernfs: fix potential null pointer dereference

2019-07-05 Thread Peng Wang
Get root safely after kn is ensureed to be not null. Signed-off-by: Peng Wang --- fs/kernfs/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index a387534c9577..ea3fc972c48b 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -430,7

[PATCH] cgroup: minor tweak for logic to get cgroup css

2019-07-02 Thread Peng Wang
We could only handle the case that css exists and css_try_get_online() fails. Signed-off-by: Peng Wang --- kernel/cgroup/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index bf9dbffd46b1..a988d77f6c6d 100644

[PATCH] cgroup: provide a macro helper to iterate a cgroup's ancestors

2019-06-27 Thread Peng Wang
Use for_each_ancestor macro to iterate a cgroup's ancestors for clarity. Signed-off-by: Peng Wang --- include/linux/cgroup.h | 11 +++ kernel/cgroup/cgroup.c | 7 +++ kernel/cgroup/freezer.c | 2 +- kernel/cgroup/rstat.c | 4 ++-- 4 files changed, 17 insertions(+), 7

[PATCH] locking/rwsem: save unnecessary rwsem_set_owner() after slow path

2019-06-13 Thread Peng Wang
rwsem_down_write_failed() and rwsem_down_write_failed_killable() return with sem->owner set if acquire semaphore successfully, so we can skip rwsem_set_owner() to keep pace with reading. Signed-off-by: Peng Wang --- kernel/locking/rwsem.h | 9 ++--- 1 file changed, 6 insertions(+)

[PATCH] block: use KMEM_CACHE macro

2019-05-27 Thread Peng Wang
Use the preferred KMEM_CACHE helper for brevity. Signed-off-by: Peng Wang --- block/blk-core.c | 3 +-- block/blk-ioc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 1bf83a0df0f6..841bf0b12755 100644 --- a/block/blk-core.c

[PATCH] fs/epoll: remove an unnecessary argument of ep_busy_loop()

2019-03-08 Thread Peng Wang
When ep_busy_loop() is called, timed_out is always zero, otherwise ep_poll() would return first. Signed-off-by: Peng Wang --- fs/eventpoll.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index a5d219d920e7..0b3981ffc7ae 100644

RE: [PATCH] mm/slub.c: re-randomize random_seq if necessary

2019-01-09 Thread Peng Wang
On Wednesday, January 9, 2019 8:14 PM, Matthew Wilcox wrote: > On Wed, Jan 09, 2019 at 05:06:27PM +0800, Peng Wang wrote: > > calculate_sizes() could be called in several places > > like (red_zone/poison/order/store_user)_store() while > > random_seq remains unchanged.

[PATCH] mm/slub.c: re-randomize random_seq if necessary

2019-01-09 Thread Peng Wang
calculate_sizes() could be called in several places like (red_zone/poison/order/store_user)_store() while random_seq remains unchanged. If random_seq is not NULL in calculate_sizes(), re-randomize it. Signed-off-by: Peng Wang --- mm/slub.c | 9 + 1 file changed, 9 insertions(+) diff

[PATCH] mm/slub.c: keep red_left_pad being zero without SLAB_RED_ZONE flag

2019-01-04 Thread Peng Wang
It seems more clear for red_left_pad to be zero despite not being used without SLAB_RED_ZONE flag. Signed-off-by: Peng Wang --- mm/slub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/slub.c b/mm/slub.c index 36c0befeebd8..9d16ca30bc2a 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3603,6

[PATCH] mm/slub.c: freelist is ensured to be NULL when new_slab() fails

2018-12-28 Thread Peng Wang
new_slab_objects() will return immediately if freelist is not NULL. if (freelist) return freelist; One more assignment operation could be avoided. Signed-off-by: Peng Wang --- mm/slub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/slub.c b

[PATCH] bitmap: Add bitmap_valloc(), bitmap_vzalloc() and bitmap_vfree()

2018-12-27 Thread Peng Wang
Introduce bitmap alloc/free helpers when contiguous memory is not necessary. Signed-off-by: Peng Wang --- include/linux/bitmap.h | 3 +++ lib/bitmap.c | 19 +++ 2 files changed, 22 insertions(+) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index

[PATCH] cgroup: remove unused member "cgrp_ancestor_id_storage" in struct cgroup_root

2018-11-26 Thread Peng Wang
"cgrp_ancestor_id_storage" is not used, so let's clean it up. Signed-off-by: Peng Wang --- include/linux/cgroup-defs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 5e1694fe035b..639a96576ef3 100644 --- a/inc

[PATCH] cgroup: remove unused member "cgrp_ancestor_id_storage" in struct cgroup_root

2018-11-26 Thread Peng Wang
"cgrp_ancestor_id_storage" is not used, so let's clean it up. Signed-off-by: Peng Wang --- include/linux/cgroup-defs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 5e1694fe035b..639a96576ef3 100644 --- a/inc

[PATCH v4] pstore: Avoid duplicate call of persistent_ram_zap()

2018-10-30 Thread Peng Wang
e. We can avoid this by adding an option to persistent_ram_new(), and only call persistent_ram_zap() when it is needed. Signed-off-by: Peng Wang --- fs/pstore/ram.c| 4 +--- fs/pstore/ram_core.c | 5 +++-- include/linux/pstore_ram.h | 1 + 3 files changed, 5 insertions(+), 5 deletions

[PATCH v4] pstore: Avoid duplicate call of persistent_ram_zap()

2018-10-30 Thread Peng Wang
e. We can avoid this by adding an option to persistent_ram_new(), and only call persistent_ram_zap() when it is needed. Signed-off-by: Peng Wang --- fs/pstore/ram.c| 4 +--- fs/pstore/ram_core.c | 5 +++-- include/linux/pstore_ram.h | 1 + 3 files changed, 5 insertions(+), 5 deletions

[PATCH] pstore: Remove duplicate invoking of persistent_ram_zap()

2018-10-25 Thread Peng Wang
e. We can avoid this by removing it in ramoops_init_prz(), and only call it in persistent_ram_post_init(). Signed-off-by: Peng Wang --- fs/pstore/ram.c | 2 -- fs/pstore/ram_core.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index f

[PATCH] pstore: Remove duplicate invoking of persistent_ram_zap()

2018-10-25 Thread Peng Wang
e. We can avoid this by removing it in ramoops_init_prz(), and only call it in persistent_ram_post_init(). Signed-off-by: Peng Wang --- fs/pstore/ram.c | 2 -- fs/pstore/ram_core.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index f