From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 615B44028E9 for ; Mon, 27 Jul 2026 12:11:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785154275; cv=none; b=e0O8TrHEba/ZTjQSyKfSOFpiXRrU0BG0mBidPGaJWiyY8HD/o5Hy2MFp1h8dFJE4zyLtmCScL1YkHFx0JsGS/xerZ1RHQbsKx0SqZ8khpH/IGOBSsNZB1xZ+0uJOfGErsJe/M0iWuTNLLQuM0tYGVfu+R0nXwfTTP77DnAXw5Uk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785154275; c=relaxed/simple; bh=6M4n+k0qnukqrsCCwYsuQRGpmBPzpE6z7Ex3+5zl2Pw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kdjjb9WAXD454D8RpuXONvPEeaIOLTSlBMiqqCodutKxYUAkBM0WzhN8uGm6ms/FRZN5wXQrDwaNh18Ki4nfOuk7yRWqV2jeAEBBQB70UtU5JUgbd7LKyFtjcBdVDfty715O5goH1LWTZdB9lPnmGUy7ymwz2TnsOL8lbgM/NYQ= 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=eIN1J/zh; arc=none smtp.client-ip=91.218.175.186 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="eIN1J/zh" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1785154267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FqRDMJ385c9CEd6uthhS9gKVU+eex7894C+QhK8tFGU=; b=eIN1J/zh87o7cJi166fmqwLOwxGSkLpAFu7ZEoQQWmIhhdtNP54qw7VJ5bVgxhINNsw3Mb oBY+cCBtQqywHbvs0sO1F99YtzmnSmd8ew6SDmY3d9IkVDWjhaGFYOoLodOmk/uJFZEwpM AkeMJjHVZM8Wc2sAjl0dzWjCjcGjojQ= From: Hongfu Li To: david@kernel.org Cc: akpm@linux-foundation.org, hongfu.li@linux.dev, liam@infradead.org, lihongfu@kylinos.cn, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, mhocko@suse.com, rppt@kernel.org, surenb@google.com, vbabka@kernel.org Subject: Re: [PATCH v2 2/2] mm: Extract non-swap page handling to do_non_swap_page() Date: Mon, 27 Jul 2026 20:10:47 +0800 Message-ID: <20260727121047.4140-1-hongfu.li@linux.dev> In-Reply-To: <10c60511-c841-4bd8-aa5f-0d826b676533@kernel.org> References: <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-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT > > mm/memory.c | 120 ++++++++++++++++++++++++++++++---------------------- > > 1 file changed, 69 insertions(+), 51 deletions(-) > > > > diff --git a/mm/memory.c b/mm/memory.c > > index ae521baa8c84..50d8e92aef91 100644 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@ -4815,6 +4815,74 @@ static void check_swap_exclusive(struct folio *folio, swp_entry_t entry, > > } while (--nr_pages); > > } > > > > +static vm_fault_t do_non_swap_page(struct vm_fault *vmf) > > 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. Thank you very much for the detailed review, your analysis makes perfect sense to me. I'm glad to send out v3 shortly for your further review, with do_non_swap_page renamed to do_nonswap_softleaf. Best regards, Hongfu