From: Peter Zijlstra <peterz@infradead.org>
To: chenying <chenying.kernel@bytedance.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, mgorman@suse.de, bristot@redhat.com,
bsegall@google.com, linux-kernel@vger.kernel.org,
duanxiongchun@bytedance.com, zhouchengming@bytedance.com,
songmuchun@bytedance.com, zhengqi.arch@bytedance.com,
zhoufeng.zf@bytedance.com, ligang.bdlg@bytedance.com
Subject: Re: Subject: [PATCH] sched/fair: prioritize normal task over sched_idle task with vruntime offset
Date: Sat, 12 Mar 2022 13:03:09 +0100 [thread overview]
Message-ID: <20220312120309.GB6235@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <f87a8c0d-527d-a9bc-9653-ff955e0e95b4@bytedance.com>
On Fri, Mar 11, 2022 at 03:58:47PM +0800, chenying wrote:
> We add a time offset to the se->vruntime when the idle sched_entity
> is enqueued, so that the idle entity will always be on the right of
> the non-idle in the runqueue. This can allow non-idle tasks to be
> selected and run before the idle.
>
> A use-case is that sched_idle for background tasks and non-idle
> for foreground. The foreground tasks are latency sensitive and do
> not want to be disturbed by the background. It is well known that
> the idle tasks can be preempted by the non-idle tasks when waking up,
> but will not distinguish between idle and non-idle when pick the next
> entity. This may cause background tasks to disturb the foreground.
>
> Test results as below:
>
> ~$ ./loop.sh &
> [1] 764
> ~$ chrt -i 0 ./loop.sh &
> [2] 765
> ~$ taskset -p 04 764
> ~$ taskset -p 04 765
>
> ~$ top -p 764 -p 765
> top - 13:10:01 up 1 min, 2 users, load average: 1.30, 0.38, 0.13
> Tasks: 2 total, 2 running, 0 sleeping, 0 stopped, 0 zombie
> %Cpu(s): 12.5 us, 0.0 sy, 0.0 ni, 87.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0
> st
> KiB Mem : 16393492 total, 16142256 free, 111028 used, 140208 buff/cache
> KiB Swap: 385836 total, 385836 free, 0 used. 16037992 avail Mem
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 764 chenyin+ 20 0 12888 1144 1004 R 100.0 0.0 1:05.12 loop.sh
> 765 chenyin+ 20 0 12888 1224 1080 R 0.0 0.0 0:16.21 loop.sh
>
> The non-idle process (764) can run at 100% and without being disturbed by
> the idle process (765).
Did you just do a very complicated true idle time scheduler, with all
the problems that brings?
next prev parent reply other threads:[~2022-03-12 12:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 7:58 chenying
2022-03-12 12:03 ` Peter Zijlstra [this message]
2022-03-13 5:37 ` [External] " chenying
2022-03-13 9:02 ` Peter Zijlstra
2022-03-13 10:06 ` chenying
2022-03-15 0:30 ` Josh Don
2022-03-15 2:04 ` chenying
2022-03-15 2:21 ` Josh Don
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220312120309.GB6235@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=chenying.kernel@bytedance.com \
--cc=dietmar.eggemann@arm.com \
--cc=duanxiongchun@bytedance.com \
--cc=juri.lelli@redhat.com \
--cc=ligang.bdlg@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=songmuchun@bytedance.com \
--cc=vincent.guittot@linaro.org \
--cc=zhengqi.arch@bytedance.com \
--cc=zhouchengming@bytedance.com \
--cc=zhoufeng.zf@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®