From patchwork Mon Jan 9 01:22:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13092823 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 B5A69C54EBD for ; Mon, 9 Jan 2023 01:22:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0BEC8E0002; Sun, 8 Jan 2023 20:22:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABBE08E0001; Sun, 8 Jan 2023 20:22:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95C7C8E0002; Sun, 8 Jan 2023 20:22:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8351D8E0001 for ; Sun, 8 Jan 2023 20:22:50 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4E8821603B5 for ; Mon, 9 Jan 2023 01:22:50 +0000 (UTC) X-FDA: 80333511300.27.C0F63F2 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by imf16.hostedemail.com (Postfix) with ESMTP id AEB0C180002 for ; Mon, 9 Jan 2023 01:22:47 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=nrLIFZUJ; spf=pass (imf16.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.46 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673227367; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=qyOmqPK2lLgQdke1wKJxBDTYmPcatGwNKiIl1sHngbI=; b=hvdwSLnVjSSgACwbiTFAFpuMXy8WTzkzwd1JCjOzTfxqnj58F+eLsewDYpBHx6jtb00OQF eJrzXcqdM/kQTmVGgbm/4tmhdVgpKNbJC1NKm8QxMhc5AhHzN7uxzu3xOW67IFcZ1GSEEm /h+sKT9YlqHJTEm2o5Zs8LEOTo0Bzr8= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=nrLIFZUJ; spf=pass (imf16.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.46 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673227367; a=rsa-sha256; cv=pass; b=iGcyRq8kHfP606e8ynZMzEYpQ+uNbTw7TQ6vlOwHwi92677pfiXiYs1Ggy+wpry4Qy4Q6s AtIGusuy691iJy41FU1vErie7NgFkQQAjAPw/KTYyQ5xmitx4WrKjYOEa88NGQj9M5ePt6 Ffg1GqvPhbt0YhoWK2Ag0NcJNXo4Lxw= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=foI4ZRqjBDL/ON1kkZB9w2KIByDHJIT0sN0G3mvcpoaEzhO25eSQuZUtb19EY9IJcTCeZYokYHp8doaMp0A6YvYG1zGMGaR2EccZRMb0eBTkUZJWMThExA1o/DFQqGs/xxAjTAO7lYg282RfbDRpnE4xDjc0eE+8zIA8QoH5WE9EnWFK/csMYcbmxPu0+SBTvJskSUVHsxttPdNMCi8IyQDXJ4LCZDpZZhL/us/c0I3LehusEXrC1wjLvhT70/QXfueRUf2p58OOWT/ITdGkSG+egM3MGqRqfzJ5iJtuUFJqC/yfBONns0f7rsp1a4QgKc8sDmiht7hbsFEcEBeg6Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qyOmqPK2lLgQdke1wKJxBDTYmPcatGwNKiIl1sHngbI=; b=BrIls2N+nRlGkXZr507zQodgDfLjhP7GH7u/cpjvT7FKuSWq8agLssQdeQn/8xqL7P6O3POtORVRX7nnZG76GCUqFVfJtiK9AA9vs3/tZSMey4QhRrw+IwOknsUWsllYW9n6rzujmvz2zI3Y/oRsKeZ/PCwUlvkQSPR2anrlJvgZ2LgJ7ZAZJSMFwbCZk63JbP1EIB8a1aKFE7t+ogUHpejmywlTyKH9UOXbFgKdtEtF0nEP6YbYjhfMTEFTN13ZhQhTUmb9kw38uDNhtFiZA52lvgX7pa8gUpuXFm00h71msdHcj/eMzvJNnUdHXdx5tebbcOGbp6Pd+Qkspf8uqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=qyOmqPK2lLgQdke1wKJxBDTYmPcatGwNKiIl1sHngbI=; b=nrLIFZUJ0jkvgscGx6w/zPzOsRx+dPQhk02fFv4FhpAtAG9gwYFW0AFTBgC6/nMTQ/KHUscEDdwjs8XmBbsBE5D31ZE4i8VLtC4Nq/LspyMxisSRiK+wre5hG6XoyrMK3J0LuMs0m9gqEwcZmZRv1yCfx5iSRHq8Va0w+yptBdF+3hFMRm5/WL4Jdcz6N7ZCNI9zKvEvf3iSRVxKFji97SiDQ6W/HTP+41Vj+OkqXbuUJhG8ggNJdrTtSzBjGMMgXH/dzsiHOH43eyxzU0QNQPvT+E2+fA0n1iwB1irOhUs2Lmi220O8qKYGtmRtQZFqKvMc4xnVrSx0eUV7DAsoDA== Received: from DM6PR12MB3179.namprd12.prod.outlook.com (2603:10b6:5:183::18) by MW4PR12MB7482.namprd12.prod.outlook.com (2603:10b6:303:212::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Mon, 9 Jan 2023 01:22:42 +0000 Received: from DM6PR12MB3179.namprd12.prod.outlook.com ([fe80::b33b:ae28:7a27:18fd]) by DM6PR12MB3179.namprd12.prod.outlook.com ([fe80::b33b:ae28:7a27:18fd%6]) with mapi id 15.20.5944.019; Mon, 9 Jan 2023 01:22:42 +0000 From: Alistair Popple To: Andrew Morton , linux-mm@kvack.org Cc: John Hubbard , Ralph Campbell , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Ira Weiny , Jason Gunthorpe , Christoph Hellwig , Mike Kravetz , Alistair Popple Subject: [PATCH] mm/mmu_notifier: Remove unused mmu_notifier_range_update_to_read_only export Date: Mon, 9 Jan 2023 12:22:07 +1100 Message-Id: <20230109012207.79457-1-apopple@nvidia.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: BYAPR01CA0004.prod.exchangelabs.com (2603:10b6:a02:80::17) To DM6PR12MB3179.namprd12.prod.outlook.com (2603:10b6:5:183::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3179:EE_|MW4PR12MB7482:EE_ X-MS-Office365-Filtering-Correlation-Id: bb965334-697a-49ed-5d47-08daf1e00116 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k8bktNy9F/sYXoiSpZXYHFOvImiwBuivbj0lmm2K1Kh1FrAp4EAWJ7cKklLFWM8E230hZfHxyxKXiVu2O7EPEAmirLOP55RrAenhKrsEGIiKrxUDlJursMesd0W+ac/PIYLkeo7yPD+/kuOes6jTx/YT1lbQbRH60gEqzFz9jQKH7ykdi+gLpv9jbeKhmpvXvN5GrnygD0npW4MdSXKmtXQZzJcRwnmh5vl/4aBYGX4PiyL1Umb4UeNDkdmEQWmh5kVHH1NlU0GeyR4w8egLs/bKBb1YxnkULmMdAgBWUSrUQx+J6h4IXA8kxObgzoRWcfh3W46wnqGnsJT1Kp59zYgr+uaHX4slrKYf44S26HyQFmXIcC7GxUUWdotuxfpZFeVzwmpAQqtOVjpY1G9SWMjQHf62KMK5wpPfu6UPieQ8D7ujijWdcjU5JHdOLBh14NGb28cXTX2qITObyT7wnGuvDU8qX9o8kZ7dgP8868m5FrZQfAHwVIUm84vUwERuBAMFAYV+3LHpoxLIH8Xrl3LqvJFXbIUjS49yrGTvRVVG5wDQu1v4QmlVftLbPURHC+1JnzN4cybwT7HqPKKHyyYCGc9YjSdAMWTAXV6DZXMIzDG1thBXJb04Wyqm+pj38iTUKXhJbbkukIePIYC42Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(396003)(346002)(136003)(366004)(451199015)(86362001)(38100700002)(478600001)(2906002)(54906003)(316002)(6486002)(41300700001)(5660300002)(4326008)(66476007)(66556008)(66946007)(8936002)(8676002)(1076003)(6506007)(107886003)(83380400001)(6666004)(186003)(2616005)(6512007)(26005)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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zb4wtiPSB/NSCV3gu2tk7r6+rZxay5CWxxBgIXpDZA0BdIRghaTEbiAjYrYz5VGip3Tq3R0qOh0kFeeG9dE6VRqaS75KxrRYw3FqaaSN95BDXK559ypQtROLCNRaZwC7z3ZJry0QdBReN8G2ehcOi+IADhxXJ52Abu3EoVIuWokYdBA9ivJ77Wg0rosFSSWHpEsbc7bP1I6PrNx+ksLKqNDt3G+bbd3dxURkdFuUTQnSy4S5qiwf7z8DHqM+DsVq+ilhs1KyLrF+lmt1kQwqSlRrm0oe21oRlwXnZm/Nq6W3MAmnbVv/LC06fAWKDgUt/Jr7i2aMuax8jCtEkyg0AVC/hF0J6ECBMklBIV29dW87UPsOAZzIRZSsnrkactWZTH7f2WAc9Yqwctg8yOMxmtigf3OgvvXpB6HhLXXzbsOexA7Y6Aie8kRaxuU3JuAjKXD8lJEt9pMAtiAX22Tj+zICfHK4jjNqlYfCO+ReuNw34lHObtEET1LCdnm0NO4R/+edNMg56+UEMWhV6vuQMGXo9Zy+u X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb965334-697a-49ed-5d47-08daf1e00116 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2023 01:22:42.2994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5PV2ieZuDv6ErfGeV3f3IN/Z1r7g2rMuYXieUdg9zYUQlk8edRntdSUYJ5npswtcMsafOMq5ambn6wzu5uGMcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7482 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: AEB0C180002 X-Stat-Signature: x4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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: mmu_notifier_range_update_to_read_only() was originally introduced in commit c6d23413f81b ("mm/mmu_notifier: mmu_notifier_range_update_to_read_only() helper") as an optimisation for device drivers that know a range has only been mapped read-only. However there are no users of this feature so remove it. As it is the only user of the struct mmu_notifier_range.vma field remove that also. Signed-off-by: Alistair Popple Acked-by: Mike Rapoport (IBM) Reviewed-by: Jason Gunthorpe --- include/linux/mmu_notifier.h | 2 -- mm/mmu_notifier.c | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index d6c06e140277..252e44afcc70 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -269,7 +269,6 @@ extern struct lockdep_map __mmu_notifier_invalidate_range_start_map; #endif struct mmu_notifier_range { - struct vm_area_struct *vma; struct mm_struct *mm; unsigned long start; unsigned long end; @@ -519,7 +518,6 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, unsigned long start, unsigned long end) { - range->vma = vma; range->event = event; range->mm = mm; range->start = start; diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index f45ff1b7626a..50c0dde1354f 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -1120,13 +1120,3 @@ void mmu_notifier_synchronize(void) synchronize_srcu(&srcu); } EXPORT_SYMBOL_GPL(mmu_notifier_synchronize); - -bool -mmu_notifier_range_update_to_read_only(const struct mmu_notifier_range *range) -{ - if (!range->vma || range->event != MMU_NOTIFY_PROTECTION_VMA) - return false; - /* Return true if the vma still have the read flag set. */ - return range->vma->vm_flags & VM_READ; -} -EXPORT_SYMBOL_GPL(mmu_notifier_range_update_to_read_only);