linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Frederic Weisbecker <frederic@kernel.org>,
	Nitesh Narayan Lal <nitesh@redhat.com>,
	Peter Xu <peterx@redhat.com>, Oleg Nesterov <oleg@redhat.com>
Subject: Re: [patch 2/2] nohz: change signal tick dependency to wakeup CPUs of member tasks
Date: Thu, 8 Oct 2020 14:35:44 +0200	[thread overview]
Message-ID: <20201008123544.GX2628@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201007180229.765691166@redhat.com>

On Wed, Oct 07, 2020 at 03:01:53PM -0300, Marcelo Tosatti wrote:
> Rather than waking up all nohz_full CPUs on the system, only wakeup 
> the target CPUs of member threads of the signal.
> 
> Reduces interruptions to nohz_full CPUs.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> 
> Index: linux-2.6/kernel/time/tick-sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/time/tick-sched.c
> +++ linux-2.6/kernel/time/tick-sched.c
> @@ -398,7 +398,15 @@ EXPORT_SYMBOL_GPL(tick_nohz_dep_clear_ta
>   */
>  void tick_nohz_dep_set_signal(struct signal_struct *sig, enum tick_dep_bits bit)
>  {
> -	tick_nohz_dep_set_all(&sig->tick_dep_mask, bit);
> +	int prev;
> +
> +	prev = atomic_fetch_or(BIT(bit), &sig->tick_dep_mask);
> +	if (!prev) {
> +		rcu_read_lock();
> +		for_each_thread(sig, t)
> +			tick_nohz_kick_task(t);
> +		rcu_read_unlock();
> +	}
>  }

AFAICT, and this makes perfect sense, this function is only ever used
while holding sighand->siglock, which makes the RCU read lock
superfluous.

Would it make sense to change the signal_struct argument to task_struct,
such that we can write:

	lockdep_assert_held(&p->sighand->siglock);
	for_each_thread(p->signal, t)
		tick_nohz_kick_task(t);

?


  reply	other threads:[~2020-10-08 12:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 18:01 [patch 0/2] nohz_full: only wakeup target CPUs when notifying new tick dependency (v2) Marcelo Tosatti
2020-10-07 18:01 ` [patch 1/2] nohz: only wakeup a single target cpu when kicking a task Marcelo Tosatti
2020-10-08 12:22   ` Peter Zijlstra
2020-10-08 17:54     ` Marcelo Tosatti
2020-10-08 19:54       ` Frederic Weisbecker
2020-10-13 17:13         ` Marcelo Tosatti
2020-10-14  8:33           ` Peter Zijlstra
2020-10-14 23:40             ` Frederic Weisbecker
2020-10-15 10:12               ` Peter Zijlstra
2020-10-26 14:42                 ` Frederic Weisbecker
2020-10-20 18:52               ` Marcelo Tosatti
2020-10-22 12:53                 ` Frederic Weisbecker
2020-10-08 14:59   ` Peter Xu
2020-10-08 15:28     ` Peter Zijlstra
2020-10-08 19:16       ` Peter Xu
2020-10-08 19:48       ` Frederic Weisbecker
2020-10-08 17:43     ` Marcelo Tosatti
2020-10-07 18:01 ` [patch 2/2] nohz: change signal tick dependency to wakeup CPUs of member tasks Marcelo Tosatti
2020-10-08 12:35   ` Peter Zijlstra [this message]
2020-10-08 18:04     ` Marcelo Tosatti
2020-10-08 19:11 [patch 0/2] nohz_full: only wakeup target CPUs when notifying new tick dependency (v3) Marcelo Tosatti
2020-10-08 19:11 ` [patch 2/2] nohz: change signal tick dependency to wakeup CPUs of member tasks Marcelo Tosatti

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=20201008123544.GX2628@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=nitesh@redhat.com \
    --cc=oleg@redhat.com \
    --cc=peterx@redhat.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).