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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09DE2C38142 for ; Mon, 23 Jan 2023 13:24:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B8DA6B0071; Mon, 23 Jan 2023 08:24:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 569406B0072; Mon, 23 Jan 2023 08:24:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3E2D96B0073; Mon, 23 Jan 2023 08:24:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2B7416B0071 for ; Mon, 23 Jan 2023 08:24:21 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EF35F1C5F0A for ; Mon, 23 Jan 2023 13:24:20 +0000 (UTC) X-FDA: 80386132680.01.1E32747 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id B84F1180010 for ; Mon, 23 Jan 2023 13:24:18 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ABUoA7dZ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674480258; 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=aAf3V2MVK33/cJvKp6aHY4bpR+JdJT/jLy/3Pm1O1K0=; b=ti+YNt0UY2Vfqrhza/nFvt2yKBzoT8Bc+HO7IpIjQl4z/m1VCrWoL7SOXtR3EimnFYAa0G A1dVF5/p0ny+mqtMpOQPyCr7Lx2V+WqgaLVMrLFxnSnl1WSuznUAjFcF3gNU3JPEThlz0P wI2aptjvrJBTRlxhWad/m3pWk2Cnex4= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ABUoA7dZ; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674480258; a=rsa-sha256; cv=none; b=H0f+1U6F/kB7m7+hvdhZ8PVtxq0+NzrxuW++nTCV7oHXj0Tydwzt9RMrJhFSGXQwihusCf aIaggxjPO1KfHLtcioCP08LcSCW1Jfnkp1V8UwKlHdsbyP8SZ1N0lqjC6Vd+2wn0r7xN9C 0ya1Gu8BH2cKgPxycnCiDPeQCWh/qD4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674480258; h=from:from: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; bh=aAf3V2MVK33/cJvKp6aHY4bpR+JdJT/jLy/3Pm1O1K0=; b=ABUoA7dZVgPO+0EA24SP9pZYodFGyhQi78lfolcQ0YycbFn8VVj9/nj59jnJ5fK5As8LME TwxzoisnBmO/JumpJ52sNR/BGDzBV8DRYuiVBa6Ms1KMiikFNQ4y9OjgYzSZnuuheEoI4P BHVxLY96Pp7x+cpyqCSsHCJMJ2deMAw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-622-i5FAlIkLNSKBxfQ31iU9SQ-1; Mon, 23 Jan 2023 08:24:16 -0500 X-MC-Unique: i5FAlIkLNSKBxfQ31iU9SQ-1 Received: by mail-wm1-f72.google.com with SMTP id n16-20020a05600c3b9000b003db127e03c5so3372888wms.0 for ; Mon, 23 Jan 2023 05:24:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aAf3V2MVK33/cJvKp6aHY4bpR+JdJT/jLy/3Pm1O1K0=; b=O+6K+Km3xovPvW+JGP8YkHrqtEFgM5v+eor1FQIEYjs9q1UhAS7SHnVn1JKAQqOhwF UU2VIiKUxTTIrCD0/d2IxDony6H/7E2yCxWoFTHJ4wLOm2WtLJtLDXLNcr3t+uAHD2TO itSM2BkbSIYLPAL/LTFq1uXY5latAimyLLsqV2hztrX1jMtkQFCF5yo4m3WtqS2sU9rU +23kmxkS1c0o3MJA6zGFI7kjDpgFmG4BhLLKpezf4OpcvDx+JBRg11yKy7lRhOsA7AVc rC+qNJFiVsKY3rY88Vds+0gEyS+Wyk67mZMWnAtkr3fSe0VTD6dNMYIz5AsZuD8qPTeK esYw== X-Gm-Message-State: AFqh2kpcnvZNInsvSvGfnnC5xzCdzvo/PqE1E1/r513gy/3WcFyLj4Ld qCbxQ04FlyDWIRr3jKTU29TNVcD2IL6qGzb2R0BcYZvIDnFygDxxgFIkskMMXXO/LmNee74ZkRW RhWVA9z4ZfBY= X-Received: by 2002:a5d:4dc9:0:b0:2be:21fc:ae3 with SMTP id f9-20020a5d4dc9000000b002be21fc0ae3mr19258709wru.11.1674480255379; Mon, 23 Jan 2023 05:24:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSy/zF5gTuo4Pty91+hnKwsIVtv4UfaZ96iv4w0a9eQ3v+gYxG+33cMyS8lFosJqrFvgcRYQ== X-Received: by 2002:a5d:4dc9:0:b0:2be:21fc:ae3 with SMTP id f9-20020a5d4dc9000000b002be21fc0ae3mr19258685wru.11.1674480255115; Mon, 23 Jan 2023 05:24:15 -0800 (PST) Received: from ?IPV6:2003:cb:c704:1100:65a0:c03a:142a:f914? (p200300cbc704110065a0c03a142af914.dip0.t-ipconnect.de. [2003:cb:c704:1100:65a0:c03a:142a:f914]) by smtp.gmail.com with ESMTPSA id n13-20020a5d67cd000000b002bdcce37d31sm33258092wrw.99.2023.01.23.05.24.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Jan 2023 05:24:14 -0800 (PST) Message-ID: Date: Mon, 23 Jan 2023 14:24:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v7 2/8] iov_iter: Add a function to extract a page list from an iterator To: David Howells Cc: Al Viro , Christoph Hellwig , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , John Hubbard , linux-mm@kvack.org References: <7bbcccc9-6ebf-ffab-7425-2a12f217ba15@redhat.com> <246ba813-698b-8696-7f4d-400034a3380b@redhat.com> <20230120175556.3556978-1-dhowells@redhat.com> <20230120175556.3556978-3-dhowells@redhat.com> <3814749.1674474663@warthog.procyon.org.uk> <3903251.1674479992@warthog.procyon.org.uk> From: David Hildenbrand Organization: Red Hat In-Reply-To: <3903251.1674479992@warthog.procyon.org.uk> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: B84F1180010 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: yyejo8rh1h4f9pxmk8fi8othcto68snq X-HE-Tag: 1674480258-741091 X-HE-Meta: U2FsdGVkX1+Q/sZ6AIuvfn71YCfvrDqTUmhZ6zTwXmboV2yjDdbEqxCUul0XnwQXei33raxk2h89iluB/5mieBiMJUWcINiQsVCtXl0trnQvwcqcGMpdR4lciWgrJeoV2mw8B9oD7sBqEqgDMXGEw8gtlyjd7L9UPhJTmPjwRk6YxYBlGyjlZzv41kthp/l84NTBPA58OnCUJnhuQvA2r5LGg9LWHcNupwMTMiym73GWE8augWhzwR3a2bMJpLCnYR6h80bG+hwaPdmwNNu6zTZTnDpgP6Kn8fnfRniZBqqsMNKATAzJiRT9H+dI0t7YhRpzbAwfhZib2GGONXdLCZUgj9n7HEkNvivCGIYiK4TdhM1e8aHaEirTHwsA50ScVPSUtiu3PVGd4Cst8RGM0zKC1ETcL9SzwHUXJqJ5xBPiQXUtex9sOKogNL+4ZgGHx1YD0nvaiFoQU7rA12npWXaGyQJ9fdReS+U6KFAi3VPYD6KDq9OngfMpZvSX1u93ZYvmsGJ1YvHjbWFLwYEw3KpUFtyrk6vPlLga8Sg6c2g3dm9Y/P1g23RSuibadW5Xf8m5ASwO2vZRGZ3/fMEgZ15UtGP6mPR93cXadxWXdOyKM77bDYfgctJJoqQwsCnYyTUgIposVfo1NGvF3zR4S15K1NRzrLPygWJVklVMLjYCMKZRd4OHntsTPuzOxigJkq1fsFrWfsmLTuimifVr1g0WSRqU8BtSYgBfUgawwj5277EmZ6PPZ2rjOVjNcLnAcFwAWxUqFz5xBy67SRCDYGWtov/fIUNc2lzr7xppKXwtJrr7v3BNiZJAp9u70apxIaxVIulBxpsEMhcUKH6BHL4TG4A0ozFVSZFawa1Y4xfXHF95eybQsYAYZ9TXmXvOX68LlA29I/6brG8pbnNry47pWGljtzdObvZZXH2gI4ixzQlnSrW4HBb0hFCT9MTfmzS9zq5l3H+82T2SKC8 fP0VSrgk /mcuFCsJ22DQpw18+XiCEddDvH59wlHdRbL0PkMtglxCo7xE1w0p6PdI/avfUnbj8tCpT5lnwSqwe47WizBUrKS/ivWTpmVEsEJzqsYSNBa9BVFotBxHfz7IdgKYb/pIZpiR8fCAzffJ+mUSPc0rRxUwF2iiue85UXB24uquk/cQfLC7dWk3NSdJNR+ELX8m0cKLF9FYcNj2plc9EIxVQkyh3Wqnr0BDTMjTuFgl5FF5qel1li3QyPp3goPNZ9MeZ5N/2kWQz3IUIx6ZHSpnfOc/K8YOKhiRB28pQD5agWoYCR9nXfNaZgnSZKyUD8mB4pOb0ul+f3UtKImUiNHNj272P8URpYoOzyXlBumtdHUGSHL+NUKG3+UO9OTqBb/felBpL+tbPNcFYf67Kg/5itrQPpZjqHL4UoqNVtnOJ2M9e8fRNhPKfiEMdx0RVUXrughDGh5CV52DmMEN+lOS2BtQtR6yu7Ghl9gVuZb8EFRFazQ6kUUsDm/kWlEmBplG6ujAWNPJDk28GBaTLeab5LddEAdB/emSTzuOq 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 23.01.23 14:19, David Howells wrote: > David Hildenbrand wrote: > >> Switching from FOLL_GET to FOLL_PIN was in the works by John H. Not sure what >> the status is. Interestingly, Documentation/core-api/pin_user_pages.rst >> already documents that "CASE 1: Direct IO (DIO)" uses FOLL_PIN ... which does, >> unfortunately, no reflect reality yet. > > Yeah - I just came across that. > > Should iov_iter.c then switch entirely to using pin_user_pages(), rather than > get_user_pages()? In which case my patches only need keep track of > pinned/not-pinned and never "got". That would be the ideal case: whenever intending to access page content, use FOLL_PIN instead of FOLL_GET. The issue that John was trying to sort out was that there are plenty of callsites that do a simple put_page() instead of calling unpin_user_page(). IIRC, handling that correctly in existing code -- what was pinned must be released via unpin_user_page() -- was the biggest workitem. Not sure how that relates to your work here (that's why I was asking): if you could avoid FOLL_GET, that would be great :) -- Thanks, David / dhildenb