From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB961C36010 for ; Wed, 2 Apr 2025 02:49:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76238280002; Tue, 1 Apr 2025 22:49:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71010280001; Tue, 1 Apr 2025 22:49:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FF55280002; Tue, 1 Apr 2025 22:49:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 439E8280001 for ; Tue, 1 Apr 2025 22:49:35 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1CC8F1CB7A7 for ; Wed, 2 Apr 2025 02:49:36 +0000 (UTC) X-FDA: 83287573152.21.C5ECF2B Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) by imf29.hostedemail.com (Postfix) with ESMTP id 1923C120002 for ; Wed, 2 Apr 2025 02:49:33 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SbItZ3fr; spf=pass (imf29.hostedemail.com: domain of ye.liu@linux.dev designates 91.218.175.174 as permitted sender) smtp.mailfrom=ye.liu@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743562174; h=from:from:sender: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:dkim-signature; bh=ShkV8Eez8zF2yiacsvlXmljeTgs0yVxUyt2LGsKil6c=; b=u008V99ppKLWXIbcVl8w+FkfYmTMy7mgFVKCXqecPeRNktoKp6i2MeB+nKfAEtIvZiBlXZ D/D6HjW42XAtn8qFarEiD1K+cstmRm3e/lh+UOVpGlCPSxN1NMDTNB2ZZVWNxT5LfSPfWW 1s4OWGvLa9nZ+iV2x1MM6aMTn4nB5Ig= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743562174; a=rsa-sha256; cv=none; b=19vGZRvXLTWdBkJJ6kr5a6zkCdQnvw3AuxUgU47mdvFtDKg0WXrnNJnJ9T1Mj4Ov4Jo7R+ ktq+JO1VFsahHvaDNiGRmA4ZI16SDEiCxEt5lg/UJWe2pHyAM1/LcuHOKTKMB0rRD7+AJ9 2Tg2N2PZMEfANFYcI92PnnIZpsv6uos= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=SbItZ3fr; spf=pass (imf29.hostedemail.com: domain of ye.liu@linux.dev designates 91.218.175.174 as permitted sender) smtp.mailfrom=ye.liu@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Message-ID: <6cd78595-f9d3-4f26-8ca3-d1a0bf4e8dff@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1743562171; 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=ShkV8Eez8zF2yiacsvlXmljeTgs0yVxUyt2LGsKil6c=; b=SbItZ3fr5KIGsi/J/LEd8siyokZSoxxjxgcV51j1Rh7ilbJDtvKRPgVYJZ4guZtGI3TbD6 S7BiSRlrUzRwRO/4+2uzOrsVUnKcUmWzuFEdtDijsUmuX0pH/ZmX4NElF+SxLoek4HJYQm GSukYhXHv1LULJFGiNlurgs+BLWHGww= Date: Wed, 2 Apr 2025 10:49:17 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v4] mm/page_alloc: Consolidate unlikely handling in page_expected_state To: Matthew Wilcox Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Markus.Elfring@web.de, Ye Liu , Sidhartha Kumar , Anshuman Khandual References: <20250328014757.1212737-1-ye.liu@linux.dev> <8720c775-c0fb-4fbf-a1a8-409fef2b67ad@linux.dev> 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1923C120002 X-Stat-Signature: g1pwhta7tasbi3xwaw4uwi6jkutr8wb5 X-HE-Tag: 1743562173-982987 X-HE-Meta: U2FsdGVkX18sx/CFHe0NCBvNhCax+Jxr05UkEzGwEsVNoKvOW6NPofpXQGTS8Ldw4qjUw0JaF9scZDrhqbIOF2aPuQyH9ioIm89MHGk72jtbACsCFiwPA5X/Xxw9AFirvSzEouw4mb0KgbaE8nKmrkxGUzzRgIOPtHoF4m4m+zh7aq2q4UP9nxcsBMkB+imHzJkXsHFyPLDta8mKN6qxADS+Vr79XUmhPDZiUIIlUh6IVJeCnADBcPpDePOzqq1AKEfPSczrLYG4sGYFxnISabqtKphJsC/0COQPjZZ9+Fops6tYkhtbzM0hDrfvQkH0M6rWnCJpaWYzvRICoGij/UIgns7ph/1ByNdTDL8gSytIDnopuGrLDfkw+di4uIt9Ux1xXIpnUJw7yLz9R4dfqEnnwlXwSVBN2aqZzJKkGPk+eTO0jtMF2s2h4z6vkSiFh2qqeKEdmOyNCrhpcuTDLkQ/Adr+ZkfKBu6vGsr0RJPzKYjTtDIwFxFrzzRXZkeztHkk4C2sUhZJB5AfZhPdwkBO0Cd+NeTyNs3CrhwL9MPWWj4S6CNUwPVUUt2iVwDMr7UoyCrPwjRvBZQDzN1lDD9VXIYNUkYHE6MiIvK9//gv32LdvTPHILBbawpDqCF92QrkqUUy9K3bU8sAwIYSym36tSMk+EpfJxs0/UvnsK3Sh9vRmqviU17Tp018pujc69eFJNj1ff6czyk/d2i4oFvn42TgNxDjuM9PXOJPefrQhj1Wyo6IdGUxXgnAUSUzFd+XUfWz4VBtBLdqXJao2IeKzw8Z16E6WGWbku0D33fq5nSrgLlMJRECQNpR3d5t7gInv8B4oOAIkDZRpLuU+oRLuO4QW9NEo9lESLJIgv/cYlDiJFqxps2RmybToVANkCSdqAb6es13lqVIHW+5lnn1om/cegv4LHD3cEdE24/JTZ8OtCgSaQbqHpQRWxkBTJYoogqeXAQnyLBuHde wPxP568e eeumhpaJNfxlw271TITPAnd3xpKsMwye+bJFBTNkbjZJp0L0Rfa3HxhbhnZhq3sSmW+7aPdHcTG/3f8Djmeoffy26U7B5aVhAj7nJGSeotd47WdbPwBDbRYt4MQo9174IrNxYwIc6yH8HC6xccGV94jDwmCB8v1YoVYFFXbcSqjppu5fxQezFeLBxFpCiwq5uhgnxbdiSvxokDBkaKWr/K/H8fes9xOmWHBj2csTWU5Ha80esfKgx1xfjurWHdtK7UKC3 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 在 2025/3/31 23:59, Matthew Wilcox 写道: > On Mon, Mar 31, 2025 at 08:08:01PM +0800, Ye Liu wrote: >> 在 2025/3/28 22:29, Matthew Wilcox 写道: >>> On Fri, Mar 28, 2025 at 09:47:57AM +0800, Ye Liu wrote: >>>> Consolidate the handling of unlikely conditions in the >>>> page_expected_state() function to reduce code duplication and improve >>>> readability. >>> I don't think this is an equivalent transformation. >> Could you explain it in detail? > page_expected_state() is called both at free and alloc. I think > the correct behaviour on encountering a HWPOISON page should be > different at alloc and free, don't you? In the alloc process, this patch does not modify the code behavior. Regarding the free process, the if (unlikely(PageHWPoison(page)) && !order) code handles the case where order is 0. When order is not 0, it does not matter if __ClearPageBuddy is used to process the last page of the compound page, because page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; will also clear it. Is that right?                                                              >>> Please, stop with these tweaky patches to incredibly sensitive core code. >>> Fix a problem, or leave it alone. We are primarily short of reviewer >>> bandwidth. You could help with that by reviewing other people's patches. >>> Sending patches of your own just adds to other people's workload. >> Thank you for your feedback. I understand the sensitivity of core code >> and respect the limitations on reviewer bandwidth. However, I believe >> that reasonable optimizations should not be rejected solely because >> they involve core code. If an improvement enhances performance, >> readability, or maintainability without introducing risks, wouldn't >> it be worth considering for review? > If it's a reasonable optimisation, absolutely! But if it's an > optimisation, it should be accompanied with a benchmark showing an > improvement. As far as improving readability, I'm not yet convinced > that you have the expertise to make that call. Every change that is > made invalidates everybody else's mental model of "how this works". > So all changes carry a cost. Sometimes that cost is worth paying, > other times it isn't. So we need to discuss the technical aspects first, right? >> Regarding the reviewer shortage, I’d be happy to help by reviewing >> other patches as well. Could you please share the process for becoming >> a reviewer? What are the requirements or steps to get involved? > There is no process! Choose a patch, read it, think about it. What > problems might there be with it? What may have been overlooked? > Is the commit message unclear to you, how could it be improved? > When you're done, send a Reviewed-by: tag (read the kernel process > documents for the full meaning of that tag). > Thanks for your advice, I will try. Thanks, Ye