[PATCH] scripts/checkpatch.pl: fix false warning of externs checking.

2017-10-10 Thread Jiang Biao
When adding a function declaration in a .c file without an extern keywork decoration, checkpatch.pl will complain *externs should be avoided in .c files* false warning. This patch fix the bug. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- scripts/checkpatch.pl | 2 +- 1 file chan

[PATCH] checkpatch: statement should end at a close brace at the outermost level.

2017-10-10 Thread Jiang Biao
to check. 3, The first declaration(foo1()) would not be warned, because the statement does not end at the '}' before it. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/s

[PATCH] mm/vmscan: make do_shrink_slab more robust.

2017-11-26 Thread Jiang Biao
urn negative freeable. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index eb2f031..3ea28f0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -323,7 +323,7 @@ static unsigned long do_sh

[PATCH] fs/mbcache: make count_objects more robust.

2017-11-26 Thread Jiang Biao
accumulation and overflow of total_scan. This patch make sure the mb_cache_count not return negative value, which make the mbcache shrinker more robust. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- fs/mbcache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/mbcache.

[PATCH] mm/vmscan: try to optimize branch procedures.

2017-11-27 Thread Jiang Biao
d == scanned*, next_deferred shoud be 0, which is covered by the else branch. 3. Merge two branch blocks into one. The *next_deferred > 0* branch could be merged into *next_deferred > scanned* to simplify the code. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- mm/vmscan.c

[PATCH] mm/vmscan: change return type of is_page_cache_freeable from int to bool

2017-11-27 Thread Jiang Biao
Using bool for the return type of is_page_cache_freeable() should be more appropriate. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index eb2f031..5fe63ed 100644 --- a/mm/vm

[PATCH v2] mm: fix page_freeze_refs and page_unfreeze_refs in comments.

2018-07-26 Thread Jiang Biao
page_freeze_refs/page_unfreeze_refs have already been relplaced by page_ref_freeze/page_ref_unfreeze , but they are not modified in the comments. Signed-off-by: Jiang Biao --- v1: fix comments in vmscan. v2: fix other two places and fix typoes. mm/ksm.c| 4 ++-- mm/memory-failure.c

[PATCH] mm/vmscan: fix page_freeze_refs in comment.

2018-07-25 Thread Jiang Biao
page_freeze_refs has already been relplaced by page_ref_freeze, but it is not modified in the comment. Signed-off-by: Jiang Biao --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 03822f8..d29e207 100644 --- a/mm/vmscan.c +++ b/mm

