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 567D1C77B73 for ; Wed, 31 May 2023 08:20:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9069E8E0001; Wed, 31 May 2023 04:20:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B76F6B0074; Wed, 31 May 2023 04:20:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 77E368E0001; Wed, 31 May 2023 04:20:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6935B6B0072 for ; Wed, 31 May 2023 04:20:53 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 31B7D1202A4 for ; Wed, 31 May 2023 08:20:53 +0000 (UTC) X-FDA: 80849854386.15.72E7ABE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 066C3120013 for ; Wed, 31 May 2023 08:20:50 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Gn/rRNW9"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685521251; 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=X2xqQ8QtVhR4dtUGdOzaqMX0PFWzp9qZzhrt4LUFs0A=; b=4eewyq5WNHDR3dFDdeceBtyBjlkDGFFmM4cH1FfLJl3nt3WJkimBNfZ5i87/u8hKBSJLe7 jnkJtcj3gPVjRrfG9CzKlXlU3paNnmr2AV84wPlg+fOppFk8adcvRUctsE5K1cCfXVWmNG lcp3vzWgZyU/TEgFKPtya4N6P69w7VQ= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Gn/rRNW9"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf29.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685521251; a=rsa-sha256; cv=none; b=V7XlI776vkE0UG8prkKlOD2uFQuHFK7urfDoPPT0GSk9+uSs/sFfmRVyvcy5T/nTE9btkB xjIwYglcaHi1Kc/ezFfSjlcrHQGnr455qLr2updU5uBjGtmDjjY5UKeZMUiV7h2xQNlKFw KXIP8N2VRJnMaLaAVRCcbq8PN1guek8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685521250; 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=X2xqQ8QtVhR4dtUGdOzaqMX0PFWzp9qZzhrt4LUFs0A=; b=Gn/rRNW95KVJNfpu7TNjjMaqKBK012wD1Q5z5hQ0Il0mOs5xI1PMhas6HNspMcoK1czpKy QZRe7+Aj0GhTC1H3ZcglDlejIU4sC1XiCPisKHdqCbXX+CQ3sQYnR7grcRRWXrgKRbNs23 XPwN3dX/TkEt8ER7DQNFDYkGeW7uOmY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-248-Q1l0x163N-GW70wGNxEGmQ-1; Wed, 31 May 2023 04:20:45 -0400 X-MC-Unique: Q1l0x163N-GW70wGNxEGmQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E31F085A5A8; Wed, 31 May 2023 08:20:43 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CBD0112132C; Wed, 31 May 2023 08:20:39 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230526214142.958751-1-dhowells@redhat.com> <20230526214142.958751-3-dhowells@redhat.com> To: David Hildenbrand Cc: dhowells@redhat.com, Christoph Hellwig , Lorenzo Stoakes , Jens Axboe , Al Viro , Matthew Wilcox , Jan Kara , Jeff Layton , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , John Hubbard Subject: Re: [PATCH v4 2/3] mm: Provide a function to get an additional pin on a page MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <510618.1685521238.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 31 May 2023 09:20:38 +0100 Message-ID: <510619.1685521238@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Rspam-User: X-Stat-Signature: dftpn6erpipa1foggh17itthoss1ghju X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 066C3120013 X-HE-Tag: 1685521250-663815 X-HE-Meta: U2FsdGVkX18ezL6SGmnuhVdPEOWlelLxovj0XsBumxX6Neh4OBlXKeW3uc/icdL2Qi7ACwqcz63wspdFr80mI2gAZMUSeEE+P2B4/R7fd2Kh5gjjGxHKxqmsyAaWQ42K98f+/6Cx9VBhTBlHmR5VjOBZaoLHo3A/vUSulFWzbEI/mPKiSHW5245e38FkiF64jZWG2WCPZrPisss0fRc0fROLYfh7/3Xc9WhPM268Gj2dVFJLi48DpYOukG0lJZu9ZXsTkHV6vf/VsS1jCVMV0qffrKp6ZWViyBNym0pTFZMfWXSRas9co1tLJHrW/0RvFEWuF/JJHokz0I+PgIwL6qBb4EYvK76hpzxcDRCBinxPeOKkvheJeDMKIbTrF+EzX7eN8/05+pm+yH2IIOIBejSqjtC/pc4DWjHaiQm0i/+PeMTs10rfaKMS7k3efq3+vFdjP0wCaJaeOn4GPoxaRIKWVTYYIBwSUDJhYQXvkV4cXUWpFqMYtFx2znYjkDvK3UzjbxqZFitc84qT2C31Lk8GeOteb0D1nEzyUMVcf8aeZEIhUF7jh4xuHKTDOTNIz1pJdGYtHm/mLxDn/wbN2CvA4y/7x7g2GFkUx+/NT+8PgGPcD3i38HWVrBu7ghku1DkXDyu+6N9sjJ4MF9wTIwviRBPgAicLbOqyF73r1NDcBZmD5gubwPBSfMmWobYXX8pa0BIl6XH3D4Ga1oovboVLCmnQgMZZtW3akgiGTJ0mgrxdFnkfRr7w8hElZGOxs4ply3mMekjcIsVwAk4dnBhXFRRxqDDwyvZOKJDv8+nOrRp6v0gPTVz1G9TvG8OXjPvyMFEev551UvzFAQfZtSklcAUSFpS/EFOrGkqsYlvwjE++y1sodb0+kp6mUVssod0+Vo8zQ5Cik2YKUpkSYRNyLvNVGV+4SoD1r28/1A4VvClyIBpmuhS1+BH7lbBpMUphjWSa9Jh/0RoFteR VDkRMCUl ZrPIX4ERZEJHkH4YX51y+BmE+GABMfDhKv1MRb1+jXw1dTXFassYo4ikdlysIh9LCW7NsVz9PDSzNURhdcjp05sMtmky3lruq/4yqs52EtXH3ABjZ7dQbIICJAa82otfQoQCAYUj14tLvJq6elMaEGYsV4P5n3sQ4OUtvjMaD0QZzNw8T0+Julc8TncmGagHlRYRC1iAxIiBm6/M= 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: David Hildenbrand wrote: > > Provide a function to get an additional pin on a page that we already = have > > a pin on. This will be used in fs/direct-io.c when dispatching multip= le > > bios to a page we've extracted from a user-backed iter rather than red= oing > > the extraction. > > = > = > I guess this function is only used for "replicating" an existing pin, an= d not > changing the semantics of an existing pin: something that was pinned > !FOLL_LONGTERM cannot suddenly become effectively pinned FOLL_LONGTERM. > = > Out of curiosity, could we end up passing in an anonymous page, or is th= is > almost exclusively for pagecache+zero pages? (I rememebr John H. had a s= imilar > patch where he said it would not apply to anon pages) It has to be able to handle anything in a process's VM that you can legitimately use as the buffer for a DIO read/write. If we can get a pin = on it from pin_user_pages_fast(), then we need to be able to get an additiona= l pin on it. For the moment it's just in the old DIO stuff, but it will alm= ost certainly be necessary in the networking code too to handle splicing into network packets. David