From patchwork Tue Jan 24 20:34:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13114782 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 B426BC54EED for ; Tue, 24 Jan 2023 20:34:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DAF26B007D; Tue, 24 Jan 2023 15:34:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 636D96B007E; Tue, 24 Jan 2023 15:34:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43B436B0080; Tue, 24 Jan 2023 15:34:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3550C6B007D for ; Tue, 24 Jan 2023 15:34:49 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0F3A8AB275 for ; Tue, 24 Jan 2023 20:34:49 +0000 (UTC) X-FDA: 80390846298.26.F1496A0 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2056.outbound.protection.outlook.com [40.107.100.56]) by imf28.hostedemail.com (Postfix) with ESMTP id 5C2E3C0003 for ; Tue, 24 Jan 2023 20:34:46 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=KukUuHEZ; spf=pass (imf28.hostedemail.com: domain of jgg@nvidia.com designates 40.107.100.56 as permitted sender) smtp.mailfrom=jgg@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=1674592486; 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=HnWdVLTP0vwT1IIIHq2HtqYFL5/FoBDjQ7USEOuU1xU=; b=aAbfGZBn/BKHvtr6rCpd8GrRROuUmHXIkdJkujvSGX38suchzisLdBDh1ny/Bv9qAekaK8 owxkhlUBwb+UYzDFGge/Rp4kG632A815T24FCSOm9gnF6ZXjUUTPyQSKbqDR6X2foyWxNo cU+gybz1/WPNjfcKM74iJ2j35LFoIm4= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=KukUuHEZ; spf=pass (imf28.hostedemail.com: domain of jgg@nvidia.com designates 40.107.100.56 as permitted sender) smtp.mailfrom=jgg@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=1674592486; a=rsa-sha256; cv=pass; b=dj9rSDqd0on2pUltJXKAiqkJvQ27I+J1x+/UKzY0vu395kotI1ryNA3sOWBq0CtsD0vgAd UUw+Nv5zUPctssNGvy97dEEM49gWRYriW0BxVSH52ymJ+YhDnwlpr3zxidHO0G+U8shcXL G1c9Pv+v3PiXJc/VDwJhBoU0vB4Rujk= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nwC/CeDaKg3LeLXP67NLWiFmLTp0pqsISk7Jf7UYYMJ5JwyLXw/vFrvZZH5L0Pa/pgNitJyFdpWUA6uD69Kd+U6V5qMrIjrcmaGcMufwToya3dNXnTU+opSV3yaBeGrQ/EgRUBWm8V4emuCe4PX63ljPvVNSt2tkqYtogZ/RuWGxrM2x/tO5/0hloZKXEnRlfBhRwH7YtuKTexuo5Avt2szff3obnmRFkXNctgTJUGi1X3zc0Erpd2zKUpeWxqKYqWPVl5Axa3pPaVVIBJwNSsTTiGjm7nwoGJH7T1ZBpLGbZW0cvlRD7ujpxWz1UDi9pkqmHJqAbXQ4RLkaIKaZfg== 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=HnWdVLTP0vwT1IIIHq2HtqYFL5/FoBDjQ7USEOuU1xU=; b=Ou3qUipmI68hPFM2sQwhxTnFv1KQL+XoG/wsF3nEplzZUtoyio1Ehg1iXHFHpMJ3zz0onOhsriuHIa1uswvPgTB1xIMaxZEAfr3FNUz6XoBjurgr32B9qmsVL8SFFmEAt2JJm42QJnNBmfx03jUTp38L4zo4WscHmAWZPKImxR01vz6qu7ef4uFE5MKiMyCklAdFzszBl1ngunPoQ7dbsLkX9oPleuuDntAxc1WOaogUjgdY6TXEUTWjtJQGxphsqGdN5bSrm9VaSzTMmfjkzxU/7JLkEvjJ83KhVWsZoZ8G6kYHt8z0cY1shBFTlMJM29jlZCBuoH6Bv8YD9vYW6w== 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=HnWdVLTP0vwT1IIIHq2HtqYFL5/FoBDjQ7USEOuU1xU=; b=KukUuHEZM2+149G7FdZBWWsyqhlGlCjYoNecanu7DbPZuZOHG6g2cvHNy8/ToIYr/SjjNK4RayHMqxL3EiiM8lXvwC7mkuRo4Ho/VnmqieBuIpZKkdmVBff1nLmFCAZ6cmexdiZel2dj/YQ6PSBUqqWpVr41cFMfJJiLNCBdZUFaCkt+nAo6VL83SCegPgwKqfBTqIuREwNHq8DuXVy9/cKF61NcBtuwsMOuQWgxTzDP+9Vc9Ai8rpja0MOM7Fabl8Gu9HrZEmTrb/fIcQTX0XcMcSVLt/FmVCDtIxCkEAF9bRELmp3xGXbKDr1bGFE9uDe0KjwrvDACjf2DNKrFlw== Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by MN2PR12MB4095.namprd12.prod.outlook.com (2603:10b6:208:1d1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 20:34:38 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3cb3:2fce:5c8f:82ee]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3cb3:2fce:5c8f:82ee%4]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 20:34:38 +0000 From: Jason Gunthorpe To: Cc: Alistair Popple , David Hildenbrand , David Howells , Christoph Hellwig , John Hubbard , linux-mm@kvack.org, "Mike Rapoport (IBM)" Subject: [PATCH v2 10/13] mm/gup: remove pin_user_pages_fast_only() Date: Tue, 24 Jan 2023 16:34:31 -0400 Message-Id: <10-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com> In-Reply-To: <0-v2-987e91b59705+36b-gup_tidy_jgg@nvidia.com> References: X-ClientProxiedBy: MN2PR20CA0049.namprd20.prod.outlook.com (2603:10b6:208:235::18) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|MN2PR12MB4095:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cd5f929-71dd-4fa3-9343-08dafe4a6880 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7YzL88vfbB8yZh/n7MpgkgGc6tXNublCLEn4+43jEdwfDr+lOCkhg1o0B9U7WhNAHWsvSCV8gPXnPBzg5IGEwGW1TjELYpr/IqQDrd1BSJuGYI6OleTY00SHU/FMiQ36THVTwVeFy+wURLfH3PWmOiAC7Yo2oQFvmJHimmHTK6KO/6o9Iwc1mq9Kfj/c2IU4QM+OvWYL23AToOMYoYVpeT6vsU6RTvng5e9AHPTqnJGOjo9iVwLqQ3FtEByaleyzE1PeY+StxAGReNvbqUDgbKnMO3zs+G9dRwBzvcLtTwo9iVdAfRfyYmsx0592EBtBBYEOi189NmlCOn6WB0utM7EF54NbN6zCyqlLCcj5o+ZjCop0SZV5zaEJWwmVIUjTjMh/XO7JCPMlsxqFMMWUXW/e4MRooMhiC1Z3c0jPkWBGsymU29Kro18w4zOBk085DTb5rNs94qbKfJz+U5otOfpNLsVRUzzdN4w5I6grT+kBZ9aRWk7zisDdGApHXBY/jb8kPeUDxPeZz39+SxfPvop50jQC/dmDA69teIZFe3xMOUODyB2w87XNTOOj/jvb1mw3gZ5ksQ521BMWXqEDJ2FeTc84PMSuch+A0ZBbCBURiks5P84iJdka6r/0RkPaHQM70okK0S+8NemghwTZCziPmksbpAT7moY93KdEJvO46B0Mf68gHFFkn8cHlytm 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:(13230025)(4636009)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199018)(109986016)(38100700002)(83380400001)(5660300002)(41300700001)(86362001)(2906002)(26005)(4326008)(8936002)(316002)(6666004)(6512007)(6506007)(8676002)(186003)(66476007)(66556008)(54906003)(2616005)(478600001)(6486002)(36756003)(66946007)(266003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BnfNCtecuWBQfllsAcCg7Pp778sNe2WmbxDb+Hyao6bcxhFpisqCWD/CX2uDNVnovj8LDREQqTwq8J8VbCzXsOvVfqehPieSUGIpSSBgdxUkxPccbZ+qkyqgouTW2WaLioWhFxGSP2x0howYetUeHM18dC28gACg9CTFRkEBMpi/dO9yxgVA6dR5LTeD/G7z2RO0LNnWn01XIeLakZqziCQLoQXCN/cs0EORYF6go6tQBcdnjrupyVPtMlaUDXngNjf8qHEbQQXP6Pj2D3oDvUwWbjrIUajHh/frCwyvUykRB3LefsNBilCfTv+hMOWHTPJH9KOUP8sU1qjiP00QAnqJgCq/gehtjyZ/Mm825pbl7/1yoRAvYRNDCqw30ikcMKyKRRDD2/Mkxz5TTcmP5UJeLfGurKVMHCn4Nm70Bike8BUsQRksNNJehFYcAn6crmfFM52bzO9+X+IQYTHiwTOCCKxV8oi5fO2qMqKrqsXuNQY620iP+X5IB8fBCLdC12MqZ7IemtCORBGUs684MqlMnnKfHfGe4Be+nujUddkvJxfAuQKSjXf4Ly1inJPl3NLoaRYErPPXltGD9yjJt/dMbmig2tsyUQXRIpV4rcYnLHD17+Joc4T/YaJEsgDzU5mvoMPRSA/wsJJeZlRMUQChdZmzV7rHeFEwCIfu0AwYqGB4w0ZbPJkroiSmE4HiF5iG0jSXZGud21dTB4WPvRVQI/ktsWduermsF/yA/ZSYowcPwCfJYMFZLgdVtWP9L+/XOQ++eg5YIVR3fdc7xlpy94rpl3kz583UIdfCLenX/kOAc+NPxktUWDAEsIiGS8tyzE2719piN/PKYuycR5lrejr67rKDKKheBQLIMQuIhAETwVJtOpL+96Lc+FtntZeTCWKAOPCBGnQKODDru9K6dA/SSFo0rrYBTEB+MmRMuA9co8E2WtvcRt3sGd+QHgh3rpTP86GVEliBuuqqQlvs5tyFs4rPI0lxdOqpBj3OdzCVYG+1Vp5UkiRuZFaNYWx+FsCsT+wT43tfVmVuYN6iNz7upGTZWnf07rfGsZTSF5oDSPm3LBbR3bZpj9li8M/+kxKNoLklktBZvqIhC7uo9cVoMY5RZzYjXoy9P7QnpvBd+w6eNJ8+lqte448Gi7vH8eayuuUB/3OzxNwhxWOMHuf6HqrDwIPQEmTs6MdXHIWC0r0zXdM5oFCgGx9FWb+H/vAmZ78i+l2TYI8dU0prptISkVQXgfV/eOA3o71AyBcc2sGyx3dqykiP8T78G0TyUYMGPCEgw31EFrTn0mwWzMoKTt+gW+kXzNScjWe21Ancx/FGUYa7engc7d98ADmaweQtVXm0L7g/4ec3zfNenZZ2zydaeluFOCQwVG7QnzQZwVeg595xJf6/G2zdY/HvEpBrTZZLPb3zZtBpTjCO8sK9833PTz3b+v4eQ0auSqdEMNSJqAucmeYnEb32gkUfn+fsol6lX+GSe2PLzwK2zgZ0lGl4ZX2smABY6p4L3DMABQC4MtFX2W+kFaZC9p8KNbVXYyr1M2QVewAhcjscYB7GpyQPDZ9BiQJl2BXZCGi4peVfQe4b5M/h9oKM X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cd5f929-71dd-4fa3-9343-08dafe4a6880 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 20:34:36.1731 (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: Q3icHdGwX7YBeKYvLcLoetY/bWouU+vXbswFdCQZUjX2IuivaX1V6l3cludU9u2t X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4095 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5C2E3C0003 X-Stat-Signature: ubjzfsrqj9fqx9f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97kzO8k5BXeJh0OzNZtdBI3mpJDeb5kIjCDscomH6SyOVuPK4fL/Wo1/mHusUk9ObeRBGj/4saHFyPWqk7zPCpd40ELeoHx1bicK5xK4mlBMd3tLYKdpwb1q16C0bLpSXmhZM1u5s7tfP247Ve2GT7OCcgH8Bnjt1Uuy9RDnORoST1FE+2v0T8C9L3g9WKemfCRXHuwjKjehDXVwPJmWZ9MbyNeFVigZLoRRpoIuahxEPjBzBgwP0Opum4Xdj4C5IOxgmnbLkgsrmy+q8Sp9VgXvJ3924z9JsVVZ9/uPd9CPFro2XYKdjNLr6kRtrkrtIVbA== 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: 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. Acked-by: Mike Rapoport (IBM) Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Signed-off-by: Jason Gunthorpe --- 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 dfc2a88bc4a8ed..a47a6e8a9c78be 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2166,8 +2166,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 932a2339613c2f..8edfa66277fe20 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3102,39 +3102,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 *