From patchwork Tue Jan 17 15:58:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13104840 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 9C73BC6379F for ; Tue, 17 Jan 2023 15:58:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 234C26B0078; Tue, 17 Jan 2023 10:58:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 16F686B007B; Tue, 17 Jan 2023 10:58:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDC756B007D; Tue, 17 Jan 2023 10:58:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D6BE46B0078 for ; Tue, 17 Jan 2023 10:58:52 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7D2C3C0243 for ; Tue, 17 Jan 2023 15:58:52 +0000 (UTC) X-FDA: 80364749304.14.7F12EB3 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by imf05.hostedemail.com (Postfix) with ESMTP id D52D010000A for ; Tue, 17 Jan 2023 15:58:49 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=VwQs4iKF; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of jgg@nvidia.com designates 40.107.94.50 as permitted sender) smtp.mailfrom=jgg@nvidia.com; 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=1673971130; 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:in-reply-to:references:references:dkim-signature; bh=l9eqCimBunOkyhTHJiytaKg+utKbiKcfhXDDw9h2q5k=; b=I+ODxgB+1fj3q4Z+Vd5T0QKLi0osKTLTOmLHaH7oFJIC4cr8IF5Qhoeec/ZuPr8MX089nz BNT0L2N0RSZFxJu9sOkQoQNTuda6BlRyGQrbZ9fZgVQ+8PcEurlhd7VminO8M8mSv4Q4W0 fFWvnwyE172Zwo+7m3teNUl3nRsPqBI= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=VwQs4iKF; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of jgg@nvidia.com designates 40.107.94.50 as permitted sender) smtp.mailfrom=jgg@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673971130; a=rsa-sha256; cv=pass; b=CY0vnv1m4Ljd3gQAEkd0qlVrfdQ+41panufcE0tUDujaLF65TL8Zps54ibx+mFNqDGAjsc jYpR8EmCALfmT0rFNdioNkLM853uUXq+jy7CyYc3/UUVqTdwyHF/PSOKdZ5QjNtfTKqdXo o6LClZIJP97Ycb/vXj0BgjBrb5tOdAQ= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kuQoVzYXWdilM/B5O4jfDXJQ0NeQrebzqVZPGLo5W8Yd7QYugqfcpG7DQYn65EwlUlg6IzrsYtco95zNRMfnxT4gJTiJR7gAV2WMEprgaK3gqc1IRG3kmDaVV20veGnZRQGpshHoErZ52sb9SATrscEpigk0jXmcYnwjDaNsHw9lqYSE7Wznoy1WC4lGY8Ym+YJef7JvD6FGVur/cDRYkX/wZ6nvDS4kykaAM2eOel0G+m2S132ZRrxUwcu+sh55xtoEaH09ifELIy8hguoCEFPZPxf24Vj+FDfL/E2f2Q1ZwXv8sRXmz9PZnhtncWSXQBCfFPVFVJcXMzYQgpAUlA== 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=l9eqCimBunOkyhTHJiytaKg+utKbiKcfhXDDw9h2q5k=; b=bvxYSXgI8e9KxF5LLbbgnCNw4hKWrwqoRgnz2viCZ+9FouOM41oYPmXp7fE4A6t4+0+bzNk7OJ6xMz5LJfewNgzyjVDhBUlhgrM11hPpLXQma14l5IjsN8Y6QKtpEW3P2XM6Ep5edIcLFkV/uJHx99txA5yPrejvH2PXCcwWw27gIryHTsWxbszChx/FpmzcaKzMsUw98DLO1SudcYhpHp52DtOPiAEcj5rH9sZckMclrnsfFeaUZ+XV77yIc9rsiNKoUyxVKA2oQwd/YdHBV1/z5ahDvWEQRCUbf+a3sqJCZ3dWZT0iCtrgTlBiyMQciBKEoyiE/t7XQJ+zhlu5eQ== 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=l9eqCimBunOkyhTHJiytaKg+utKbiKcfhXDDw9h2q5k=; b=VwQs4iKF/q43xpTlSXRjiJuhmQmj5JGBqUhAfN+nJChRl2hVuZ9Q58CPBxxYpbnrmCDlIRf7MWh8K8UnsHQdLPMQdMmNAzsXv745PlEAxlfLH1BcSbcFSbfZMtgTHvBHaKa9bAYtTRMbJ5wtxxCghudGkXbvBH5TU9k9cHBvIJtHQiYvMA0f8yjl403nosqubvp0KHlgHFhRYo4yRF5KTMIaLlcS+AEQVo5oTQz4YhRbtK6vvVC62jym+hz+hNWqdSzHaxeyS5m/WXJPKy1FbudO2+LD+d1hfrP6o4qaI0Ij3iDUd5a9sS33ofG/GTjzzGkHmdQteMG8BclVa56m5w== Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by IA1PR12MB8334.namprd12.prod.outlook.com (2603:10b6:208:3ff::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 15:58:42 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f8b0:df13:5f8d:12a]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f8b0:df13:5f8d:12a%9]) with mapi id 15.20.6002.013; Tue, 17 Jan 2023 15:58:42 +0000 From: Jason Gunthorpe To: Cc: Alistair Popple , John Hubbard , linux-mm@kvack.org Subject: [PATCH 7/8] mm/gup: remove pin_user_pages_fast_only() Date: Tue, 17 Jan 2023 11:58:38 -0400 Message-Id: <7-v1-dd94f8f0d5ad+716-gup_tidy_jgg@nvidia.com> In-Reply-To: <0-v1-dd94f8f0d5ad+716-gup_tidy_jgg@nvidia.com> References: X-ClientProxiedBy: MW4PR04CA0069.namprd04.prod.outlook.com (2603:10b6:303:6b::14) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|IA1PR12MB8334:EE_ X-MS-Office365-Filtering-Correlation-Id: 20a92e2a-151e-452e-afd8-08daf8a3b493 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B4UASNbHQFL/unB7e2jmQdlejx3sc3edjVxwiro63PjyaIdxJTluO0Fs5YhruMBYvLE/1kOdbkzXmxaGgEQY4oTOt9+I9sxxoG6gG/Bi/ZiSqamuNDlkeosKshEEW7CUyz/Rm36KRlb6Hzi6zaMrYx2gtgiZuEGsxVn0JZCSbIY+4I62NuIhFSbxijBSRs4hJgC5m6ieKPCEfSDaRtJVWtc/fZ9dseG9W4CHmeBq3zBHeefLqA503cuBOTeladZqcGWume8GQUqMlM57QOMu9O3UCyrgrohmnpiy0/5Zj2vVnbtt0zQWl61iWkHP04x+dls9XPmesk8WFTVHpxLUbO0q967so+JPcUCM9bArFTJjYjxTJxiKthwrNDom9BMPXMWt34VGrWHRvwdtqZSsp+18ZcnI4kihliLQnZqob2KZcSyr/BKNGiM1T82WKdCZjvDYGc5d4ZotH/TBg4osNGcOs7AoBy3fxz1odnx8+ZtDbJ5iuOSOucZEPIp4sECC5DGgpmdVJJ5oA4RBNtuxVtF97GVaS7lf/cDPg8i5f2c+YdBCjasdCdIS63hxmJn/1ddBgLR3nNXNlm5UbgkZ//kouEs9PI6E9h8Q6JgpO64+GjemU6QfnW1p5fEv5dorbWjkLUeWm+Vfx0Os6kZsRBLBv5xahEG5O2nHkfZQflLu70WBODBpaj56Rznvu85335zkTlqDNczWa6WviKGOew== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(366004)(346002)(136003)(376002)(39860400002)(109986013)(451199015)(36756003)(86362001)(2616005)(66556008)(4326008)(26005)(8676002)(6512007)(186003)(66946007)(66476007)(41300700001)(83380400001)(6666004)(6506007)(316002)(54906003)(478600001)(2906002)(6486002)(38100700002)(8936002)(5660300002)(4216001)(266003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Ch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lMkCi/OUgKZJBx7AGOkKaZknMHpaLsZYZp5wuzmF7kraJzv2NYtUa6kMl/elD8X9Y+1TQlGeIf+3cBIytqPFILpaMSyvzWvcsjjeGC4nj21PMhOtBmDlUaq86xW1PNKU7FkyUd7vPTLv16pzDV/WAvi6YS9+wY02O/84G2SqMZ9Hpeom2pDheMlanX0CHzbsU/OJDtcluuqXyhcgT6M/MW60gQtNSeld49a8KcwxE5FQ9Ta/M2ln1EWK/pIVdfI7pXjWx8SjPbM2H+mkMbMvDQI5++eLFEZApeq0EQD/Y0lhuPQ0wYjBvl8AFZ8VyVZOGKStQOMNowd9wNzU4dsNNYkZePAY0j5mvnGE36rr++U9tWy4JwIZSq1aYrLUh4HGyjm0VBVDYOqicgt5071T7PLuYU1nsZj6zR0TzcDLxVCBwoktE3H733aESVLQTQvc4WtLCcaYt+HOMFmlwM37Hw0YhgsAk//LAP1t5aoUIT5Bcw1TdKIPaOsYD23XMbS8UNPmpaMlJoUU2UMdaLPnakfQXkz2YD8HSOiZflvAkeZqBv X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20a92e2a-151e-452e-afd8-08daf8a3b493 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 15:58:42.0531 (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: /e5IYhcBmZp13fy/wCG4x4c2Ato9+qz1n65cUk5SBPShWkhaejHHDFI9gpxjQBAf X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8334 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D52D010000A X-Rspam-User: X-Stat-Signature: irje88rnqpomx3e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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: Commit ed29c2691188 ("drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7.") removed the only caller, remove this dead code too. Signed-off-by: Jason Gunthorpe Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand --- include/linux/mm.h | 2 -- mm/gup.c | 33 --------------------------------- 2 files changed, 35 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 7496a5c8acede1..de300b0de58e7d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2159,8 +2159,6 @@ extern int mprotect_fixup(struct mmu_gather *tlb, struct vm_area_struct *vma, */ int get_user_pages_fast_only(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages); -int pin_user_pages_fast_only(unsigned long start, int nr_pages, - unsigned int gup_flags, struct page **pages); static inline bool get_user_page_fast_only(unsigned long addr, unsigned int gup_flags, struct page **pagep) diff --git a/mm/gup.c b/mm/gup.c index 1ccfff759a29eb..b260c182135587 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3099,39 +3099,6 @@ int pin_user_pages_fast(unsigned long start, int nr_pages, } EXPORT_SYMBOL_GPL(pin_user_pages_fast); -/* - * This is the FOLL_PIN equivalent of get_user_pages_fast_only(). Behavior - * is the same, except that this one sets FOLL_PIN instead of FOLL_GET. - * - * The API rules are the same, too: no negative values may be returned. - */ -int pin_user_pages_fast_only(unsigned long start, int nr_pages, - unsigned int gup_flags, struct page **pages) -{ - int nr_pinned; - - /* - * FOLL_FAST_ONLY is required in order to match the API description of - * this routine: no fall back to regular ("slow") GUP. - */ - if (!is_valid_gup_args(pages, NULL, NULL, &gup_flags, - FOLL_PIN | FOLL_FAST_ONLY)) - return 0; - - nr_pinned = internal_get_user_pages_fast(start, nr_pages, gup_flags, - pages); - /* - * This routine is not allowed to return negative values. However, - * internal_get_user_pages_fast() *can* return -errno. Therefore, - * correct for that here: - */ - if (nr_pinned < 0) - nr_pinned = 0; - - return nr_pinned; -} -EXPORT_SYMBOL_GPL(pin_user_pages_fast_only); - /** * pin_user_pages_remote() - pin pages of a remote process *