From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB505C433DF for ; Mon, 24 Aug 2020 07:36:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8039122B4B for ; Mon, 24 Aug 2020 07:36:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="UV544x6f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8039122B4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3109D6B0002; Mon, 24 Aug 2020 03:36:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C0AB6B0005; Mon, 24 Aug 2020 03:36:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D8186B0006; Mon, 24 Aug 2020 03:36:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 077D26B0002 for ; Mon, 24 Aug 2020 03:36:53 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B8328180AD806 for ; Mon, 24 Aug 2020 07:36:52 +0000 (UTC) X-FDA: 77184655464.20.cat11_440ddd827051 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 8ADD5180C07AB for ; Mon, 24 Aug 2020 07:36:52 +0000 (UTC) X-HE-Tag: cat11_440ddd827051 X-Filterd-Recvd-Size: 4495 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Mon, 24 Aug 2020 07:36:51 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 24 Aug 2020 00:36:36 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 24 Aug 2020 00:36:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 24 Aug 2020 00:36:50 -0700 Received: from [10.2.58.8] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 24 Aug 2020 07:36:50 +0000 Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag From: John Hubbard To: Christoph Hellwig CC: Andrew Morton , Alexander Viro , Ilya Dryomov , Jens Axboe , Jeff Layton , , , , , , LKML References: <20200822042059.1805541-1-jhubbard@nvidia.com> <20200822042059.1805541-5-jhubbard@nvidia.com> <20200823062559.GA32480@infradead.org> Message-ID: Date: Mon, 24 Aug 2020 00:36:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1598254596; bh=fQ0+/D92POi8rmal7APmpF3lFhiWzQJgt3U4odcmElw=; h=X-PGP-Universal:Subject:From:To:CC:References:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=UV544x6f4CXUb/fHE54BG1U42/SuaxsG3R0ElzOYOUdOSMuiqvtCuidVYHHjzyIMy +TNKLp8WRtC1YPrGnUIyVO4l3Ak0txN7EYgioe8Tt1GLiT8i2AjHhTmC8tlqtb1OAF LQWM9jV5qpdGrvyseDbElmej/SjlKTTCqf4RMdJye+19uKyfGvjz6nhXwZ0l5NhIoc Rr8zAmc4r0GkKRkofYrevq6oCxI+6DulxvIH85AK9iXEgg16KKFYR1zrFK0gy8WQQL Fbwka4WzfAsKVD0tOuigoAm3Bn2ZziF69E2Kpf81igaHmnJnCr34NBtA7NTUh0tdab FVE3jqr/+vyHw== X-Rspamd-Queue-Id: 8ADD5180C07AB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: On 8/22/20 11:57 PM, John Hubbard wrote: > On 8/22/20 11:25 PM, Christoph Hellwig wrote: >> On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote: >>> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field >>> was full, thuse triggering an expansion of the field from 16, to 32 >>> bits. This allows for a nice assertion in bio_release_pages(), that the >>> bio page release mechanism matches the page acquisition mechanism. >>> >>> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for >>> BIO_FOLL_PIN before using unpin_user_page(). >> >> When would the flag not be set when BIO_NO_PAGE_REF is not set? > > Well, I don't *think* you can get there. However, I've only been studying > bio/block for a fairly short time, and the scattering of get_page() and > put_page() calls in some of the paths made me wonder if, for example, > someone was using get_page() to acquire ITER_BVEC or ITER_KVEC via > get_page(), and release them via bio_release_pages(). It's hard to tell. > > It seems like that shouldn't be part of the design. I'm asserting that > it isn't, with this new flag. But if you're sure that this assertion is > unnecessary, then let's just drop this patch, of course. > Also, I should have done a few more subsystem conversions, before concluding that BIO_FOLL_PIN was a good idea. Now, as I'm working through mopping up those other subsystems, I see that nfs/direct.c for example does not have access to a bio instance, and so the whole thing is not really a great move, at least not for adding to the iov_iter_pin_user_pages*() APIs. Let's just drop this patch, after all. thanks, -- John Hubbard NVIDIA