lkml.org 
[lkml]   [2023]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] blk-stat: fix QUEUE_FLAG_STATS clear
On Thu, Apr 13, 2023 at 12:07:53AM +0800, chengming.zhou@linux.dev wrote:
> From: Chengming Zhou <zhouchengming@bytedance.com>
>
> We need to set QUEUE_FLAG_STATS for two cases:
> 1. blk_stat_enable_accounting()
> 2. blk_stat_add_callback()
>
> So we should clear it only when ((q->stats->accounting == 0) &&
> list_empty(&q->stats->callbacks)).
>
> blk_stat_disable_accounting() only check if q->stats->accounting
> is 0 before clear the flag, this patch fix it.
>
> Also add list_empty(&q->stats->callbacks)) check when enable, or
> the flag is already set.
>
> Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>

Acked-by: Tejun Heo <tj@kernel.org>

It'd be useful to explicitly illustrate the buggy behavior in the
description (e.g. if you do X, Y and then Z, then X incorrectly loses
accounting). Can you also please add the appropriate stable cc?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2023-04-12 19:13    [W:0.038 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site