[PATCH v4 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-19 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff

[PATCH v4 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-19 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c

[PATCH v3 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-17 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[PATCH v3 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-17 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c

[PATCH] x86/speculation: remove SPECTRE_V2_IBRS in enum spectre_v2_mitigation

2018-07-17 Thread Jiang Biao
SPECTRE_V2_IBRS in enum spectre_v2_mitigation is never used, remove it to avoid confusing. Signed-off-by: Jiang Biao --- arch/x86/include/asm/nospec-branch.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index

[PATCH 4/5] x86/pti: warn for unknown pti boot options

2018-07-15 Thread Jiang Biao
When using unknown pti boot options other than on/off/auto, we select auto silently, which is sometimes confusing. Add warning for unknown pti boot options like we do in spectre_v2_select_mitigation(). Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 +- 1 file changed, 5 insertions

[PATCH 5/5] x86/pti: constify address parameters

2018-07-15 Thread Jiang Biao
Addresses passed in pti_user_pagetable_walk_*() are not supposed to change at runtime, make them const to aviod future slipups. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index

[PATCH 2/5] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-15 Thread Jiang Biao
pti_user_pagetable_walk_pmd() may return NULL, we should check the return value in pti_user_pagetable_walk_pte() to avoid NULL pointer dereference like it is checked in pti_clone_pmds(). Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH 1/5] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-15 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 4d418e7

[PATCH 3/5] x86/pti: make pti_set_kernel_image_nonglobal static

2018-07-15 Thread Jiang Biao
pti_set_kernel_image_nonglobal() is only used in pti.c, make it static. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index bb6f608..a76b2cc 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86

[PATCH v2 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-17 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index

[PATCH v2 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-17 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH 0/5] x86/pti: small fixes and cleanups for pti

2018-07-15 Thread Jiang Biao
This is a short series of fixes and cleanups found when reading the code, no functional changes. Jiang Biao (5): x86/pti: check the return value of pti_user_pagetable_walk_p4d x86/pti: check the return value of pti_user_pagetable_walk_pmd x86/pti: make pti_set_kernel_image_nonglobal static

[PATCH] blkcg: not hold blkcg lock when deactivating policy.

2018-04-17 Thread Jiang Biao
in blkcg_deactivate_policy(). Similar case is in blkcg_activate_policy(), which has removed holding of blkcg lock in commit 4c55f4f9ad3001ac1fefdd8d8ca7641d18558e23. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> Signed-off-by: Wen Yang <wen.yan...@zte.com.cn> CC: Tejun Heo <t...@kerne

[PATCH 1/2] blkcg: small fix on comment in blkcg_init_queue

2018-04-18 Thread Jiang Biao
The comment before blkg_create() in blkcg_init_queue() was moved from blkcg_activate_policy() by commit ec13b1d6f0a0457312e615, but it does not suit for the new context. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> Signed-off-by: Wen Yang <wen.yan...@zte.com.cn> CC:

[PATCH 2/2] blkcg: init root blkcg_gq under lock

2018-04-18 Thread Jiang Biao
ock and rcu to make it safer. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> Signed-off-by: Wen Yang <wen.yan...@zte.com.cn> CC: Tejun Heo <t...@kernel.org> CC: Jens Axboe <ax...@kernel.dk> --- block/blk-cgroup.c | 17 +++-- 1 file changed, 11 insertions(+),

[PATCH] fs/ubifs: constify struct ubifs_lprops in scan_for_leb_for_idx

2018-02-27 Thread Jiang Biao
Constify struct ubifs_lprops in scan_for_leb_for_idx to be consistent with other references. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- fs/ubifs/find.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index 2dcf3d4..9571616

[PATCH] fs/ubifs: remove useless parameter of lpt_heap_replace

2018-02-27 Thread Jiang Biao
The parameter *old_lprops* is never used in lpt_heap_replace(), remove it to avoid compile warning. Signed-off-by: Jiang Biao <jiang.bi...@zte.com.cn> --- fs/ubifs/lprops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index 6

[PATCH] checkpatch: statement should end at a close brace at the outermost level.

2017-10-10 Thread Jiang Biao
to check. 3, The first declaration(foo1()) would not be warned, because the statement does not end at the '}' before it. Signed-off-by: Jiang Biao --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262

[PATCH] mm/vmscan: try to optimize branch procedures.

2017-11-27 Thread Jiang Biao
d == scanned*, next_deferred shoud be 0, which is covered by the else branch. 3. Merge two branch blocks into one. The *next_deferred > 0* branch could be merged into *next_deferred > scanned* to simplify the code. Signed-off-by: Jiang Biao --- mm/vmscan.c | 10 -- 1 file changed,

[PATCH] mm/vmscan: change return type of is_page_cache_freeable from int to bool

2017-11-27 Thread Jiang Biao
Using bool for the return type of is_page_cache_freeable() should be more appropriate. Signed-off-by: Jiang Biao --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index eb2f031..5fe63ed 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c

[PATCH] blkcg: not hold blkcg lock when deactivating policy.

2018-04-17 Thread Jiang Biao
in blkcg_deactivate_policy(). Similar case is in blkcg_activate_policy(), which has removed holding of blkcg lock in commit 4c55f4f9ad3001ac1fefdd8d8ca7641d18558e23. Signed-off-by: Jiang Biao Signed-off-by: Wen Yang CC: Tejun Heo CC: Jens Axboe --- block/blk-cgroup.c | 5 - 1 file changed, 5

[PATCH 1/2] blkcg: small fix on comment in blkcg_init_queue

2018-04-18 Thread Jiang Biao
The comment before blkg_create() in blkcg_init_queue() was moved from blkcg_activate_policy() by commit ec13b1d6f0a0457312e615, but it does not suit for the new context. Signed-off-by: Jiang Biao Signed-off-by: Wen Yang CC: Tejun Heo CC: Jens Axboe --- block/blk-cgroup.c | 6 +- 1 file

[PATCH 2/2] blkcg: init root blkcg_gq under lock

2018-04-18 Thread Jiang Biao
ock and rcu to make it safer. Signed-off-by: Jiang Biao Signed-off-by: Wen Yang CC: Tejun Heo CC: Jens Axboe --- block/blk-cgroup.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 07e3359..ec86837 100644 --- a/block/

[PATCH] fs/ubifs: constify struct ubifs_lprops in scan_for_leb_for_idx

2018-02-27 Thread Jiang Biao
Constify struct ubifs_lprops in scan_for_leb_for_idx to be consistent with other references. Signed-off-by: Jiang Biao --- fs/ubifs/find.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index 2dcf3d4..9571616 100644 --- a/fs/ubifs/find.c

[PATCH] fs/ubifs: remove useless parameter of lpt_heap_replace

2018-02-27 Thread Jiang Biao
The parameter *old_lprops* is never used in lpt_heap_replace(), remove it to avoid compile warning. Signed-off-by: Jiang Biao --- fs/ubifs/lprops.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c index 6c3a1ab..f5a4684 100644 --- a/fs

[PATCH] mm/vmscan: make do_shrink_slab more robust.

2017-11-26 Thread Jiang Biao
urn negative freeable. Signed-off-by: Jiang Biao --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index eb2f031..3ea28f0 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -323,7 +323,7 @@ static unsigned long do_shrink_slab(struct shrink_cont

[PATCH] fs/mbcache: make count_objects more robust.

2017-11-26 Thread Jiang Biao
accumulation and overflow of total_scan. This patch make sure the mb_cache_count not return negative value, which make the mbcache shrinker more robust. Signed-off-by: Jiang Biao --- fs/mbcache.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/mbcache.c b/fs/mbcache.c index d818fd2..b8b8b9c

[PATCH] scripts/checkpatch.pl: fix false warning of externs checking.

2017-10-10 Thread Jiang Biao
When adding a function declaration in a .c file without an extern keywork decoration, checkpatch.pl will complain *externs should be avoided in .c files* false warning. This patch fix the bug. Signed-off-by: Jiang Biao --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] sched/fair: Trivial fix for comment of check_preempt_tick

2021-01-16 Thread Jiang Biao
From: Jiang Biao check_preempt_tick() is not just for newly woken task preemption, and check_preempt_wakeup() is instead. The current comment of check_preempt_tick() is a little confusing. Signed-off-by: Jiang Biao --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] sched/fair: add protection for delta of wait time

2021-01-18 Thread Jiang Biao
Hi, Vincent On Mon, 18 Jan 2021 at 23:32, Vincent Guittot wrote: > > On Mon, 18 Jan 2021 at 15:11, Jiang Biao wrote: > > > > Hi, Vincent > > > > On Mon, 18 Jan 2021 at 15:56, Vincent Guittot > > wrote: > > > > > > On Sun, 17 Jan 2021 at

Re: [PATCH] sched/fair: add protection for delta of wait time

2021-01-18 Thread Jiang Biao
Hi, Vincent On Mon, 18 Jan 2021 at 15:56, Vincent Guittot wrote: > > On Sun, 17 Jan 2021 at 13:31, Jiang Biao wrote: > > > > From: Jiang Biao > > > > delta in update_stats_wait_end() might be negative, which would > > make following statistics go wrong.

[PATCH] Documentation: Fix typos found in cgroup-v2.rst

2021-01-07 Thread Jiang Biao
From: Jiang Biao Fix typos found in Documentation/admin-guide/cgroup-v2.rst. Signed-off-by: Jiang Biao --- Documentation/admin-guide/cgroup-v2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide

[PATCH] sched/fair: add protection for delta of wait time

2021-01-17 Thread Jiang Biao
From: Jiang Biao delta in update_stats_wait_end() might be negative, which would make following statistics go wrong. Add protection for delta of wait time, like what have been done in update_stats_enqueue_sleeper() for deltas of sleep/block time. Signed-off-by: Jiang Biao --- kernel/sched

[PATCH RFC] sched/fair: simplfy the work when reweighting entity

2020-08-04 Thread Jiang Biao
be helpful for the hot path. Signed-off-by: Jiang Biao --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 04fa8dbcfa4d..18a8fc7bd0de 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3086,7 +3086,7

[PATCH] sched/fair: Optimize dequeue_task_fair()

2020-08-11 Thread Jiang Biao
the if(!se) statment as se is always NULL when reaching this point. Besides, trying to keep the same pattern with enqueue_task_fair can make it more readable. Signed-off-by: Jiang Biao --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b

[PATCH v3] sched/fair: simplfy the work when reweighting entity

2020-08-11 Thread Jiang Biao
From: Jiang Biao The code in reweight_entity() can be simplified. For a sched entity on the rq, the entity accounting can be replaced by cfs_rq instantaneous load updates currently called from within the entity accounting. Even though an entity on the rq can't represent a task

Re: [PATCH] driver/pci: reduce the single block time in pci_read_config

2020-09-16 Thread Jiang Biao
Hi, On Thu, 17 Sep 2020 at 00:56, Bjorn Helgaas wrote: > > On Sun, Sep 13, 2020 at 12:27:09PM +0800, Jiang Biao wrote: > > On Thu, 10 Sep 2020 at 09:59, Bjorn Helgaas wrote: > > > On Thu, Sep 10, 2020 at 09:54:02AM +0800, Jiang Biao wrote: > > > > On Thu, 10

Re: [PATCH] driver/pci: reduce the single block time in pci_read_config

2020-08-27 Thread Jiang Biao
kindly ping :) On Mon, 24 Aug 2020 at 13:20, Jiang Biao wrote: > > From: Jiang Biao > > pci_read_config() could block several ms in kernel space, mainly > caused by the while loop to call pci_user_read_config_dword(). > Singel pci_user_read_config_dword() loop c

Re: [PATCH] driver/pci: reduce the single block time in pci_read_config

2020-09-09 Thread Jiang Biao
Hi, On Thu, 10 Sep 2020 at 09:25, Bjorn Helgaas wrote: > > On Mon, Aug 24, 2020 at 01:20:25PM +0800, Jiang Biao wrote: > > From: Jiang Biao > > > > pci_read_config() could block several ms in kernel space, mainly > > caused by the while loop to call pci_user_r

Re: [PATCH] driver/pci: reduce the single block time in pci_read_config

2020-09-09 Thread Jiang Biao
Hi, On Thu, 10 Sep 2020 at 09:59, Bjorn Helgaas wrote: > > On Thu, Sep 10, 2020 at 09:54:02AM +0800, Jiang Biao wrote: > > Hi, > > > > On Thu, 10 Sep 2020 at 09:25, Bjorn Helgaas wrote: > > > > > > On Mon, Aug 24, 2020 at 01:20:25PM +0800,

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-09-01 Thread Jiang Biao
Hi, Vincent Sorry for the late reply.:) On Fri, 28 Aug 2020 at 20:55, Vincent Guittot wrote: > > On Sun, 23 Aug 2020 at 09:33, Jiang Biao wrote: > > > > Hi, Vincent and Peter > > > > On Thu, 20 Aug 2020 at 22:09, Vincent Guittot > > wrote: > > &g

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-09-01 Thread Jiang Biao
Hi, On Tue, 1 Sep 2020 at 21:04, Vincent Guittot wrote: > > On Tue, 1 Sep 2020 at 12:15, Jiang Biao wrote: > > > > Hi, Vincent > > > > Sorry for the late reply.:) > > > > On Fri, 28 Aug 2020 at 20:55, Vincent Guittot > > wrote: > > &

