From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D3D84157A5A for ; Tue, 28 Jul 2026 03:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785208398; cv=none; b=dzYyBHeMHagf9kbAszXCI0/QHFGB40Ept78bTGJBMXTVbtGxfBcTj+bhgRDv9oYhnDbe2PZswXw1o/AxpqlHUl+TxUPAHWmOlu/SYPSxMeR2XHfBdot6Szqr3lk/GEpRFnMCigDx1O61m7deOkXs0Qpr7TYVahnYwcJTOG4LTP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785208398; c=relaxed/simple; bh=mMk0tKx+jiMwlbS8oe/mYgbmOehbBEcV5F3qhNgNYic=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QDMvPWhjh8HUhuiHmc3WHPNbWVwLno7AzLkaim+awOCHiZv9b3MOxP1C6ilZo2ijPf/eYtxfB42xd198SZZMEgm9BRzDp8SnAmoOigT7xRyKTXorrJSjyXvmXFKGxXLLbjvfXDAUGQuk66eQs37yQE53qO/1bRljblwdXRMChE0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=QABHcAm7; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="QABHcAm7" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EHN+9hNginFL/FCYHigLOr7fyStAUtGKteBBOUHnsmI=; b=QABHcAm7QJS9+/Zh2HsSxmpm++ r3saAVwtV8cMm8MHhUJ5eZdAjL3qV/xs+faG0HNaFKWQ7xaGeARsi4hKkzYAwW9PE403/X9BA6ful eokhT4nB6lnh42YphqfVx7a1YiloFlJmSFp68XSd0eQ5MMAAVuBqvR6+QxFepST9y8cVPGZut3XH+ ncX/ciuUE94g+Z57j1LhQCnrxb/dVB3awZHgFdHg/91F95vSD8URDPKbDVTj8m/0q/I5xCLD9ET/O 2pZcmzFRfbn4H/MMT6cL6fpWdFCUKD1ORHtbR2qilJLIm6LfDwwFP4wOayPw0gvsD4ZLtXR9szbuS /19NGtpw==; Received: from hch by bombadil.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1woYFi-00000004JFR-2jMp; Tue, 28 Jul 2026 03:13:10 +0000 Date: Mon, 27 Jul 2026 20:13:10 -0700 From: Christoph Hellwig To: "David Hildenbrand (Arm)" Cc: Hongfu Li , akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hongfu Li Subject: Re: [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page() Message-ID: References: <20260723030752.16979-1-hongfu.li@linux.dev> <20260723030752.16979-3-hongfu.li@linux.dev> <10c60511-c841-4bd8-aa5f-0d826b676533@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10c60511-c841-4bd8-aa5f-0d826b676533@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Fri, Jul 24, 2026 at 09:33:12PM +0200, David Hildenbrand (Arm) wrote: > We're handling softleaf entries that are not swap entries. > > do_nonswap_softleaf() or sth like that would be better than talking about "page" > if there is not even a page. > > But actually it should be the other way around: > > do_softleaf_entry() [currently do_swap_page] > ... non-swap entries > do_swap_entry() > > Or sth like that. Then, maybe in the future, we can just move do_swap_entry() > out of memory.c > > So we're factoring the wrong thing out in this patch. Yes. From the code structure it also is really obvious that the block handling the softleaf_is_device_private() should be a separate helper instead of a giant code block sitting in the middle of an if/else chain where every other case has a well-defined helper.