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 38126C3600B for ; Mon, 31 Mar 2025 15:59:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 496A828000E; Mon, 31 Mar 2025 11:59:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 44A4E28000D; Mon, 31 Mar 2025 11:59:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3350F28000E; Mon, 31 Mar 2025 11:59:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 159E328000D for ; Mon, 31 Mar 2025 11:59:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3B317120BA5 for ; Mon, 31 Mar 2025 15:59:21 +0000 (UTC) X-FDA: 83282305722.21.7DE56B0 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 6928F180003 for ; Mon, 31 Mar 2025 15:59:19 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wBmUbAH2; dmarc=none; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743436759; a=rsa-sha256; cv=none; b=G28ZdwL+TRwTrUQDwvIN9nkgwg04WPu+zSRCg5c3PKnUFx6nokzdzn+vqTlEJhNXNgTuCk GfBVZaJc9d/mhMEGDxasZmjsd1LKwTTPG9LRIMgefDNwubSbxV/VRQcdWuU+CI7ZM+jCW8 8/ZI7P0DosvBOHp0Qw9ooFcesIkqVYc= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=wBmUbAH2; dmarc=none; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743436759; 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=Wnh8uoRPkusnTEUMr7tAStK6YSVlZsb7i2nO0MdBKcQ=; b=GX7bVoN6bWMJR74sXG3iy3oX893W1HvHDFMYgQL4mx+UB0iy8iKNdUz/GIhigowhXWX3Wi FqPMuXhdRHzUFNDu34VbLzKpsrvlRakyEYh1xR2h3yuUEyBP0gZ6sCqTwrG5s+ZFmy0m8d 0F+LKz6EB2enAbMIH9KwFjhcZAHhLbk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=Wnh8uoRPkusnTEUMr7tAStK6YSVlZsb7i2nO0MdBKcQ=; b=wBmUbAH2KymnttpDPouzeQslac U3mrhK679+29flucbG8YWnreKR7BnEgby9ro26L5g2UmxRDc1wFLnsaaih58pgNz/nwJk9ELMJgaJ WSg7cDAvG84YUuXbmNA/s1AqMz+h5piobg9qScpB4zdj7zxN3w26nLX7sdMy4Uf2tN0fZjzh8J16x UKLgZU3MCmiQ1RqOA2QZgqrQIoqG108yJbFSBxhSPlsWp5JDUA1Uo4S9DWlKIbAQQ9F3fGChYfrzi vhsodcK9NbLfLLy2tWbxDQ13PeazJa50K56ZmWQ8IT3PTCyRA8g5PDiBBWIYTo5E+sY59BXyCHjXS m+7XQ/HQ==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzHXh-0000000F0SR-0ZRA; Mon, 31 Mar 2025 15:59:17 +0000 Date: Mon, 31 Mar 2025 16:59:16 +0100 From: Matthew Wilcox To: Ye Liu Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Markus.Elfring@web.de, Ye Liu , Sidhartha Kumar , Anshuman Khandual Subject: Re: [PATCH v4] mm/page_alloc: Consolidate unlikely handling in page_expected_state Message-ID: References: <20250328014757.1212737-1-ye.liu@linux.dev> <8720c775-c0fb-4fbf-a1a8-409fef2b67ad@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8720c775-c0fb-4fbf-a1a8-409fef2b67ad@linux.dev> X-Rspamd-Queue-Id: 6928F180003 X-Stat-Signature: tkcqi3fx1yr4i5m316n8cg3nnoy1bari X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1743436759-169139 X-HE-Meta: U2FsdGVkX18M7zUFXsFRPuxnYZl4rI00IySBkFM/T8L5dN2IkwulbpIcYnMQMZpbN0HWhL5d+MW6pgksHXpRabeXsfWkiybEECVZxR+09/iv/n46h9eZ9zGE3YQSkUL9SyjMT53gGNQ0vc5I8LLHTKMV9NAjJhlFFQHEN4NB6C82BRTt6bIfG0mrbfUFwcy4GJf8hkKCfKh+DRb30N5fgAXXSAHauA7w3ZjYTCAVKeDUNGStEzs+ltrxIav4mDFQcswTo3FAynOnzPsvp/2wp2Sf7UZSto/m6JjzLFhjiYdaPSs7ECtE0BgJVvYE+6ULPbZDMhdO/EEpbzgVM7bidZ89mkU/lvxPxI62vbeDqlN9gIjQFgQVwR7w1e0PIhw+mhIHObiDNycR4Ti5QGCzQL/nJsNM2NBaHEt7dk88DnXY4rN9t8Xe+Mh5PY4zpCoZE53JU8BqzOcwhUqjjeiSkJgcIYykTT15SRDq9618RjnBrYI4huYubLN78UdOfQiPIh5kpV+pfyTYtyCJ5e5p7RMHdm5A1ptb/sz3SQA41zNmg7Aic9JysOHeHmPX2xhIzPQkZMikvi2K7Af804pYXRn3N/+1COAkPmBu2k8mKei+JBHsRI53HesVjvPpakTVT3rEFyUKpIGkAhcEhLApw3MorQSXRWwS6WKnDDh5rV6IgQq611cfUl0e8wJmMuFqnRTRQ6jKlzWWeTs/vBLkARGDj007D2zKWBahEQm7e/h94lJTgYI3KXggQVFrGI14VIaPsieqrdQYWb52qgWc+Ozi2qgq133uDYxF1MSCZ2gFSPp4U94q7J8PRZAmnG202rsLA7OM9qqkqU9lvwNvUlzSC0rrBBvB6NdJf5+/J5rUPYYARVWEvpDpneJdU2Md+pxCpJxIoIhwarIGl1tY+8Qnlg3Isy+u2RBPLIqlmxP7V1Cr1fB6oPh4OMkBtGGUh44szAtOlsSETBKkzhf tveIisY9 /5c/oFc+MbDXFmrfKhksv9zIL9uQPKq6CWGixvIk1tsOV/eRmErwkEulibRd3yjG6HuntDQXhxxWtj78gEcodio3H3R9utCIIyXYQkSl3qwQZEG8B4yxkgqXFSy6WwdXWgyrsrpIL0VgeCKr+xoIOaB5DuqoviYRUWSy2UuWqLL1le8Q3IZvI8WNUz4qlp0SlsCu36/CHhXpqfisrm6DdsgSn73cYEZBJm5x7Fwc5OYqop44ACPutLtlXpJ5OammY1xNzK3WgaIXd+pZoEwK6ttFUR20jajXC7ta2SI1u6rZUP3Q= 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: 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? > > 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. > 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).