Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>, Ye Liu <ye.liu@linux.dev>
Cc: Ye Liu <liuye@kylinos.cn>,
	Naoya Horiguchi <nao.horiguchi@gmail.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mm/memory-failure: use bool for forcekill state
Date: Sat, 9 May 2026 10:28:53 +0800	[thread overview]
Message-ID: <ec25f11a-7107-4fd7-cc9e-768387da6fd2@huawei.com> (raw)
In-Reply-To: <20260508170854.a845bd71e7ebd5d2f6927fcb@linux-foundation.org>

On 2026/5/9 8:08, Andrew Morton wrote:
> On Fri, 10 Apr 2026 14:45:47 +0800 Miaohe Lin <linmiaohe@huawei.com> wrote:
> 
>> On 2026/4/7 10:07, Ye Liu wrote:
>>> From: Ye Liu <liuye@kylinos.cn>
>>>
>>> 'forcekill' is used as a boolean flag to control whether
>>> processes should be forcibly killed. It is only assigned
>>> from boolean expressions and never used in arithmetic or
>>> bitmask operations.
>>>
>>> Convert it from int to bool.
>>>
>>> No functional change intended.
>>>
>>> Signed-off-by: Ye Liu <liuye@kylinos.cn>
>>> ---
>>>  mm/memory-failure.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>>> index d25adb390c3e..f355642bc2b6 100644
>>> --- a/mm/memory-failure.c
>>> +++ b/mm/memory-failure.c
>>> @@ -459,7 +459,7 @@ void add_to_kill_ksm(struct task_struct *tsk, const struct page *p,
>>>   * Only do anything when FORCEKILL is set, otherwise just free the
>>>   * list (this is used for clean pages which do not need killing)
>>>   */
>>> -static void kill_procs(struct list_head *to_kill, int forcekill,
>>> +static void kill_procs(struct list_head *to_kill, bool forcekill,
>>>  		unsigned long pfn, int flags)
>>>  {
>>>  	struct to_kill *tk, *next;
>>> @@ -1582,7 +1582,7 @@ static bool hwpoison_user_mappings(struct folio *folio, struct page *p,
>>>  {
>>>  	LIST_HEAD(tokill);
>>>  	bool unmap_success;
>>> -	int forcekill;
>>> +	bool forcekill;
>>>  	bool mlocked = folio_test_mlocked(folio);
>>
>> There is one caller in unmap_and_kill():
>> 	kill_procs(to_kill, flags & MF_MUST_KILL, pfn, flags);
>>
>> It seems flags & MF_MUST_KILL does not return bool. So maybe we should change it
>> to clear semantic conversion?
> 
> AI review was wondering the same thing ;) And possibly a changelog
> glitch.
> 
> 	https://sashiko.dev/#/patchset/20260407020715.2269255-2-ye.liu@linux.dev

Thanks Andrew. I see there is a v2 patch [1] that has used a boolean expression to
align with the commit's stated intent as AI requested. I guess you might missed that
thread.

[1] https://lore.kernel.org/all/20260410074740.2524718-1-ye.liu@linux.dev/

Thanks.
.

> 
> .
> 



      reply	other threads:[~2026-05-09  2:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260407020715.2269255-1-ye.liu@linux.dev>
2026-04-07  2:07 ` [PATCH 1/2] mm/memory_failure: use bool for hugetlb indicator in try_memory_failure_hugetlb Ye Liu
2026-04-10  6:38   ` Miaohe Lin
2026-05-06  3:22     ` Ye Liu
2026-04-07  2:07 ` [PATCH 2/2] mm/memory-failure: use bool for forcekill state Ye Liu
2026-04-10  6:45   ` Miaohe Lin
2026-04-10  7:17     ` Ye Liu
2026-05-09  0:08     ` Andrew Morton
2026-05-09  2:28       ` Miaohe Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec25f11a-7107-4fd7-cc9e-768387da6fd2@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuye@kylinos.cn \
    --cc=nao.horiguchi@gmail.com \
    --cc=ye.liu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox