lkml.org 
[lkml]   [2022]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] mm/damon: remove dead code in damon_lru_sort_enabled_store()
Date
Hi Zeng,

On Fri, 12 Aug 2022 09:24:59 +0800 Zeng Jingxiang <zengjx95@gmail.com> wrote:

> From: Zeng Jingxiang <linuszeng@tencent.com>
>
> The variable damon_lru_sort_initialized is always true, causing the
> corresponding conditional expression cannot be executed.
>
> Assigning true to damon_lru_sort_initialized here
> 544 damon_lru_sort_initialized = true;

Before the assignment, the variable is set 'false'.

>
> The value of damon_lru_sort_initialized is always true.
> As a result, the following expression cannot be executed.
>
> 463 if (!damon_lru_sort_initialized)
> 464 return rc;

If this code is executed before the assignment, the expression can be executed.

Actually, there was a bug due to the absence of the variable. You may refer to
that for the detail:
https://lore.kernel.org/damon/20220604192222.1488-1-sj@kernel.org/T/#t


Thanks,
SJ

[...]

\
 
 \ /
  Last update: 2022-08-12 03:51    [W:0.031 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site