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 0D3BAC433F5 for ; Tue, 8 Feb 2022 14:49:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E9726B0073; Tue, 8 Feb 2022 09:49:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 799A06B0074; Tue, 8 Feb 2022 09:49:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 688CD6B0075; Tue, 8 Feb 2022 09:49:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 5B2D36B0073 for ; Tue, 8 Feb 2022 09:49:34 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1B9C320FB5 for ; Tue, 8 Feb 2022 14:49:34 +0000 (UTC) X-FDA: 79119896268.01.5E812F8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 25C66180003 for ; Tue, 8 Feb 2022 14:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=CxXd3dSAE2uF+6pqXs76Yq/5rxUOx8mkAGTi/0d7uMQ=; b=aASHd2judmxEE8pOuLHbCaoHE2 UJ67D2M+aVZMg2Ntiw9V70DFZ6o7Uc2oSTeLTb3I9EFa0V6r2B0pVX3wxXRhkANQZnMATz99vXfXf rfrBSi5z5qMwdKjCCROvcZ6yABlDo3uGLE0QuZmZ5gTorqxV7/DXUFe59kNuwA1XZMF7MwXqc8IIm bx6aWm6tlUnisX0QVyi0FXLuHJYxMnqlRHpJsQ88R4WV0+iPk9OGik9yyNCV211TWtHDsShOtYVqh tleO7c0iVedG0Muq1jS7TcSI3CRwUwM3CDJ+Y9LkrM/rwDmFgUlP9lDUTZ5jXp9PH/faInN3cl4Qp 2YhbaESw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRoA-00593m-8M; Tue, 08 Feb 2022 14:49:30 +0000 Date: Tue, 8 Feb 2022 14:49:30 +0000 From: Matthew Wilcox To: Muchun Song Cc: Linux Memory Management List Subject: Re: [PATCH 1/2] mm: Add pvmw_set_page() Message-ID: References: <20220203171904.609984-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 1pfxmzf7qokzfkbm1gp9jgqahcw3fyc6 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aASHd2ju; dmarc=none; spf=none (imf24.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 25C66180003 X-HE-Tag: 1644331772-869138 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: On Tue, Feb 08, 2022 at 04:04:32PM +0800, Muchun Song wrote: > How about the name pvmw_set_pfn_from_page()? > When I looked at your next patch, I'm feeling this helper > is used to set up the pfn from a page instead of setting up > the page. But it doesn't just set up the pfn, it also sets up the range and the pgoff. I wonder if we wouldn't be better off with this pattern: DEFINE_PAGE_VMA_WALK(pvmw, page, vma, address, flags); ... which wouldn't get used by KSM, but could be used by most other callers.