[PATCH] sched/fair: reduce preemption with IDLE tasks runable

2020-07-31 Thread Jiang Biao
From: Jiang Biao No need to preempt when there are only one runable CFS task with other IDLE tasks on runqueue. The only one CFS task would always be picked in that case. Signed-off-by: Jiang Biao --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-08-23 Thread Jiang Biao
Hi, Vincent and Peter On Thu, 20 Aug 2020 at 22:09, Vincent Guittot wrote: > > On Thu, 20 Aug 2020 at 15:44, wrote: > > > > > That's been said, not compensating the vruntime for a sched_idle task > > > makes sense for me. Even if that will only help for others task in the > > > same cfs_rq > >

[PATCH] driver/pci: reduce the single block time in pci_read_config

2020-08-23 Thread Jiang Biao
From: Jiang Biao pci_read_config() could block several ms in kernel space, mainly caused by the while loop to call pci_user_read_config_dword(). Singel pci_user_read_config_dword() loop could consume 130us+, |pci_user_read_config_dword

Re: [RFC PATCH v1 1/1] sched/fair: select idle cpu from idle cpumask in sched domain

2020-09-12 Thread Jiang Biao
Hi, Aubrey On Fri, 11 Sep 2020 at 23:48, Aubrey Li wrote: > > Added idle cpumask to track idle cpus in sched domain. When a CPU > enters idle, its corresponding bit in the idle cpumask will be set, > and when the CPU exits idle, its bit will be cleared. > > When a task wakes up to select an idle

