From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout11.his.huawei.com (canpmsgout11.his.huawei.com [113.46.200.226]) (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 A44AEEEBA for ; Fri, 3 Apr 2026 02:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775182777; cv=none; b=kdvn+d32A6FXK7zjoIaE+4AQHr7pbwnxSGwTxGX6CSQELTfW2QIxgtMPIPF1c4XqweA3BIOznGT0suBiJgkhOxQffrwpK6leuKL1bzBdOyw+iPlX6EzWD7RLCeWeoUaick4mTDLp6d7lWrKASL6ox3w4rUxU9Nw+BysgJ5QVlcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775182777; c=relaxed/simple; bh=RcHdSHBhi7Lm4zd0maaF7bXN6Z3EfUOMxQG5t/jRWrk=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=XcpTwmoSoNk5TeOJdteml+kgTex9yxFlpui2tBTcEX6EG0mh63NLOYDH3oWnjIYC6D7m9sNPp7AqiSeX6RDXVRy62SrxLWlVJTGSB4bred56oc9rNaILu/Ftu/kv0qsFC6i7lUhcCHSvZu7HtBPA4+plLTLarf5QHjzgJBk+c7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=jNHl2+Bd; arc=none smtp.client-ip=113.46.200.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="jNHl2+Bd" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=hzPvSN7isY1kE9cnYb/DLvgcN5NUYAmq/V6b22yv7Q4=; b=jNHl2+BdQU0OkIxxaYOCSvztOfahUY+N/DC1EtdCs9TrKzM06bvDffy19mOQO++A7it7lzqAq aQaQfxYtJHfrWEaXUPXdQ/aZizUzzSbpvZxl78MLihcV4UrRSUC0IDnCA8f9iZ9RKO8DDkpgSru eFO0FWYMD+n8rLXQ//v99mk= Received: from mail.maildlp.com (unknown [172.19.163.200]) by canpmsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4fn2M21cL4zKm4q; Fri, 3 Apr 2026 10:13:18 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id EA46A4056A; Fri, 3 Apr 2026 10:19:30 +0800 (CST) Received: from kwepemq500010.china.huawei.com (7.202.194.235) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 3 Apr 2026 10:19:30 +0800 Received: from [10.173.124.160] (10.173.124.160) by kwepemq500010.china.huawei.com (7.202.194.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 3 Apr 2026 10:19:30 +0800 Subject: Re: [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM To: wangxuewen <18810879172@163.com> CC: , , wangxuewen , , References: <20260402064946.1124250-1-18810879172@163.com> From: Miaohe Lin Message-ID: Date: Fri, 3 Apr 2026 10:19:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260402064946.1124250-1-18810879172@163.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemq500010.china.huawei.com (7.202.194.235) On 2026/4/2 14:49, wangxuewen wrote: > From: wangxuewen > > Replace the hardcoded magic number 3 in get_any_page() with the > existing GET_PAGE_MAX_RETRY_NUM macro for code consistency and > maintainability. > > This change has no functional impact, only improves code readability > and unifies the retry limit configuration. > > Signed-off-by: wangxuewen Acked-by: Miaohe Lin Thanks. . > --- > mm/memory-failure.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memory-failure.c b/mm/memory-failure.c > index ee42d4361309..e5a6b1353d9e 100644 > --- a/mm/memory-failure.c > +++ b/mm/memory-failure.c > @@ -1418,7 +1418,7 @@ static int get_any_page(struct page *p, unsigned long flags) > * We raced with (possibly temporary) unhandlable > * page, retry. > */ > - if (pass++ < 3) { > + if (pass++ < GET_PAGE_MAX_RETRY_NUM) { > shake_page(p); > goto try_again; > } >