All of lore.kernel.org
 help / color / mirror / Atom feed
From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
To: Vatika Harlalka <vatikaharlalka@gmail.com>, fweisbec@gmail.com
Cc: mingo@redhat.com, peterz@infradead.org,
	rafael.j.wysocki@intel.com, tglx@linutronix.de,
	schwidefsky@de.ibm.com, paulmck@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org, cl@linux.com, cmetcalf@ezchip.com,
	bitbucket@online.de
Subject: Re: [PATCH RESEND] nohz: Affining unpinned timers
Date: Wed, 24 Jun 2015 12:47:33 +0530	[thread overview]
Message-ID: <558A598D.5080900@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150623083133.GA587@vatika-Inspiron-3443>

On 06/23/2015 02:01 PM, Vatika Harlalka wrote:
> The problem addressed in this patch is about affining unpinned timers.
> Adaptive or Full Dynticks CPUs should not be disturbed by unnecessary
> jitter due to firing of such timers on them.
> This patch will affine timers to online CPUs which are not Full Dynticks
> in FULL_NOHZ configured systems. It will not bring about functional
> changes if NOHZ_FULL is not configured, because is_housekeeping_cpu()
> always returns true in CONFIG_NO_HZ_FULL=n.
> 
> Signed-off by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---

Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>

>  Changes: Patch sent to the right recipients.
> 
>  include/linux/tick.h | 9 ++++++++-
>  kernel/sched/core.c  | 9 +++++++--
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/tick.h b/include/linux/tick.h
> index f8492da5..145bcba 100644
> --- a/include/linux/tick.h
> +++ b/include/linux/tick.h
> @@ -133,13 +133,20 @@ static inline bool tick_nohz_full_cpu(int cpu)
> 
>  	return cpumask_test_cpu(cpu, tick_nohz_full_mask);
>  }
> -
> +static inline int housekeeping_any_cpu(void)
> +{
> +	return cpumask_any_and(housekeeping_mask, cpu_online_mask);
> +}
>  extern void __tick_nohz_full_check(void);
>  extern void tick_nohz_full_kick(void);
>  extern void tick_nohz_full_kick_cpu(int cpu);
>  extern void tick_nohz_full_kick_all(void);
>  extern void __tick_nohz_task_switch(struct task_struct *tsk);
>  #else
> +static inline int housekeeping_any_cpu(void)
> +{
> +	return smp_processor_id();
> +}
>  static inline bool tick_nohz_full_enabled(void) { return false; }
>  static inline bool tick_nohz_full_cpu(int cpu) { return false; }
>  static inline void __tick_nohz_full_check(void) { }
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 57bd333..acee856 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -599,18 +599,23 @@ int get_nohz_timer_target(int pinned)
>  	int i;
>  	struct sched_domain *sd;
> 
> -	if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu))
> +	if (pinned || !get_sysctl_timer_migration() ||
> +		(!idle_cpu(cpu) && is_housekeeping_cpu(cpu)))
>  		return cpu;
> 
>  	rcu_read_lock();
>  	for_each_domain(cpu, sd) {
>  		for_each_cpu(i, sched_domain_span(sd)) {
> -			if (!idle_cpu(i)) {
> +			if (!idle_cpu(i) && is_housekeeping_cpu(cpu)) {
>  				cpu = i;
>  				goto unlock;
>  			}
>  		}
>  	}
> +
> +	if (!is_housekeeping_cpu(cpu))
> +		cpu = housekeeping_any_cpu();
> +
>  unlock:
>  	rcu_read_unlock();
>  	return cpu;
> 


       reply	other threads:[~2015-06-24  7:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150623083133.GA587@vatika-Inspiron-3443>
2015-06-24  7:17 ` Preeti U Murthy [this message]
2015-07-06 16:54 ` [PATCH RESEND] nohz: Affining unpinned timers Frederic Weisbecker
2015-07-06 17:18   ` Thomas Gleixner
2015-07-06 22:49     ` Frederic Weisbecker
2015-07-07  6:39       ` Thomas Gleixner
2015-08-02  9:35         ` Vatika Harlalka
2015-08-03 14:52           ` Frederic Weisbecker

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=558A598D.5080900@linux.vnet.ibm.com \
    --to=preeti@linux.vnet.ibm.com \
    --cc=bitbucket@online.de \
    --cc=cl@linux.com \
    --cc=cmetcalf@ezchip.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vatikaharlalka@gmail.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 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.