Re: [PATCH] driver/pci: reduce the single block time in pci_read_config

2020-09-12 Thread Jiang Biao
Hi, Bjorn On Thu, 10 Sep 2020 at 09:59, Bjorn Helgaas wrote: > > On Thu, Sep 10, 2020 at 09:54:02AM +0800, Jiang Biao wrote: > > Hi, > > > > On Thu, 10 Sep 2020 at 09:25, Bjorn Helgaas wrote: > > > > > > On Mon, Aug 24, 2020 at 01:20:25PM +0800,

Re: [RFC PATCH v1 1/1] sched/fair: select idle cpu from idle cpumask in sched domain

2020-09-15 Thread Jiang Biao
Hi, Vincent On Mon, 14 Sep 2020 at 20:26, Vincent Guittot wrote: > > On Sun, 13 Sep 2020 at 05:59, Jiang Biao wrote: > > > > Hi, Aubrey > > > > On Fri, 11 Sep 2020 at 23:48, Aubrey Li wrote: > > > > > > Added idle cpumask to track idle cpus in

Re: [PATCH 4/4] sched/fair: reduce busy load balance interval

2020-09-15 Thread Jiang Biao
Hi, Vincent On Mon, 14 Sep 2020 at 18:07, Vincent Guittot wrote: > > The busy_factor, which increases load balance interval when a cpu is busy, > is set to 32 by default. This value generates some huge LB interval on > large system like the THX2 made of 2 node x 28 cores x 4 threads. > For such

