[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170413.105103.1861501727952285713.davem@davemloft.net>
Date: Thu, 13 Apr 2017 10:51:03 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: tglx@...utronix.de
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
mingo@...nel.org, bigeasy@...utronix.de, benh@...nel.crashing.org,
fenghua.yu@...el.com, herbert@...dor.apana.org.au,
jiangshanlai@...il.com, lenb@...nel.org, mpe@...erman.id.au,
rjw@...ysocki.net, tj@...nel.org, tony.luck@...el.com,
viresh.kumar@...aro.org, linux-crypto@...r.kernel.org
Subject: Re: [patch V2 13/13] crypto: n2 - Replace racy task affinity logic
From: Thomas Gleixner <tglx@...utronix.de>
Date: Thu, 13 Apr 2017 10:20:23 +0200 (CEST)
> spu_queue_register() needs to invoke setup functions on a particular
> CPU. This is achieved by temporarily setting the affinity of the
> calling user space thread to the requested CPU and reset it to the original
> affinity afterwards.
>
> That's racy vs. CPU hotplug and concurrent affinity settings for that
> thread resulting in code executing on the wrong CPU and overwriting the
> new affinity setting.
>
> Replace it by using work_on_cpu_safe() which guarantees to run the code on
> the requested CPU or to fail in case the CPU is offline.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Acked-by: Herbert Xu <herbert@...dor.apana.org.au>
Acked-by: David S. Miller <davem@...emloft.net>
Powered by blists - more mailing lists