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 X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 285A1C43460 for ; Tue, 18 May 2021 11:58:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AE1D961042 for ; Tue, 18 May 2021 11:58:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE1D961042 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25C0E6B0101; Tue, 18 May 2021 07:58:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20CF46B0102; Tue, 18 May 2021 07:58:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 037E26B0103; Tue, 18 May 2021 07:58:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id C11AF6B0101 for ; Tue, 18 May 2021 07:58:19 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5AD18A765 for ; Tue, 18 May 2021 11:58:19 +0000 (UTC) X-FDA: 78154203918.19.5859EB5 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.79]) by imf27.hostedemail.com (Postfix) with ESMTP id 04C8180192E1 for ; Tue, 18 May 2021 11:58:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FAAQVohUw5spyVEhK+J7yggMzQO9zEhnTJ43pFKFaUyLDiRiXLLl6K47RG8yPDcPVJR5794hvrUWE5flUwFDi4mnHEjJ4l7fC1xOE7yNWvnYu7dXx1x9PZ3cho5tCcw9WA5+9BFCXnFyCY9xKbsEqrPnMD19zTJa7C3fDpQLOSutlz9125Jkm5C9oilW4fi2bvdpMgQby0jzpzMk0bMQXdTJJfirgpaqbT2bhVMfB8Qe4yNV500EbH0BvVdNZbmOzMW5e8SNe4tvll8CCqjDkaX+s+B5NP9Im1u2QlhHhGfBdIwFw6aokaEIfrt44J0SjgQvQOiyvd5H9bPAzAj2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kK2QEwg/XBH3F3RK5WAljT743S3J7ZCvjM5u19bbObU=; b=CTtOxa9QfT3QiXY/pgbZrAVXjVCm2+yYBpkCfJ6+o5X+KRZoaf/4vh3+650NwQU50Y4erkwNRLtS7bJ4rfB1tKo0WRS7pIi7+aqgosh0SLTO1+yTRwZmO0QuoMS8hLzicbgwFHsi8EGp2mDYzNSmBi7UgiqtqLir2tG8U+SNBsWiu4socor8w485YZnsXBG1EyMzodcCLOwjdZ+zoxpXpMOOmsmLK5eocLV4M/eqH3OAmncl/Z6agVHc4uN6KEIROEVwe5hL2qcaf1i436wiYTweGU7DTx6ejY4ot5zhCr8m8geGbDs1fUdaxHq341gelIDdRtM1iis/bCzd5AdSDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=infradead.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kK2QEwg/XBH3F3RK5WAljT743S3J7ZCvjM5u19bbObU=; b=k+YEvP04DoRZpwXwAl78Skp3bdMx7SurLpS5o3AZvGCeT7T9R4DW1kSOHmkP5ceCDk01PUUIjoq/qMKkV60ep33BzDtqzDDzkwfyPcj5sAuRH5xjGT8oaGR4W+U9YD0f/cCVX9Lbi1YYvbCVEsXVxdhThwYmjtSrkUGoUpMfbZdE2YJfSuVvnAWkst41TqiK4cZfH/typdavtMnp6H5S5cw60V6qOYSH61Og0nVFQ1GDGF5JMoytT22RO80vpsvlqLkKDZEtixulsaHAya8bKPaQ0KIamfSRk3RGZy7d1rV0cHtiOV5ASIYycIdirkD2GwBuLQOVhCvkestkCEo0/Q== Received: from BN6PR22CA0038.namprd22.prod.outlook.com (2603:10b6:404:37::24) by BN6PR12MB1617.namprd12.prod.outlook.com (2603:10b6:405:d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Tue, 18 May 2021 11:58:16 +0000 Received: from BN8NAM11FT040.eop-nam11.prod.protection.outlook.com (2603:10b6:404:37:cafe::ff) by BN6PR22CA0038.outlook.office365.com (2603:10b6:404:37::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 18 May 2021 11:58:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT040.mail.protection.outlook.com (10.13.177.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4129.25 via Frontend Transport; Tue, 18 May 2021 11:58:16 +0000 Received: from nvdebian.localnet (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 May 2021 11:58:11 +0000 From: Alistair Popple To: Peter Xu CC: , , , , , , , , , , , , , , , Christoph Hellwig Subject: Re: [PATCH v8 1/8] mm: Remove special swap entry functions Date: Tue, 18 May 2021 21:58:09 +1000 Message-ID: <2009782.faHf7sVjGQ@nvdebian> In-Reply-To: References: <20210407084238.20443-1-apopple@nvidia.com> <20210407084238.20443-2-apopple@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e74b7bf-743b-4368-e3b2-08d919f438b3 X-MS-TrafficTypeDiagnostic: BN6PR12MB1617: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dhZyjhtzq+w2F7MEBwd6talLQ1aWAfeQakn2i7/TteuTrKW1UHVJq8fe+pWy3bOVnHQBQU+U6tMemDANVTP9t3P38Ixo7LFMNpdh+dVkwkIIZK+VL6N9sRLNfWKqb07H89iL5A+k85YyBvSLtfO31Ox4eZKc+gTLw+yOLVFTPtUdzXM6TjIXk//yiVt8ZCOtDm+TGymYR3Tn7stDX/escgLuWMHXHNjVQuvdtPXzBEdvsrn9S5F1+7C+lKWDv85fhPTgAS2h8Lgk3NO9rqxy41FrNTCxO2YnlGWfC24g2u2w0QzIgySs0wWZ3JAzXRfI21iU1hjttpFXeVFUZiMqfm9QL/fb3LcUvKGT60XYgYpKJVKyV1kdeKS99T27Wr3v6JAF0+yapwt1cvbrrmBxpQLBLzOh7DckxF45f9Nc6It/xdmtbinToZucrQmn6eCuUpNk9t/6XWJ3CINN/maaUbV2FqiVFxV9Gwp6y2kYcF1ukdHHhSDky6Z/V73CpOyEnTxlHKogwJTotmjSi2CtryzHd98ZS/dnZrj7Z3+h32iR+grX71pkZ8n/e43zAipsjM2OuKxgL1GWEFNtBgD67DJ6/s/addw00Dasqxbdy14F38VppQZyAzp0OIOuzduPMuFd+TQyf3Q2yanvvgreBKIZnj13pmTr+XYGU4zkHfLCRJPozgQckOcJPNS3P+ncz5MsLUEEKLWGOKYxcD+mNvlTORmoAXinWU9cyhyA4ho1faBAWVxfJhEwDkSH8oSWheLZqHs9gZYnP5c9IchTkyWH8QRrWiscuuSZjna5OEk= X-Forefront-Antispam-Report: CIP:216.228.112.34;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid03.nvidia.com;CAT:NONE;SFS:(4636009)(376002)(396003)(346002)(39860400002)(136003)(46966006)(36840700001)(426003)(356005)(82740400003)(7636003)(336012)(26005)(47076005)(16526019)(186003)(36860700001)(82310400003)(83380400001)(7416002)(2906002)(33716001)(478600001)(36906005)(316002)(54906003)(966005)(8676002)(8936002)(6916009)(9576002)(9686003)(4326008)(5660300002)(86362001)(70586007)(70206006)(39026012)(21314003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2021 11:58:16.1894 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e74b7bf-743b-4368-e3b2-08d919f438b3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.34];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT040.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1617 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=k+YEvP04; dmarc=pass (policy=none) header.from=nvidia.com; spf=none (imf27.hostedemail.com: domain of apopple@nvidia.com has no SPF policy when checking 40.107.223.79) smtp.mailfrom=apopple@nvidia.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 04C8180192E1 X-Stat-Signature: jmxaeoyq7wxua9kwx3r4a8p88zcbqtfm X-HE-Tag: 1621339096-414116 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 Tuesday, 18 May 2021 12:17:32 PM AEST Peter Xu wrote: > On Wed, Apr 07, 2021 at 06:42:31PM +1000, Alistair Popple wrote: > > +static inline struct page *pfn_swap_entry_to_page(swp_entry_t entry) > > +{ > > + struct page *p = pfn_to_page(swp_offset(entry)); > > + > > + /* > > + * Any use of migration entries may only occur while the > > + * corresponding page is locked > > + */ > > + BUG_ON(is_migration_entry(entry) && !PageLocked(p)); > > + > > + return p; > > +} > > Would swap_pfn_entry_to_page() be slightly better? > > The thing is it's very easy to read pfn_*() as a function to take a pfn as > parameter... > > Since I'm also recently working on some swap-related new ptes [1], I'm > thinking whether we could name these swap entries as "swap XXX entries". > Say, "swap hwpoison entry", "swap pfn entry" (which is a superset of "swap > migration entry", "swap device exclusive entry", ...). That's where I came > with the above swap_pfn_entry_to_page(), then below will be naturally > is_swap_pfn_entry(). Equally though "hwpoison swap entry", "pfn swap entry", "migration swap entry", etc. also makes sense (at least to me), but does that not fit in as well with your series? I haven't looked too deeply at your series but have been meaning to so thanks for the pointer. > No strong opinion as this is already a v8 series (and sorry to chim in this > late), just to raise this up. No worries, it's good timing as I was about to send a v9 which was just a rebase anyway. I am hoping to try and get this accepted for the next merge window but I will wait before sending v9 to see if anyone else has thoughts on the naming here. I don't have a particularly strong opinion either, and your justification is more thought than I gave to naming these originally so am happy to rename if it's more readable or fits better with your series. Thanks. - Alistair > [1] https://lore.kernel.org/lkml/20210427161317.50682-1-peterx@redhat.com/ > > Thanks, > > > + > > +/* > > + * A pfn swap entry is a special type of swap entry that always has a pfn > > stored + * in the swap offset. They are used to represent unaddressable > > device memory + * and to restrict access to a page undergoing migration. > > + */ > > +static inline bool is_pfn_swap_entry(swp_entry_t entry) > > +{ > > + return is_migration_entry(entry) || is_device_private_entry(entry); > > +} > > -- > Peter Xu