Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp435796rwb; Thu, 22 Sep 2022 21:37:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yydfKCjtk28WGf42uGlxA3g4o+HtgTTCuOZIznubWqgWzx1mM9meagMNTjc9W1OmlzuMV X-Received: by 2002:a17:902:8307:b0:172:e611:491f with SMTP id bd7-20020a170902830700b00172e611491fmr6586324plb.111.1663907873434; Thu, 22 Sep 2022 21:37:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663907873; cv=pass; d=google.com; s=arc-20160816; b=u8M1IYcLYZTwGfqjI7LW1d5TfmbvgZJhUOTwtZF2tMvb96Y4rDlfWocDRDnh/lwkzA tKmM1IG3hrdDmuiIL/kseUDl74HcTcj31BWEeMSE6d0CmX/diU8o9MBsMGh8PkULQWh+ i7HmoxaMcbAtjzcnc+UWNdu8eyb5hpMDZ1t8VRruPkuRH8Zlpnzp/cxtqMqj1IvKM92A XbgY/UbTtopa3kK9X/kZk9ursC/Gyq5xvVnOPFiFVkTLztVdMYBxYNpG0qbl0DB5X9uW hYAUycGUJV7mPWF0Rcv98CbUlbhnE++1q2LE7bK2WR2IuztW9EYisyFPG3ugD6K6WdCa v/mQ== 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=s71ycgE3YSB9J0FOZcfERbK3D2ZGqm7PEvlIVQPQSvM=; b=gRzpWpwmLXvamNNmJn8kx88W3EtyisPn7MbbLryWRAzejRd0b/lBJWnEcA5HNbEHnP 3y2vyEJaFxNW9u+Fmkdh2P3V5MvFO9OA+ihy1xGMrOMiOGNNkM48LKWDQ8+ZK5JObMSz WV+wTUIMSZa1UNTEAMqssjGJSwUVA6I9+Sk/dh557tLo2UGjFXYkgDD9CGgcCeu/4K93 zROVKX2EoHwWymcW3fguCbO4TTocJQB7iDrWMDadZGYV1TRryhmQ21vBcJ6rJEcIzu9j fs/z1l2gilF1xm997OGsQwzbA43wprI2j2eNzuTTPozVLOQ+vr20Y7YQm5TRy6dTuFp2 Xk/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=KDLYDHNE; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 m22-20020aa79016000000b0053e7a11f6d1si8100450pfo.91.2022.09.22.21.37.36; Thu, 22 Sep 2022 21:37:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=KDLYDHNE; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-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 S229568AbiIWEef (ORCPT + 99 others); Fri, 23 Sep 2022 00:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiIWEef (ORCPT ); Fri, 23 Sep 2022 00:34:35 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2071.outbound.protection.outlook.com [40.107.92.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CAF92679; Thu, 22 Sep 2022 21:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dJ/E9YLSUwYPPnNfq+tfBDLgpAO/SRu6MVKe14N2Chy54epRAD6yusBNMq4D2vf3Je79hhgZZSH8ZLTGwQyZviiIICZgGr+EVYWrswiwviBkQx3YrpbtKZpMYYLsViLq3p/WBUzSlRtGJl4jDOjjjmh81KDd5KH2EsjH+59ne3pl7njJWxRqFzwUMVcQgmM3XH/Y1785Uty2+SBUzRSxenxm0dEVH7BoXyXMdKn1QGXER6SU2BpXHadq8R6V7f+cOVUxqxfg1HC1XL/8hsxMrNzKHfllOctwNaa6C8lCRsB+eXgz3SO6NIlMMoW7vQMIR4uCH5Bas1rB4H6fNfQ/rA== 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=s71ycgE3YSB9J0FOZcfERbK3D2ZGqm7PEvlIVQPQSvM=; b=nBWey38hwWX9BLWlgKIPxaCNlP4uMgdiFG/s6hIDnPYC/8JIyFJbHqy7ToWrpOD8K5kqBJDRFjptyD07n+PQOocfeR8l4h6ti8NocZwIAv/QDbEJU/z3uF/PYYqCvwmYUrBVhuqT96dbw8Yr0JBF0akmzO5eMK0Uj0TMOSN+SEvHskLQUGo9EHMk6s0CxH+1jPfJ3N9itB0HukwKFfztBXiKIvK/vuScpl9d4umtDLPNuHnhfYTv6u8nv8nH2KeWgv3C7iMyjHyAi72n2+ubIVadtzexqsh+m09LsUJWDqshYIrhDyUUiTYWCD0k5BaG/lhhFeMSQofmrQQVOf36CQ== 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=s71ycgE3YSB9J0FOZcfERbK3D2ZGqm7PEvlIVQPQSvM=; b=KDLYDHNEVHVDSad1NUBQh4K3QxuJyiXNeuuKg1aiLoMxKMWg5SE8JrgDTG8qIXJsgX0CWwT4wDk9k/UqrPjirpVoy958eQvme6L8ARnttVKgg3nA0n4FGvW2uJjhNgNI9Z4augPb3ns73v/qt55RXYX60kf8QQFbHJarobUe+mcKmXHdgF+yiAO2McCgypxX535edK8Vp4ZR1479At9JINEtB5g/am0epGvCyClOJoRuHrtS+a+6WkSJUAHHoet6SZ3fWeqLvXN/LHo2uW1z4RonjirZ4ZblRgFZIQk9hji/5h03wZi1B4WAf2rcYW8lj3uitMhN2fFXL8FxrB9dRA== 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 DS0PR12MB6605.namprd12.prod.outlook.com (2603:10b6:8:d3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.18; Fri, 23 Sep 2022 04:34:30 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::6405:bafc:2fd6:2d55]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::6405:bafc:2fd6:2d55%7]) with mapi id 15.20.5654.020; Fri, 23 Sep 2022 04:34:30 +0000 Message-ID: Date: Thu, 22 Sep 2022 21:34:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 4/7] iov_iter: new iov_iter_pin_pages*() routines Content-Language: en-US To: Jan Kara Cc: Al Viro , Christoph Hellwig , Andrew Morton , Jens Axboe , Miklos Szeredi , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , David Hildenbrand , Logan Gunthorpe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, LKML References: <103fe662-3dc8-35cb-1a68-dda8af95c518@nvidia.com> <20220906102106.q23ovgyjyrsnbhkp@quack3> <20220914145233.cyeljaku4egeu4x2@quack3> <20220915081625.6a72nza6yq4l5etp@quack3> <20220922112935.pep45vfqfw5766gq@quack3> From: John Hubbard In-Reply-To: <20220922112935.pep45vfqfw5766gq@quack3> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR08CA0062.namprd08.prod.outlook.com (2603:10b6:a03:117::39) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|DS0PR12MB6605:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ca31e1c-2fc0-4674-6195-08da9d1ce7b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sQftdA0+M+FBmjMhq2m/hGHU3I8VG6TXPBcOTH0d8Vz4qPE6nXsSaIz6mEuXfCHUSG2deKOOY+i+fdY3wifKSvsmyuK5UXg7/xnkuNieE09fssz14ADhH/lKxsNouIJ57dj3icNoOH68O2UiOhPniTCs8MRk+5+vVHpLF7PO7wmijE7Ja/bhtEgklg3cvFhMsyVvUhmLeJvuR/tR2G6vS+9s2SMAmYrwnrXWbiuSeE+VCiLkaN2k04DDSxIgX8UWdSmUKNZ87wPiU3JaWcTSKKDTog/jpkkW/aVJtSwSN4rkVGepAWZyajIaxuUPkQs5izy7hwlbxBinalCs9uFOjBEQh5putg+dYQuWzdsn+6KKdN4ZP6TO3RBlK/FEAn8rtwQsh3xLRdotivbM7KhyW5vajXKLjEB2iAq1QzWbIwHR/wKTVGA86Jkc6hLQBCECZOXw1Lvv6nRPUikjFWgZw0JBiwiLHMqZp5WxPt1jmXzvy2EA2UnzM00LfCIl671qDzUZyWcKK8hVUBWpEWYmMmDP83XuzHwGOg2gTavKdGf6BNt9xK0CyfRs1pK1a1v4GMVd9NzqiDyl26AeKtbhaNBcWI3YNDPL6MbTtuDPdtb9oCQ7f/Ue4TOk6AZ8mgPT8BistX+N6MhS0u9BgW81+yRtpV0oHENY05byYkxTN7J53/CT0qbmUb9BDar6ugHrlsXgFwCtPzmUpgTANy9YhoclsH18IrZW8lH0+J8h/kQ+FWGHZG3fsbthC7oFm8njd6V0FNWfhtob5O+y1oib1H3/9kkkcsOapiOQQWZwJII= 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:(13230022)(4636009)(39860400002)(366004)(376002)(136003)(346002)(396003)(451199015)(31686004)(36756003)(2906002)(66556008)(8676002)(31696002)(4326008)(83380400001)(38100700002)(86362001)(8936002)(7416002)(4744005)(6916009)(5660300002)(66946007)(316002)(66476007)(186003)(6486002)(2616005)(478600001)(54906003)(26005)(41300700001)(6512007)(6666004)(53546011)(6506007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SzNtcGlFQlFzK0tCbkQxZUYrb3FHTWhFWE9QbkNSSFhrMzllQkdwa0ROQ01J?= =?utf-8?B?K25WMWp0RnVrTnVLTGdKTjUvb3hLaWlSTDlic2NlYzdmSjF3Rm5TckliTFNw?= =?utf-8?B?UllsQWxMNVF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vNklMMHpO?= =?utf-8?B?by9oWERZMVo2Ykx0aXJNWGtnQ1p4REh3WjZMN2JnZEFRNG56U1VxaVJ6aDN4?= =?utf-8?B?OE43S2FYQXlPVTQrS2s2RnVoczM3SjNGdHkzWXFxZUM3NEY0dkFTZVNVcllq?= =?utf-8?B?Mk45WmdreHFYQUlYU0FENXB5WCt2NVJKSjJJZk1oekFkTFhVNDR0ejZQT3hl?= =?utf-8?B?Rm5CN1g4K1FQc0lYd0JIbzg2Zk9nTTJLdkJGTDBqZjl1SnpKeTN1dWNMOXYw?= =?utf-8?B?OVE9PQ==?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ca31e1c-2fc0-4674-6195-08da9d1ce7b3 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 04:34:29.9690 (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: KW2N3yXvFat5zJQzIXBT/rCemUAbZQunKdHDKX/HD2W5zKd9IF5a4l3VxrA2fFjPFzVY2pjiImv/RDkhhQPecA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6605 X-Spam-Status: No, score=-3.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 autolearn=ham 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-nfs@vger.kernel.org On 9/22/22 04:29, Jan Kara wrote: > I don't think this will work. The pin nfs_direct_read_schedule_iovec() > obtains needs to be released once the IO is completed. Not once the IO is > submitted. Notice how nfs_create_request()->__nfs_create_request() gets > another page reference which is released on completion > (nfs_direct_read_completion->nfs_release_request->nfs_page_group_destroy-> > nfs_free_request->nfs_clear_request). And we need to stop releasing the > obtained pin in nfs_direct_read_schedule_iovec() (and acquiring another > reference in __nfs_create_request()) and instead propagate it to > nfs_clear_request() where it can get released. > > Honza OK, now I see how that is supposed to work, thanks for explaining! thanks, -- John Hubbard NVIDIA