[PATCH V2 1/1] sched/fair:Reduce unnecessary check preempt in the sched tick

2021-04-13 Thread qianjun . kernel
From: jun qian As you are already set the TIF_NEED_RESCHED, there is no need to check resched again. Signed-off-by: jun qian --- kernel/sched/fair.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 794c2cb945f8..1a6

[PATCH 1/1] sched/fair:Reduce unnecessary check preempt in the sched tick

2021-04-13 Thread qianjun . kernel
From: jun qian If it has been determined that the current cpu need resched in the early stage of for_each_sched_entity, then there is no need to check preempt in the subsequent se->parent entity_tick. Signed-off-by: jun qian --- kernel/sched/fair.c | 5 + 1 file changed, 5 insertions(+) d

[PATCH V2 1/1] mm:improve the performance during fork

2021-03-29 Thread qianjun . kernel
From: jun qian In our project, Many business delays come from fork, so we started looking for the reason why fork is time-consuming. I used the ftrace with function_graph to trace the fork, found that the vm_normal_page will be called tens of thousands and the execution time of this vm_normal_pag

[PATCH 1/1] sched/fair:Avoid unnecessary assignment to cfs_rq->on_list

2021-01-06 Thread qianjun . kernel
From: jun qian Obviously, cfs_rq->on_list is already equal to 1 when cfs_rq->on_list is assigned a value of 1, so an else branch is needed to avoid unnecessary assignment operations. Signed-off-by: jun qian --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 1/1] mm:improve the performance during fork

2020-12-22 Thread qianjun . kernel
From: jun qian In our project, Many business delays come from fork, so we started looking for the reason why fork is time-consuming. I used the ftrace with function_graph to trace the fork, found that the vm_normal_page will be called tens of thousands and the execution time of this vm_normal_pag

[PATCH 1/1] Sched/fair: Improve the accuracy of sched_stat_wait statistics

2020-10-14 Thread qianjun . kernel
From: jun qian When the sched_schedstat changes from 0 to 1, some sched se maybe already in the runqueue, the se->statistics.wait_start will be 0. So it will let the (rq_of(cfs_rq)) - se->statistics.wait_start) wrong. We need to avoid this scenario. Signed-off-by: jun qian Reviewed-by: Yafang S

[PATCH 1/1] Sched/fair: Improve the accuracy of sched_stat_wait statistics

2020-10-09 Thread qianjun . kernel
From: jun qian When the sched_schedstat changes from 0 to 1, some sched se maybe already in the runqueue, the se->statistics.wait_start will be 0. So it will let the (rq_of(cfs_rq)) - se->statistics.wait_start) wrong. We need to avoid this scenario. Signed-off-by: jun qian Signed-off-by: Yafang

[PATCH 1/1] sched/fair: Fix the wrong sched_stat_wait time

2020-09-29 Thread qianjun . kernel
From: jun qian When the sched_schedstat changes from 0 to 1, some sched se maybe already in the runqueue, the se->statistics.wait_start will be 0. So it will let the (rq_of(cfs_rq)) - se->statistics.wait_start) wrong. We need to avoid this scenario. Signed-off-by: jun qian Signed-off-by: Yafang

[PATCH V7 3/4] softirq: Rewrite softirq processing loop

2020-09-15 Thread qianjun . kernel
From: jun qian Simplify the softirq processing loop by using the bitmap APIs Signed-off-by: jun qian --- kernel/softirq.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 5a627cd..cbb59b5 100644 --- a/kernel/softirq

[PATCH V7 1/4] softirq: Use sched_clock() based timeout

2020-09-15 Thread qianjun . kernel
From: jun qian Replace the jiffies based timeout with a sched_clock() based one. Signed-off-by: jun qian --- kernel/softirq.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index c4201b7f..0db77ab 100644 --- a/kernel/softirq.c +++

[PATCH V7 4/4] softirq: Allow early break the softirq processing loop

2020-09-15 Thread qianjun . kernel
From: jun qian Allow terminating the softirq processing loop without finishing the vectors. Signed-off-by: jun qian --- kernel/softirq.c | 113 --- 1 file changed, 91 insertions(+), 22 deletions(-) diff --git a/kernel/softirq.c b/kernel/soft

[PATCH V7 0/4] Softirq:avoid large sched delay from the pending softirqs

2020-09-15 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process

[PATCH V7 2/4] softirq: Factor loop termination condition

2020-09-15 Thread qianjun . kernel
From: jun qian Add a function interface to end softirq process Signed-off-by: jun qian --- kernel/softirq.c | 44 +--- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 0db77ab..5a627cd 100644 --- a

[PATCH V6 1/1] Softirq:avoid large sched delay from the pending softirqs

2020-09-09 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process

[PATCH 1/1] kernel/sched:use the enum code replace of the int variable

2020-09-07 Thread qianjun . kernel
From: jun qian It is hard to understand what the meaning of the value from the return value of wakeup_preempt_entity, so I fix it. Signed-off-by: jun qian --- kernel/sched/fair.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/kernel/sched/fair.

[PATCH V4] Softirq:avoid large sched delay from the pending softirqs

2020-07-24 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process

[PATCH V3] Softirq:avoid large sched delay from the pending softirqs

2020-07-22 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process

[RFC PATCH v2] Softirq:avoid large sched delay from the pending softirqs

2020-07-20 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process

[RFC PATCH 1/1] Softirq:avoid large sched delay from the pending softirqs

2020-07-16 Thread qianjun . kernel
From: jun qian When get the pending softirqs, it need to process all the pending softirqs in the while loop. If the processing time of each pending softirq is need more than 2 msec in this loop, or one of the softirq will running a long time, according to the original code logic, it will process