From: Wanpeng Li <kernellwp@gmail.com>
To: "pang.xunlei" <pang.xunlei@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Steven Rostedt <rostedt@goodmis.org>,
Juri Lelli <juri.lelli@gmail.com>
Subject: Re: [PATCH v2 5/6] sched/dl: Optimize select_task_rq_dl() for non-DL curr task
Date: Wed, 05 Nov 2014 07:30:40 +0800 [thread overview]
Message-ID: <545961A0.8010000@gmail.com> (raw)
In-Reply-To: <CADcy93XJB_DtZzBR3YmxRmj4qTuf0EvupjbcfosPimGFOmx3bA@mail.gmail.com>
Hi Xunlei,
On 14/11/4 下午10:19, pang.xunlei wrote:
> On 4 November 2014 19:24, Wanpeng Li <kernellwp@gmail.com> wrote:
>> On 14/11/4 下午7:13, pang.xunlei wrote:
>>> When selecting the cpu for a waking DL task, if curr is a non-DL
>>> task which is bound only on this cpu, then we can give it a chance
>>> to select a different cpu for this DL task to avoid curr starving.
>>>
>>> Signed-off-by: pang.xunlei <pang.xunlei@linaro.org>
>>> ---
>>> kernel/sched/deadline.c | 14 ++++++++++----
>>> 1 file changed, 10 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>>> index 7b0b2d2..1f64d4a 100644
>>> --- a/kernel/sched/deadline.c
>>> +++ b/kernel/sched/deadline.c
>>> @@ -954,6 +954,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int
>>> sd_flag, int flags)
>>> struct task_struct *curr;
>>> struct rq *rq;
>>> + if (p->nr_cpus_allowed == 1)
>>> + goto out;
>>> +
>>> if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
>>> goto out;
>>
>> I don't think you use right branch of tip tree.
> Hi Wanpeng, I'm using linux-3.18-rc3 as the base, does this have
> something wrong? please point me out if any.
I have already do this, my patch merged in tip tree, you can check it.
Regards,
Wanpeng Li
> Thanks!
>> Regards,
>> Wanpeng Li
>>
>>> @@ -970,11 +973,14 @@ select_task_rq_dl(struct task_struct *p, int cpu,
>>> int sd_flag, int flags)
>>> * can!) we prefer to send it somewhere else. On the
>>> * other hand, if it has a shorter deadline, we
>>> * try to make it stay here, it might be important.
>>> + *
>>> + * If the current task on @p's runqueue is a non-DL task,
>>> + * and this task is bound on current runqueue, then try to
>>> + * see if we can wake this DL task up on a different runqueue,
>>> */
>>> - if (unlikely(dl_task(curr)) &&
>>> - (curr->nr_cpus_allowed < 2 ||
>>> - !dl_entity_preempt(&p->dl, &curr->dl)) &&
>>> - (p->nr_cpus_allowed > 1)) {
>>> + if (unlikely(curr->nr_cpus_allowed < 2) ||
>>> + unlikely(dl_task(curr) &&
>>> + !dl_entity_preempt(&p->dl, &curr->dl))) {
>>> int target = find_later_rq(p);
>>> if (target != -1)
>>
next prev parent reply other threads:[~2014-11-04 23:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 11:13 [PATCH v2 1/6] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases pang.xunlei
2014-11-04 11:13 ` [PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task pang.xunlei
2014-11-04 12:52 ` Steven Rostedt
2014-11-04 14:29 ` pang.xunlei
2014-11-04 14:47 ` Steven Rostedt
2014-11-04 15:09 ` pang.xunlei
2014-11-04 11:13 ` [PATCH v2 3/6] sched/cpupri: Remove unnecessary definitions in cpupri.h pang.xunlei
2014-11-04 14:39 ` Steven Rostedt
2014-11-04 11:13 ` [PATCH v2 4/6] sched/dl: Modify cpudl_find() for more cases of electing best_cpu pang.xunlei
2014-11-04 11:13 ` [PATCH v2 5/6] sched/dl: Optimize select_task_rq_dl() for non-DL curr task pang.xunlei
2014-11-04 11:24 ` Wanpeng Li
2014-11-04 14:19 ` pang.xunlei
2014-11-04 23:30 ` Wanpeng Li [this message]
2014-11-04 14:45 ` Steven Rostedt
2014-11-04 15:11 ` Peter Zijlstra
2014-11-04 23:33 ` Wanpeng Li
2014-11-04 11:13 ` [PATCH v2 6/6] sched/dl: Remove unnecessary definitions in cpudeadline.h pang.xunlei
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=545961A0.8010000@gmail.com \
--to=kernellwp@gmail.com \
--cc=juri.lelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pang.xunlei@linaro.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.