Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp103414pxf; Tue, 30 Mar 2021 21:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW7QhqfWxE8Tz7KquZK2nK8E7cfoEBmLBiD/yoh3pxOfJmvkafsqA3RCVMkED5HN5BKUsV X-Received: by 2002:a17:906:68c5:: with SMTP id y5mr1378822ejr.371.1617163437827; Tue, 30 Mar 2021 21:03:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617163437; cv=pass; d=google.com; s=arc-20160816; b=OjNskJ8NC7o/hJe4gnoYuKXySzbMp5L3THTph3J9N/nP4Q8DjMJyxV65/Ne00cI0WZ 8y8QqudCPy2tKJY0ysA3KdALJJyXTzHDWWfqxwKrPK9wcYQGDdPri4h6mFktPbMl6aWB BDNwC4q88Ui+McbuwQ7+/bvJHMeh6KX6Hz1sh6x73hqH9XptFqEbOQ0QF25INpkki7TH 6D4H6o3JLKgt2tnScwBZc7RyKbXe9Mz13X/q/wzQ8ZuIU8+qOnYeFxKv9doTdusd9ZuB dXoCSz3zKZbs3nvGIG3wWV+HNUc9+Ndb8nmXVEzJGsil1rT40JaWWEeK98riossUQE/N 1E8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=SxCUBrjh7vhjBmCnyudkgDD2gnIqHNuKSrLXyz3R8xQ=; b=M/AapgopfQ8WkaKNZl8AZSri38Fx1Bmh7RS3gZJUG+RihboOJsNz2BcqSPF0Koilam Zi9dx1kdWwsdWmjWW9R2yayDhrg00XtNRIm1ounrFG/RMYm2/ndaO0aiWHWwRvMcCFCi feJevV/jRtQiPeG8FBxXtMgD6O4Nm3O4dRMNCBiC3ucRFrgKZQ10LfiP4y9wfsBI1DTr rVopxgy1eybmqh4S+PJsIJyKvxj/eggtyr+P7ipaUIrn9FquQdBmTMQHaxHOfkuytqVV IOFTIvZint62t5YztKO2KBuzbBE++3Wv2HYzoiGewlw6p0I7viLx5tnhvNtNnhcqD3MT pxVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="mTPHMs/Y"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si723804edq.288.2021.03.30.21.03.35; Tue, 30 Mar 2021 21:03:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="mTPHMs/Y"; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233520AbhCaD5L (ORCPT + 99 others); Tue, 30 Mar 2021 23:57:11 -0400 Received: from mail-eopbgr770041.outbound.protection.outlook.com ([40.107.77.41]:1344 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230160AbhCaD4o (ORCPT ); Tue, 30 Mar 2021 23:56:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VWo74krv900VkiFfqk3tJ4reqAvJiTzTjzCa5w315JVlhKNl8xIEayzx9iFEU57gLTpFrCovG2hhPyHtmj5FAVoRF7Il7X+qp2b9qh4ABGTb/qH5tt7+TEDt1wqpmL9S7vssqNPeo7sF2F/husHb5xXI4LkSGlJwJbcZinkwcEI+OmirVr46SesgNOBDnePXAg7lPCIBU4jaBIeEFeBWkGdCyz0K72UmzWc9zwZ9qgzHXAEojI7Ao9KY3PvIIrr34USJCumTwqUU2PLwXCgvHDvuJcdzfF/W3eUAfeBjx4KnYRM528kRgcrtYwwUM8K5NHVR4gVF04/t+iR+bCjAng== 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=SxCUBrjh7vhjBmCnyudkgDD2gnIqHNuKSrLXyz3R8xQ=; b=krrvlYu2jcTJVQ7mcYnta54AbGNXzEfQunjjR9vG5yxX9JgkToKw3/aOFDOKM/I9pNqFz8DuATKP+ws8nl/Eo3qNsPCbPxSUkgwemtjf98CeHD2anEUavz77/zN7H6XzRtHExOvvA9hPkf7A1Py79Ab8zrExJb0jl+5pk3aNgN7Zi/K1K/bQ741bN66AOv0HqJ/7KB7I7sBB4OWdBOhtlWGPza6/hACvXCASFqRAbG/wjhDb28/RR9ojmVXrDfNaibmkE7jj63hHkl7gJ1OI7i6L3uTmY0Wy5GEnyNCI4Pxt9Cqi6iLZ8gL89uk+GQ/awFUrWP9U+uvfIjkV0by9dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=linux-foundation.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=SxCUBrjh7vhjBmCnyudkgDD2gnIqHNuKSrLXyz3R8xQ=; b=mTPHMs/YaKX2MJTW3LAHHAtFfV7g+PoLBefKx5r5zNga2WWTLt/Gg3EgjthAuoVkHNzWTj3rjnHMAiHpwZGPk7b0YUh6nP1ra/F25fgbm4cyv6QmnwXp4C+hkAs4SNgGbM/Qj6KA3j8LGKJhr9I0HmCD7zYqtS1S+yPr04AyhHwQMaHokzKKlITcrQRJ++SaFY9pAEW+0Zf0Oc+ADFDqN8gyby2a90im4ofhXU8b5YcCcambrKRxCi8xpw5pHzEcfr6tvzd9yFdbSIPBnK8ekIFaXE8fOskcnjdlIW4an5O/MDW0vM1unprtK67Fxy18NZPyi3AFWijVXhy8S6fLqQ== Received: from MWHPR22CA0041.namprd22.prod.outlook.com (2603:10b6:300:69::27) by DM6PR12MB4284.namprd12.prod.outlook.com (2603:10b6:5:21a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.26; Wed, 31 Mar 2021 03:56:40 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:300:69:cafe::42) by MWHPR22CA0041.outlook.office365.com (2603:10b6:300:69::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.26 via Frontend Transport; Wed, 31 Mar 2021 03:56:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; linux-foundation.org; dkim=none (message not signed) header.d=none;linux-foundation.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 CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3955.18 via Frontend Transport; Wed, 31 Mar 2021 03:56:39 +0000 Received: from [10.2.63.109] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 31 Mar 2021 03:56:39 +0000 Subject: Re: [PATCH v7 3/8] mm/rmap: Split try_to_munlock from try_to_unmap To: Alistair Popple CC: Jason Gunthorpe , , , , , , , , , , , , , , Christoph Hellwig References: <20210326000805.2518-1-apopple@nvidia.com> <20210330222440.GC2356281@nvidia.com> <12636584.zsJ0Sx4KLp@nvdebian> From: John Hubbard Message-ID: Date: Tue, 30 Mar 2021 20:56:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <12636584.zsJ0Sx4KLp@nvdebian> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: 22300cc3-3276-47cd-3300-08d8f3f8fd3e X-MS-TrafficTypeDiagnostic: DM6PR12MB4284: 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: HQAOxm9xGmR6U+ToleSZJBBq4vvNSUt3/l7roC3llk3Z/pe21D3+S/gcUVYtrG7qzEI/AqBamvrBqdD8WUhuc7C0VrrlxK4O8YAsV7OZi2L4UCC5A11hqxw98x+E+YDYYDFRaswwwQl89mg1bF4I/HRfURfGyi6JGdmzJ2hFRIKWEmfKMYlPjqGdNrbFIlbbjqH+WUJ8kakBtcwyn2gMwZbL7x62ucLOFaVSq5kpsCFmePuNeVfw8AiTW7vzzn5UM5XhpAT69SRA4VNQn6+esfHMXH8t52AiTeH/XPQKpWATvbi1riNd4BKs8xrHiBc41p4IRoHXQBYGC8CID31s6XDTGyOi2B9ZC5Qad17wSeD7bHPYFnGLbEsyeCpAXvDu3C7/oHaRGZgCOuzh4xAdgYU8OhoGU3tUNA0MAchyissVb7zPRYhXf87H4UJr7ry4ULFl3I4Rt2T7MO27oziIg8/bvjUOLL/qcdhZmSPeNVaZ4m604XwM+e5Sg9JRyAqvBI3+iPSpMXqsqeb/zsrzIt9mOp/EuJCEJHTd1LyS/hbwxAHiTpzYczmK0ai/8EctGvfBt0BDAL80sNxFcOfmckj2knkxYw23HK10VLtCPRTIx6zAdz9HxZVop8PhA8bbMgOctgUndt4QEEiRfh45/lCvOAIms9XgXfQCQDZjqC0oIW6Ba8ELPB/aEXHjsa5E 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)(396003)(136003)(376002)(346002)(39860400002)(36840700001)(46966006)(36756003)(53546011)(8936002)(7636003)(7416002)(82740400003)(5660300002)(36860700001)(36906005)(70586007)(70206006)(86362001)(37006003)(2616005)(336012)(31686004)(83380400001)(6636002)(426003)(54906003)(478600001)(316002)(16526019)(4326008)(16576012)(82310400003)(186003)(8676002)(26005)(2906002)(6862004)(31696002)(356005)(47076005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2021 03:56:39.7357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22300cc3-3276-47cd-3300-08d8f3f8fd3e 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: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4284 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/30/21 3:56 PM, Alistair Popple wrote: ... >> +1 for renaming "munlock*" items to "mlock*", where applicable. good grief. > > At least the situation was weird enough to prompt further investigation :) > > Renaming to mlock* doesn't feel like the right solution to me either though. I > am not sure if you saw me responding to myself earlier but I am thinking > renaming try_to_munlock() -> page_mlocked() and try_to_munlock_one() -> > page_mlock_one() might be better. Thoughts? > Quite confused by this naming idea. Because: try_to_munlock() returns void, so a boolean-style name such as "page_mlocked()" is already not a good fit. Even more important, though, is that try_to_munlock() is mlock-ing the page, right? Is there some subtle point I'm missing? It really is doing an mlock to the best of my knowledge here. Although the kerneldoc comment for try_to_munlock() seems questionable too: /** * try_to_munlock - try to munlock a page * @page: the page to be munlocked * * Called from munlock code. Checks all of the VMAs mapping the page * to make sure nobody else has this page mlocked. The page will be * returned with PG_mlocked cleared if no other vmas have it mlocked. */ ...because I don't see where, in *this* routine, it clears PG_mlocked! Obviously we agree that a routine should be named based on what it does, rather than on who calls it. So I think that still leads to: try_to_munlock() --> try_to_mlock() try_to_munlock_one() --> try_to_mlock_one() Sorry if I'm missing something really obvious. > This is actually inspired from a suggestion in Documentation/vm/unevictable- > lru.rst which warns about this problem: > > try_to_munlock() Reverse Map Scan > --------------------------------- > > .. warning:: > [!] TODO/FIXME: a better name might be page_mlocked() - analogous to the > page_referenced() reverse map walker. > This is actually rather bad advice! page_referenced() returns an int-that-is-really-a-boolean, whereas try_to_munlock(), at least as it stands now, returns void. Usually when I'm writing a TODO item, I'm in a hurry, and I think that's what probably happened here, too. :) >> Although, it seems reasonable to tack such renaming patches onto the tail > end >> of this series. But whatever works. > > Unless anyone objects strongly I will roll the rename into this patch as there > is only one caller of try_to_munlock. > > - Alistair > No objections here. :) thanks, -- John Hubbard NVIDIA