public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Jones <davej@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Ingo Molnar <mingo@kernel.org>, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH 2/3] context_tracking: Inherit TIF_NOHZ through forks instead of context switches
Date: Fri, 3 Apr 2015 19:19:48 +0200	[thread overview]
Message-ID: <20150403171946.GA13598@lerouge> (raw)
In-Reply-To: <20150402180803.GA20608@redhat.com>

On Thu, Apr 02, 2015 at 08:08:03PM +0200, Oleg Nesterov wrote:
> On 04/02, Frederic Weisbecker wrote:
> >
> > +void context_tracking_cpu_set(int cpu)
> >  {
> > -	clear_tsk_thread_flag(prev, TIF_NOHZ);
> > -	set_tsk_thread_flag(next, TIF_NOHZ);
> > +	static bool initialized = false;
> > +	struct task_struct *p, *t;
> > +	unsigned long flags;
> > +
> > +	if (!per_cpu(context_tracking.active, cpu)) {
> > +		per_cpu(context_tracking.active, cpu) = true;
> > +		static_key_slow_inc(&context_tracking_enabled);
> > +	}
> > +
> > +	if (initialized)
> > +		return;
> > +
> > +	set_tsk_thread_flag(&init_task, TIF_NOHZ);
> > +
> > +	/*
> > +	 * There shouldn't be any thread at this early boot stage
> > +	 * but the scheduler is ready to host any. So lets walk
> > +	 * the tasklist  just in case. tasklist_lock isn't necessary
> > +	 * either that early but take it for correctness checkers.
> > +	 */
> > +	read_lock_irqsave(&tasklist_lock, flags);
> > +	for_each_process_thread(p, t)
> > +		set_tsk_thread_flag(t, TIF_NOHZ);
> > +	read_unlock_irqrestore(&tasklist_lock, flags);
> > +
> > +	initialized = true;
> >  }
> 
> Agreed, but _irqsave is not needed. read_lock(tasklist) should work
> just fine.

Indeed, that was just in case we get more callers but then if it happens,
it's their responsibility to fix the callee. So I'll just change that.

> 
> Any reason 3/3 comes as a separate change? I won't argue, just curious.

Nope, I should fold them indeed.

Thanks.

> 
> Oleg.
> 

  reply	other threads:[~2015-04-03 17:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 17:39 [PATCH 0/3] context_tracking: A few improvements Frederic Weisbecker
2015-04-02 17:39 ` [PATCH 1/3] context_tracking: Protect against recursion Frederic Weisbecker
2015-04-02 18:01   ` Rik van Riel
2015-04-02 17:39 ` [PATCH 2/3] context_tracking: Inherit TIF_NOHZ through forks instead of context switches Frederic Weisbecker
2015-04-02 18:06   ` Rik van Riel
2015-04-02 18:08   ` Oleg Nesterov
2015-04-03 17:19     ` Frederic Weisbecker [this message]
2015-04-02 19:09   ` Peter Zijlstra
2015-04-02 19:11     ` Rik van Riel
2015-04-03 17:21       ` Frederic Weisbecker
2015-04-02 19:19     ` Oleg Nesterov
2015-04-02 17:39 ` [PATCH 3/3] context_tracking: Tag init code Frederic Weisbecker
2015-04-02 18:07   ` Rik van Riel

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=20150403171946.GA13598@lerouge \
    --to=fweisbec@gmail.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=tglx@linutronix.de \
    /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