linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wanpeng Li <kernellwp@gmail.com>
To: Wanpeng Li <wanpeng.li@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@arm.com>,
	Kirill Tkhai <ktkhai@parallels.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sched/deadline: reduce overhead if there are no scheduling parameters changed
Date: Wed, 19 Nov 2014 20:28:45 +0800	[thread overview]
Message-ID: <546C8CFD.2060200@gmail.com> (raw)
In-Reply-To: <1416391297-111305-1-git-send-email-wanpeng.li@linux.intel.com>

Sorry to send out a duplicated patchset, please ignore this one.
On 11/19/14, 6:01 PM, Wanpeng Li wrote:
> There is no need to dequeue/enqueue and push/pull if there are
> no scheduling parameters changed for dl class, actually both
> fair and rt class have already check if parameters changed for
> them to avoid unnecessary overhead. This patch add the parameters
> changed verify for dl class in order to reduce overhead.
>
> Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
> ---
>   kernel/sched/core.c | 17 ++++++++++++++++-
>   1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 603c462..f361867 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3402,6 +3402,21 @@ static bool check_same_owner(struct task_struct *p)
>   	return match;
>   }
>   
> +static bool dl_param_changed(struct task_struct *p,
> +			const struct sched_attr *attr)
> +{
> +	struct sched_dl_entity *dl_se = &p->dl;
> +
> +	if (dl_se->dl_runtime != attr->sched_runtime ||
> +		dl_se->dl_deadline != attr->sched_deadline ||
> +		dl_se->dl_period != attr->sched_period ||
> +		dl_se->flags != attr->sched_flags ||
> +		p->rt_priority != attr->sched_priority)
> +		return true;
> +
> +	return false;
> +}
> +
>   static int __sched_setscheduler(struct task_struct *p,
>   				const struct sched_attr *attr,
>   				bool user)
> @@ -3530,7 +3545,7 @@ recheck:
>   			goto change;
>   		if (rt_policy(policy) && attr->sched_priority != p->rt_priority)
>   			goto change;
> -		if (dl_policy(policy))
> +		if (dl_policy(policy) && dl_param_changed(p, attr))
>   			goto change;
>   
>   		p->sched_reset_on_fork = reset_on_fork;


  parent reply	other threads:[~2014-11-19 12:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 10:01 [PATCH 1/2] sched/deadline: reduce overhead if there are no scheduling parameters changed Wanpeng Li
2014-11-19 10:01 ` [PATCH 2/2] sched/deadline: fix pull if dl task who's prio changed is not on queue Wanpeng Li
2014-11-19 12:28 ` Wanpeng Li [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-19  8:35 [PATCH 1/2] sched/deadline: reduce overhead if there are no scheduling parameters changed Wanpeng Li
2014-11-25 17:49 ` Juri Lelli

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=546C8CFD.2060200@gmail.com \
    --to=kernellwp@gmail.com \
    --cc=juri.lelli@arm.com \
    --cc=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wanpeng.li@linux.intel.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;
as well as URLs for NNTP newsgroup(s).