lkml.org 
[lkml]   [2021]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH cgroup/for-5.14-fixes] cgroup: rstat: fix A-A deadlock on 32bit around u64_stats_sync
On Tue, Jul 27, 2021 at 01:04:49PM -1000, Tejun Heo wrote:
> 0fa294fb1985 ("cgroup: Replace cgroup_rstat_mutex with a spinlock") added
> cgroup_rstat_flush_irqsafe() allowing flushing to happen from the irq
> context. However, rstat paths use u64_stats_sync to synchronize access to
> 64bit stat counters on 32bit machines. u64_stats_sync is implemented using
> seq_lock and trying to read from an irq context can lead to A-A deadlock if
> the irq happens to interrupt the stat update.
>
> Fix it by using the irqsafe variants - u64_stats_update_begin_irqsave() and
> u64_stats_update_end_irqrestore() - in the update paths. Note that none of
> this matters on 64bit machines. All these are just for 32bit SMP setups.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Rik van Riel <riel@surriel.com>

Applying this to cgroup/for-5.14-fixes with stable tag added.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2021-07-28 01:14    [W:0.121 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site