[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160315110633.GV6344@twins.programming.kicks-ass.net>
Date: Tue, 15 Mar 2016 12:06:33 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Frédéric Weisbecker <fweisbec@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] atomic: Fix bugs in 'fetch_or()' and rename it to
'xchg_or()'
On Tue, Mar 15, 2016 at 10:32:45AM +0100, Ingo Molnar wrote:
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index 969e6704c3c9..851631899352 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -264,7 +264,7 @@ static void tick_nohz_dep_set_all(unsigned long *dep,
> {
> unsigned long prev;
>
> - prev = fetch_or(dep, BIT_MASK(bit));
> + prev = xchg_or(dep, BIT_MASK(bit));
> if (!prev)
> tick_nohz_full_kick_all();
> }
> @@ -294,7 +294,7 @@ void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit)
>
> ts = per_cpu_ptr(&tick_cpu_sched, cpu);
>
> - prev = fetch_or(&ts->tick_dep_mask, BIT_MASK(bit));
> + prev = xchg_or(&ts->tick_dep_mask, BIT_MASK(bit));
> if (!prev) {
> preempt_disable();
> /* Perf needs local kick that is NMI safe */
Those should probably also use BIT(), BIT_MASK() is specifically for
bitmasks, and should be combined with BIT_WORD().
Powered by blists - more mailing lists