Re: [PATCH 4/4] sched/fair: reduce busy load balance interval

2020-09-15 Thread Jiang Biao
Hi, Vincent On Tue, 15 Sep 2020 at 17:28, Vincent Guittot wrote: > > On Tue, 15 Sep 2020 at 11:11, Jiang Biao wrote: > > > > Hi, Vincent > > > > On Mon, 14 Sep 2020 at 18:07, Vincent Guittot > > wrote: > > > > > > The busy_factor, wh

Re: [PATCH 4/4] sched/fair: reduce busy load balance interval

2020-09-15 Thread Jiang Biao
Hi, On Tue, 15 Sep 2020 at 20:43, Vincent Guittot wrote: > > On Tue, 15 Sep 2020 at 13:36, Jiang Biao wrote: > > > > Hi, Vincent > > > > On Tue, 15 Sep 2020 at 17:28, Vincent Guittot > > wrote: > > > > > > On Tue, 15 Sep 2020 at

Re: [PATCH] sched/fair: Fix wrong cpu selecting from isolated domain

2020-08-25 Thread Jiang Biao
p->cpus_ptr)) > + if (!cpumask_test_cpu(cpu, p->cpus_ptr) || > + !cpumask_test_cpu(cpu, sched_domain_span(sd))) Maybe the following change could be better, :) for_each_cpu_and(cpu, cpu_smt_mask(target), sched_domain_span(sd)) keep a similar style with select_idle_core/cpu, and could reduce loops. Just an option. Reviewed-by: Jiang Biao

Re: [PATCH] sched/fair: Fix wrong cpu selecting from isolated domain

2020-08-25 Thread Jiang Biao
On Tue, 25 Aug 2020 at 17:28, xunlei wrote: > > On 2020/8/25 下午2:37, Jiang Biao wrote: > > On Mon, 24 Aug 2020 at 20:31, Xunlei Pang wrote: > >> > >> We've met problems that occasionally tasks with full cpumask > >> (e.g. by putting it into a cpuset

[PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-08-20 Thread Jiang Biao
From: Jiang Biao Vruntime compensation has been down in place_entity() to boot the waking procedure for fair tasks. There is no need to do that for SCHED_IDLE task actually. Not compensating vruntime for SCHED_IDLE task could make SCHED_IDLE task more harmless for normal tasks. Signed-off

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-08-20 Thread Jiang Biao
On Thu, 20 Aug 2020 at 20:51, Vincent Guittot wrote: > > On Thu, 20 Aug 2020 at 14:00, Jiang Biao wrote: > > > > From: Jiang Biao > > > > Vruntime compensation has been down in place_entity() to > > boot the waking procedure for fair tasks. There i

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-08-20 Thread Jiang Biao
On Thu, 20 Aug 2020 at 20:58, wrote: > > On Thu, Aug 20, 2020 at 02:51:06PM +0200, Vincent Guittot wrote: > > On Thu, 20 Aug 2020 at 14:00, Jiang Biao wrote: > > > > > > From: Jiang Biao > > > > > > Vruntime compensation has been down in p

Re: [PATCH] sched/fair: avoid vruntime compensation for SCHED_IDLE task

2020-08-20 Thread Jiang Biao
On Thu, 20 Aug 2020 at 22:09, Vincent Guittot wrote: > > On Thu, 20 Aug 2020 at 15:44, wrote: > > > > > That's been said, not compensating the vruntime for a sched_idle task > > > makes sense for me. Even if that will only help for others task in the > > > same cfs_rq > > > > Yeah, but it is

Re: [PATCH] sched/fair: reduce preemption with IDLE tasks runable(Internet mail)

2020-08-20 Thread Jiang Biao
gt;>>> wrote: > > >>>>>>>>>>> > > >>>>>>>>>>> On 12/08/2020 05:19, benbjiang(蒋彪) wrote: > > >>>>>>>>>>>> Hi, > > >>>>>>>&

Re: [PATCH] sched/fair: reduce preemption with IDLE tasks runable(Internet mail)

2020-08-20 Thread Jiang Biao
On Thu, 20 Aug 2020 at 22:36, Vincent Guittot wrote: > > On Thu, 20 Aug 2020 at 16:28, Jiang Biao wrote: > > > > On Thu, 20 Aug 2020 at 20:46, Vincent Guittot > > wrote: > > > > > > On Thu, 20 Aug 2020 at 13:28, benbjiang(蒋彪) wrote: > > > >

[PATCH RFC v2] sched/fair: simplify the work when reweighting entity

2020-08-06 Thread Jiang Biao
From: Jiang Biao If a se is on_rq when reweighting entity, all we need should be updating the load of cfs_rq, other dequeue/enqueue work could be redundant, such as, * nr_running--/nr_running++ Even though the following dequeue/enqueue path would never be reached * account_numa_dequeue

Re: [PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks

2021-02-03 Thread Jiang Biao
Hi, On Wed, 3 Feb 2021 at 19:17, chin wrote: > > > > > At 2021-02-02 23:54:15, "Vincent Guittot" wrote: > >On Tue, 2 Feb 2021 at 08:56, chin wrote: > >> > >> > >> > >> > >> At 2021-01-13 16:30:14, "Vincent Guittot" > >> wrote: > >> >On Wed, 13 Jan 2021 at 04:14, chin wrote: > >> >> > >> >>

Re: [PATCH] sched: pull tasks when CPU is about to run SCHED_IDLE tasks

2021-02-04 Thread Jiang Biao
Hi, Vincent On Thu, 4 Feb 2021 at 16:04, Vincent Guittot wrote: > > On Tue, 2 Feb 2021 at 08:56, chin wrote: > > > > > > > > > > At 2021-01-13 16:30:14, "Vincent Guittot" > > wrote: > > >On Wed, 13 Jan 2021 at 04:14, chin wrote: > > >> > > >> > > >> > > >> > > >> At 2021-01-12 16:18:51,

[PATCH] sched/fair: consider sched-idle CPU when selecting idle core

2020-07-23 Thread Jiang Biao
From: Jiang Biao Sched-idle CPU has been considered in select_idle_cpu and select_idle_smt, it also needs to be considered in select_idle_core to be consistent and keep the same *idle* policy. Signed-off-by: Jiang Biao --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH] sched/fair: consider sched-idle CPU when selecting idle core

2020-07-24 Thread Jiang Biao
On Fri, 24 Jul 2020 at 15:24, Vincent Guittot wrote: > > On Fri, 24 Jul 2020 at 01:39, Jiang Biao wrote: > > > > From: Jiang Biao > > > > Sched-idle CPU has been considered in select_idle_cpu and > > select_idle_smt, it also needs to be considered in s

Re: [PATCH] sched/fair: consider sched-idle CPU when selecting idle core

2020-07-24 Thread Jiang Biao
On Fri, 24 Jul 2020 at 18:34, Vincent Guittot wrote: > > On Fri, 24 Jul 2020 at 10:12, Jiang Biao wrote: > > > > On Fri, 24 Jul 2020 at 15:24, Vincent Guittot > > wrote: > > > > > > On Fri, 24 Jul 2020 at 01:39, Jiang Biao wrote: > > > > &g

Re: [RFC PATCH 09/16] sched/fair: core wide cfs task priority comparison(Internet mail)

2020-07-24 Thread Jiang Biao
On Fri, 24 Jul 2020 at 15:17, Aaron Lu wrote: > > On Wed, Jul 22, 2020 at 12:23:44AM +, benbjiang(蒋彪) wrote: > > > > > > > +/* > > > + * This function takes care of adjusting the min_vruntime of siblings of > > > + * a core during coresched enable/disable. > > > + * This is called in stop

Re: [PATCH] sched/fair: consider sched-idle CPU when selecting idle core

2020-07-24 Thread Jiang Biao
On Fri, 24 Jul 2020 at 20:36, Ingo Molnar wrote: > > > * Jiang Biao wrote: > > > On Fri, 24 Jul 2020 at 18:34, Vincent Guittot > > wrote: > > > > > > On Fri, 24 Jul 2020 at 10:12, Jiang Biao wrote: > > > > > > >

[PATCH v2 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-17 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index

[PATCH v2 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-17 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH v3 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-17 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff

[PATCH v3 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-17 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c

[PATCH] x86/speculation: remove SPECTRE_V2_IBRS in enum spectre_v2_mitigation

2018-07-17 Thread Jiang Biao
SPECTRE_V2_IBRS in enum spectre_v2_mitigation is never used, remove it to avoid confusing. Signed-off-by: Jiang Biao --- arch/x86/include/asm/nospec-branch.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index

[PATCH] asm/irq_vector.h: fix outdated comments

2019-04-21 Thread Jiang Biao
ut the comments here are outdated, update them. Signed-off-by: Jiang Biao --- arch/x86/include/asm/irq_vectors.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 548d90bbf919..889f8b1b5b7f 100644 --

[PATCH] rcu/tree_exp: cleanup initialized but not used rdp

2019-04-22 Thread Jiang Biao
rdp is initialized but never used in synchronize_rcu_expedited(), just remove it. Signed-off-by: Jiang Biao --- kernel/rcu/tree_exp.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h index 4c2a0189e748..5772612379e4 100644 --- a/kernel/rcu

[PATCH] rcu/srcutree: make __call_srcu static

2019-04-22 Thread Jiang Biao
__call_srcu() is only used in current file, just make it static. Signed-off-by: Jiang Biao --- kernel/rcu/srcutree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index a60b8ba9e1ac..a2ade0c6cd87 100644 --- a/kernel/rcu

[PATCH] kvm_main: fix some comments

2019-04-23 Thread Jiang Biao
is_dirty has been rename to flush, but the comment for it is outdated. And the description about @flush parameter for kvm_clear_dirty_log_protect() is missing, add it in this patch also. Signed-off-by: Jiang Biao --- virt/kvm/kvm_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v2] kvm_main: fix some comments

2019-04-23 Thread Jiang Biao
is_dirty has been renamed to flush, but the comment for it is outdated. And the description about @flush parameter for kvm_clear_dirty_log_protect() is missing, add it in this patch as well. Signed-off-by: Jiang Biao --- virt/kvm/kvm_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH] fs/quota: erase unused but set variable warning

2019-04-23 Thread Jiang Biao
-off-by: Jiang Biao --- fs/quota/dquot.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index fc20e06c56ba..14ee4c6deba1 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1049,7 +1049,9 @@ static void remove_dquot_ref(struct super_block *sb, int

[PATCH] mm/vmscan: fix page_freeze_refs in comment.

2018-07-25 Thread Jiang Biao
page_freeze_refs has already been relplaced by page_ref_freeze, but it is not modified in the comment. Signed-off-by: Jiang Biao --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 03822f8..d29e207 100644 --- a/mm/vmscan.c +++ b/mm

[PATCH v2] mm: fix page_freeze_refs and page_unfreeze_refs in comments.

2018-07-26 Thread Jiang Biao
page_freeze_refs/page_unfreeze_refs have already been relplaced by page_ref_freeze/page_ref_unfreeze , but they are not modified in the comments. Signed-off-by: Jiang Biao --- v1: fix comments in vmscan. v2: fix other two places and fix typoes. mm/ksm.c| 4 ++-- mm/memory-failure.c

[PATCH v4 2/2] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-19 Thread Jiang Biao
Check the return value of pti_user_pagetable_walk_pmd() to avoid NULL pointer dereference. And add warning for fail allocation. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c

[PATCH v4 1/2] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-19 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. And add warning for fail allocation where NULL returned. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff

[PATCH 0/5] x86/pti: small fixes and cleanups for pti

2018-07-15 Thread Jiang Biao
This is a short series of fixes and cleanups found when reading the code, no functional changes. Jiang Biao (5): x86/pti: check the return value of pti_user_pagetable_walk_p4d x86/pti: check the return value of pti_user_pagetable_walk_pmd x86/pti: make pti_set_kernel_image_nonglobal static

[PATCH 5/5] x86/pti: constify address parameters

2018-07-15 Thread Jiang Biao
Addresses passed in pti_user_pagetable_walk_*() are not supposed to change at runtime, make them const to aviod future slipups. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index

[PATCH 2/5] x86/pti: check the return value of pti_user_pagetable_walk_pmd

2018-07-15 Thread Jiang Biao
pti_user_pagetable_walk_pmd() may return NULL, we should check the return value in pti_user_pagetable_walk_pte() to avoid NULL pointer dereference like it is checked in pti_clone_pmds(). Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH 1/5] x86/pti: check the return value of pti_user_pagetable_walk_p4d

2018-07-15 Thread Jiang Biao
pti_user_pagetable_walk_p4d() may return NULL, we should check the return value to avoid NULL pointer dereference. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 4d418e7

[PATCH 3/5] x86/pti: make pti_set_kernel_image_nonglobal static

2018-07-15 Thread Jiang Biao
pti_set_kernel_image_nonglobal() is only used in pti.c, make it static. Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index bb6f608..a76b2cc 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86

[PATCH 4/5] x86/pti: warn for unknown pti boot options

2018-07-15 Thread Jiang Biao
When using unknown pti boot options other than on/off/auto, we select auto silently, which is sometimes confusing. Add warning for unknown pti boot options like we do in spectre_v2_select_mitigation(). Signed-off-by: Jiang Biao --- arch/x86/mm/pti.c | 10 +- 1 file changed, 5 insertions

[PATCH] mm/vmstat.c: erase latency in vmstat_shepherd

2021-01-10 Thread Jiang Biao
From: Jiang Biao Many 100us+ latencies have been deteceted in vmstat_shepherd() on CPX platform which has 208 logic cpus. And vmstat_shepherd is queued every second, which could make the case worse. Add schedule point in vmstat_shepherd() to erase the latency. Signed-off-by: Jiang Biao

[PATCH] mm/oom_kill: fix wild pointer in out_of_memory

2021-03-12 Thread Jiang Biao
en before calling oom_evaluate_task. Signed-off-by: Bin Lai Reviewed-by: Jiang Biao diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 9efaf43..0658a30 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -366,6 +366,7 @@ static int oom_evaluate_task(struct task_struct *task, void *arg) st

[tip:x86/pti] x86/pti: Check the return value of pti_user_pagetable_walk_p4d()

2018-07-19 Thread tip-bot for Jiang Biao
Commit-ID: b2b7d986a89b6c94b1331a909de1217214fb08c1 Gitweb: https://git.kernel.org/tip/b2b7d986a89b6c94b1331a909de1217214fb08c1 Author: Jiang Biao AuthorDate: Fri, 20 Jul 2018 08:06:31 +0800 Committer: Thomas Gleixner CommitDate: Fri, 20 Jul 2018 07:07:39 +0200 x86/pti: Check

  1   2   >