Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5635025pxb; Mon, 14 Feb 2022 04:05:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw97l6+bBvDo5P9PVSglIvzk/0IEv1Q6U+tjDlblfNGf1G0v04uSYU0oMf9n7yJcbk8mYl9 X-Received: by 2002:a50:d5d4:: with SMTP id g20mr8131135edj.181.1644840312297; Mon, 14 Feb 2022 04:05:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644840312; cv=pass; d=google.com; s=arc-20160816; b=CM+acrY48zf/gC24gmOX/a1Mba8SP/3guIMTboZKZzhRMO9hN3l0PB7miNW8UpZJz5 Gvd1eFUyP2lvldnrwPvPe0ZVvNR4KdpqGB4BZ7syv+/IUWiVw5QjMUUloIIBPpRvNf5E kBu35XjGMo2oMOHWnsLF79IWnyMoG0uEQ4KmSd7y6oEN0b9XWy/svmutxO+rke7gR0LO JWHxR2oy9dsIRa+h8T0nIvo4v/aQUH2gq2L4kTjqdkVynPDpaskzrosAJXD4N2G71jZF uwex8QnOrxubGDJN1R8UgwjPxFSRqC+EwY7WBlVeSETQOL16kon7w6wzRiUi8j4oJKG4 DxpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=yyYAmV4EsIjanB8pRznb8Z7AreYPT9U+HB/dfTDjG84=; b=0n+lu93+Uora+L4evsvd9Z8v2lvSCWePP+tDDAW6l7wYjOiWziK5SFI3Q++8Owk0wL fS3m7HYPBDDNRQuHi7GClrm0FFQNXt+L17mJCGgVCNk4fUYNoy9Xp9odUm0wUBMjsT8i MUwTdaszTqvT28b44YUiN79z5q/aNdsZ35fekeARuBTZUmtkJ5q7DzX+QjkdDVGoUtTR UlK04SuajuL8dtPB2izR1JKRBClg0sgWIlDzruu93c4GkdrdVl2cRgQC3EwsLDqKHMSh QXodWR1K/2+xVkU59RZyf0DG5Gek9Z+h8qndFvkADXy8+hEzbm4bcSd2e1cH5m/5oNLt CZkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=OlimQKSp; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb33si4220482ejc.201.2022.02.14.04.04.40; Mon, 14 Feb 2022 04:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=OlimQKSp; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238590AbiBMWcH (ORCPT + 99 others); Sun, 13 Feb 2022 17:32:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232027AbiBMWcG (ORCPT ); Sun, 13 Feb 2022 17:32:06 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2049.outbound.protection.outlook.com [40.107.237.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FA675468F for ; Sun, 13 Feb 2022 14:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pq+dZ3EJRyYSfO/VYfX4uHUhNU6uX9lfBzw88FpdFoJIzUIr/JogU5BkpGY0Hb14QURCBvHEG7pNW4iXHGQc1vsqZoL279Cmdb70H1FAzishtJXXbEsyA2zUe1eMrBPqEnShFfT5kzKJmmPG59P9a5Hueyw3zH1OJk+RkTJQ+r0Q2CsSqKR1tnILZHMxnLoP5n02FLzEsqbyKSApgLBcgcZZTWvKb3lRSG3eactrtezUJ7XVW4il7ensVtUmahyj4uCaFZvgv+cgybr4N9jdndajq8Kmds/ok40nnsfceNH+Yc9zjVIQsx0Fkw1+PyxA1XPWTd0IY0k0XDMDeeoHjA== 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=yyYAmV4EsIjanB8pRznb8Z7AreYPT9U+HB/dfTDjG84=; b=AN8y83rqpcsLsyaqlQG50K+8zH02kSzx53DIyKZ8iPI/9kFhGjeeL3AbTHrmyZuJ/23QqQgqIxZugWb0wTtUK50XZG4KxlHvChAO7aI9NN6vgNEJy6Fpr4a6PZIUkaO6uE8ka3uO7tOWIilDyefe7R9720xnrTvgnTH4vAn0FlBApRV/HBPRwEbcBjh8gFT/bMYIV4i2CDzewNxhC8qWc9E1jaOY5DPcyyGEVFW5yse1e/8iaviEOfk1w//FvKvlUoACv3/xZ9ts5ngqgB1qxDuT2TisFChkg0B9MzxKFFqgE3RHNGJHJu4ceXHstLx1O88OVHQz3QDpsUUQoq0Z7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=yyYAmV4EsIjanB8pRznb8Z7AreYPT9U+HB/dfTDjG84=; b=OlimQKSpWEhd3wolm35vtOmGZohoG6vUAQsoay2kgJAWnL7UTbxTM+NWFfvNYUCu3AeGZuUmJ0p6bGREOs61vbYSMEUVck513Xckk9PcErUEZcZX1qWwjw0nDcGeKC0Cmni6cuZCKInSRSohp2BJy9y0+U+3WdGL2h77t5cLilZTP5mey1GN5xZfPnfdAlsSo6iYkbEKhJiZb31IDTAPZ88pdQJssvGdc9mpaYRSak9NZFZALifcqi9OaC1CGyKxfs+2Eubkeo5kRQrfsflczwXPHR7X0S78oX8Eu42dBTa4i5lCE+UmbGYW+Sqlfr/ZnQV8KFJx1BawZ4idJnQqpQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by BN9PR12MB5034.namprd12.prod.outlook.com (2603:10b6:408:104::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.14; Sun, 13 Feb 2022 22:31:56 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::498:6469:148a:49c7]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::498:6469:148a:49c7%5]) with mapi id 15.20.4975.014; Sun, 13 Feb 2022 22:31:56 +0000 Message-ID: Date: Sun, 13 Feb 2022 14:31:53 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH 00/75] MM folio patches for 5.18 Content-Language: en-US To: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org References: <20220204195852.1751729-1-willy@infradead.org> From: John Hubbard In-Reply-To: <20220204195852.1751729-1-willy@infradead.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR03CA0024.namprd03.prod.outlook.com (2603:10b6:a02:a8::37) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f1e465d-d908-4334-9bfd-08d9ef40a445 X-MS-TrafficTypeDiagnostic: BN9PR12MB5034:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NIHJ98k3AlPI1IpsT33wamuCBSEFUYYQC76uYgN45sqL7U2zbMYY1xHZ862cORJm6+naeSI09HLTlzPcB4sgRkTvvDKnzZgLN9rF6rAHSEHa8mTDKqvTHJhjD8UCd2gFWWYwEQKKIUouCyOgrnhlHUD/0PRcf5Lrje3eLA5P2IiA6QuMrB4VCnnngvRt0/Ro+A+yFTk5J0VpLDI+GX3jSMfHPqoc/vdpsMl6mSAaRydfjtG8t6oWjqrBpDSGTeHM8fr3B4bSwNVV8m5KqKYd/QilTucCPXsq5csmGuK/6DhwCyOGovS61jnkuiEE0Rso8VM4cGKhgF0wS3gffDTC/Lt9CMa1GKbtQMxEn3lP46UndjZR0keTiuSE9JTkdxl6Qsh4NzEVxzqy3x/7M+qVA7+H3+yscbvyFnYf4gS0GVjtDkNLjXftWHJ/UfGXAvZP22G1fyylTegOBkZgky31USeqqYmRs4jLa6RgDhTy13KzMpgS9j0PtMw/xkj68jC2tu2Sw+Efkit/NrYpo4lrgyt2LrjhsNJJHG/+hoN7Xv5ZaCwYnZz8uPhHMqgj5mGoY2VcIrtM6GaemJ2MxPKKWUA8eonTT8dztUx12kMZHR70EWtpHC6iuHLyR7/u2f/7DuQdDMVzaFwGPIyBE4CUUrxXtUoEyXosYbsvINBFIK1sCCp9V6bVurko+UVYex7dlf8dG5hGfXWQjwHV5tc4FfqEH7l1de391aIrYkBmkEhr+7pvYyF8HVX1RZz4q/zUnXotkLsfEZgTQkcD/3NSJ4GsctLcPdG6oEh4ZtAM+mrBzeg0RP0T6OZ94w1eEu47VdF7Eh8k7PbQt5I0VjTzgw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6666004)(31696002)(86362001)(6486002)(53546011)(2616005)(966005)(316002)(31686004)(36756003)(6512007)(8676002)(66556008)(66476007)(66946007)(6506007)(2906002)(38100700002)(83380400001)(8936002)(508600001)(26005)(186003)(4326008)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OFF6cVlDNTEzNS9uaHBXbEJNbUJnSUgvUmlzZEx3UFU2bklMSFdLOGh4cExZ?= =?utf-8?B?Z0UrZThoQ3gwaVN6cW5sMmlTNnIxVGtHN3lIb0tPdDZJZXhFR2EwQWd3ZDdX?= =?utf-8?B?SVpNUzNxdjE4c3VLZ0pMY01tYW1xZUdXa01wdXcwb0hnSkorVmpMTmQzTWVt?= =?utf-8?B?TFlVcDNaZk9yU3d4R0hDdHduNFRjSlloWDlYWm9rMzJuZWlpL2VvWDNyeXFB?= =?utf-8?B?Q1J4emx0ZXBaL3JoY2haZ0ZBWVYxU0hiWmdFeEZUbDlzZ0lYNng1ODFKYXZN?= =?utf-8?B?Q0tkQjdmK3did2hXbWU2L0JkS0t6clpqcUl1M2FvNmt0bm1DM3NBRmdyM0tu?= =?utf-8?B?Wmh4Qlowc3FaTFlpaFZxbXdGUmNNS0ljLzNPZ3ZZZTYxUnV3RlVDbkNTZ09v?= =?utf-8?B?SVlYNHdqSzhHVGZIY3JEbWF4SlJtdHlKNFh3WWYySWZYTGV0am5OYVFmQ0Z5?= =?utf-8?B?eHBraFhlS3I2SGJkaVp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rossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2022 22:31:56.4949 (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: jGLGD8ovzcGqljMw60J/AhUlnCrfEGpPrQdfrtdKsOv82wq0xIverPfppOqBVxkZirYVHxW52tB7US5MEqqffw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5034 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/4/22 11:57, Matthew Wilcox (Oracle) wrote: > Whole series availabke through git, and shortly in linux-next: > https://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/for-next > or git://git.infradead.org/users/willy/pagecache.git for-next Hi Matthew, I'm having trouble finding this series linux-next, or mmotm either. Has the plan changed, or maybe I'm just Doing It Wrong? :) Background as to why (you can skip this part unless you're wondering): Locally, I've based a small but critical patch on top of this series. It introduces a new routine: void pin_user_page(struct page *page); ...which is a prerequisite for converting Direct IO over to use FOLL_PIN. For that, I am on the fence about whether to request putting the first part of my conversion patchset into 5.18, or 5.19. Ideally, I'd like to keep it based on your series, because otherwise there are a couple of warts in pin_user_page() that have to be fixed up later. But on the other hand, it would be nice to get the prerequisites in place, because many filesystems need small changes. Here's the diffs for "mm/gup: introduce pin_user_page()", for reference: diff --git a/include/linux/mm.h b/include/linux/mm.h index 73b7e4bd250b..c2bb8099a56b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1963,6 +1963,7 @@ long get_user_pages(unsigned long start, unsigned long nr_pages, long pin_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas); +void pin_user_page(struct page *page); long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages, struct page **pages, unsigned int gup_flags); long pin_user_pages_unlocked(unsigned long start, unsigned long nr_pages, diff --git a/mm/gup.c b/mm/gup.c index 7150ea002002..7d57c3452192 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3014,6 +3014,40 @@ long pin_user_pages(unsigned long start, unsigned long nr_pages, } EXPORT_SYMBOL(pin_user_pages); +/** + * pin_user_page() - apply a FOLL_PIN reference to a page () + * + * @page: the page to be pinned. + * + * Similar to get_user_pages(), in that the page's refcount is elevated using + * FOLL_PIN rules. + * + * IMPORTANT: That means that the caller must release the page via + * unpin_user_page(). + * + */ +void pin_user_page(struct page *page) +{ + struct folio *folio = page_folio(page); + + WARN_ON_ONCE(folio_ref_count(folio) <= 0); + + /* + * Similar to try_grab_page(): be sure to *also* + * increment the normal page refcount field at least once, + * so that the page really is pinned. + */ + if (folio_test_large(folio)) { + folio_ref_add(folio, 1); + atomic_add(1, folio_pincount_ptr(folio)); + } else { + folio_ref_add(folio, GUP_PIN_COUNTING_BIAS); + } + + node_stat_mod_folio(folio, NR_FOLL_PIN_ACQUIRED, 1); +} +EXPORT_SYMBOL(pin_user_page); + /* * pin_user_pages_unlocked() is the FOLL_PIN variant of * get_user_pages_unlocked(). Behavior is the same, except that this one sets thanks, -- John Hubbard NVIDIA