From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87A0E2BE034 for ; Fri, 10 Apr 2026 07:17:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775805468; cv=none; b=br0OpyO5iXCqa2Ob6/Xe0JeoSYZRocjjH6NiyfQwPDbLIHctqWZJYuFAJHNfNayXDc8i7TjobYTuLVkXeWksQLcXeouOOpk95wABd2RQZ+FPAH6bjC8AybE9wZVM1GXuajUKbpTw2Mc5/DD0Drq4avuT2E6kkgvD4MoVeLnEZJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775805468; c=relaxed/simple; bh=hXQh72uNk5G9MHZlA/F0CJzZ6Jxdh98lM24SQgBsYKU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=l9/MzRNlo+3EIrH78Jo9IOvv0Q3HAfBMw+xiCblvBW9QBJQgd1onVd9moSyOHmbcbBA3Q+iYE0vG7tKkTHTUc+lkwkvQ9L3RD7lU8RLXjvrkUJfUWvhokGiscJBx1hQav1hMi6jT43PPoVqLw9S0k1QgBNMnzK+qRtY6zT9JtZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=E1VJ/tmS; arc=none smtp.client-ip=95.215.58.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="E1VJ/tmS" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775805464; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fWKfH5LNOJyUga0sR6g+VdsEMxO3kMazl+w2D/Y3Rqk=; b=E1VJ/tmSviqsUJtDxGPUfKi0RzYBX1JFt/7M57jV48fftEn31ROpg2k6hQ66n5T6br4DtQ ciWa+ZN5SikxIisQX93J1p5NLbkwL6xrQiATxs44kUQMnIc/+dk1JMER7r94EgjIC6hwzu AqmLjU4FyFEs5b+cKh5KRvMDemGRVLs= Date: Fri, 10 Apr 2026 15:17:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH 2/2] mm/memory-failure: use bool for forcekill state To: Miaohe Lin Cc: Ye Liu , Naoya Horiguchi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton References: <20260407020715.2269255-1-ye.liu@linux.dev> <20260407020715.2269255-3-ye.liu@linux.dev> <9d022499-2a77-f8c6-b86d-d9de838fac32@huawei.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ye Liu In-Reply-To: <9d022499-2a77-f8c6-b86d-d9de838fac32@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2026/4/10 14:45, Miaohe Lin 写道: > On 2026/4/7 10:07, Ye Liu wrote: >> From: Ye Liu >> >> '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 >> --- >> 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? > Thanks, that's a good point. While the current call relies on the implicit scalar-to-bool conversion, making it explicit at the call site better reflects the intent of this bool conversion cleanup. I'll switch it to `!!(flags & MF_MUST_KILL)` in v2 for clarity. Appreciate the review. > Thanks. > . -- Thanks, Ye Liu