From: Oleg Nesterov <oleg@redhat.com>
To: Frederic Weisbecker <fweisbec@gmail.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: Thu, 2 Apr 2015 20:08:03 +0200 [thread overview]
Message-ID: <20150402180803.GA20608@redhat.com> (raw)
In-Reply-To: <1427996365-12101-3-git-send-email-fweisbec@gmail.com>
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.
Any reason 3/3 comes as a separate change? I won't argue, just curious.
Oleg.
next prev parent reply other threads:[~2015-04-02 18:09 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 [this message]
2015-04-03 17:19 ` Frederic Weisbecker
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=20150402180803.GA20608@redhat.com \
--to=oleg@redhat.com \
--cc=davej@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--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 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.