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 BB426D711BC for ; Wed, 20 Nov 2024 16:20:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F3416B009D; Wed, 20 Nov 2024 11:20:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4541D6B009E; Wed, 20 Nov 2024 11:20:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A6FC6B009F; Wed, 20 Nov 2024 11:20:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0D1516B009D for ; Wed, 20 Nov 2024 11:20:23 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BB15A120C43 for ; Wed, 20 Nov 2024 16:20:22 +0000 (UTC) X-FDA: 82806983238.03.CC2CFAC Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by imf28.hostedemail.com (Postfix) with ESMTP id AA38CC0016 for ; Wed, 20 Nov 2024 16:19:25 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=d8vmItrZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of boqun.feng@gmail.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=boqun.feng@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732119553; a=rsa-sha256; cv=none; b=ExEAEKiPA6TxtQHS+ChTGiqZw3XWnqMtDKJCq3aj0FYHA3CwMp2OO9SrxGaWzbKpWW8m9d BUe0XI98W5X8e3OjEDZ1iZi4jqDzaA1QGnWtmZsccWsY2t5rvwRzI706SV5jygB+iM3rzT F7r0m68Q5+gYnfMq6IifQx9wawa7G08= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=d8vmItrZ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf28.hostedemail.com: domain of boqun.feng@gmail.com designates 209.85.222.179 as permitted sender) smtp.mailfrom=boqun.feng@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732119553; 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=wjGuNENkASJ1sxhnaZ8RtRQI4flY7dzE8vwBtkKiIKE=; b=EmY87H9OIg/1r9HvEox1dzL3uDNaoq9dcskWHo9ffadBlbKffgCyKNcN4PZZdHJE8VktCe 6ofIkBGjfgQnkQksHua7DqDRDAoZUemWMa6fkgPkJFoXfdYOL3tuYOLh4MQN03REDqyPgV ZcC8reIzO8pD2F+QyOWh3NbnzCV0psc= Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7b15d7b7a32so138862185a.1 for ; Wed, 20 Nov 2024 08:20:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732119619; x=1732724419; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:from:to:cc:subject:date:message-id:reply-to; bh=wjGuNENkASJ1sxhnaZ8RtRQI4flY7dzE8vwBtkKiIKE=; b=d8vmItrZqkIpoxb5jA6hjuPWs8wcBkr7QqqLnlapU7Dx9fl4xPSsKhY7kRiJdMEoOG +8iVIpkbfJmRJBUeJLzFHm4kFK1xqPycr4XkhbZ2CJd19OPkd84PzigMLHrMql0KeC3b p/r5+wlmOEtv+JAdcOomkG7+tuQatUZItN+awMX6LvJP/jgyiFBr5+e6Q8fojR8+oRz7 hHwZOkmkU9W8a+f+VLeAZyHctVBQ8V9BjtwIrc/PfCyaYmEs1Porw1blR6UN+X9GXWi8 FNbBmpI8dOhxKkvyIbQdNodrfZs5zcBwxWEduVBP9II4OvGOW8fU4j02ZZeMcGSo8mt4 gbLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732119619; x=1732724419; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :feedback-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wjGuNENkASJ1sxhnaZ8RtRQI4flY7dzE8vwBtkKiIKE=; b=Us5acDtmliH34G3jOQPWDsxzk41UwpcwTrsON7i74l9SiETLIiwWQgyQjPzVEgprEO LT1WleaIVS3lR6NtnghKLqLUO1eDOnc+HP8gbH5Sy+/DsTEKDAhug1KJDIMmreb6p/v4 lKbFng2ws9oAO17+a+rBjAKi94t0+gCvafc6C0Sp14qRpjAtGY5vjJ3MXS47Zht6cH2l mJPpIdQazhiz77pkHbLrhk9IDB5zPTyZOqQWViuBXlo2SqAC/zrgeF1kITV+dINBhhDP cg54auhGZIXValDalaK8mByplFJfQjbbkUbHCpPj6csY+2st5WeFscOyESK/oi34FsCY wIQw== X-Forwarded-Encrypted: i=1; AJvYcCXM/3Gavyrs0iY9DZ3OU3U3tPWNh1ST5pSPDJbHDvIIcFyAZERBLI7lEW/Ig90M3NyucsQNanO7WA==@kvack.org X-Gm-Message-State: AOJu0Yy0IQTHNPurvlBVD+ZZtSorXeJ5fqT+tdjU6n+HSuQgcRZsUGpB Q7dw8PeHPZ7U+M1kyoWnEXVn1RjA48DaxLO58VYwCN/N40inMBCe X-Gm-Gg: ASbGncuz9Xbkr0d/a3TFekr26t4iw+cR1DwwOCb1fGl/QzxD3SlfqtSANqGENb3UbrX YjOSJqInR8nV4j2zU1jkQ5PRGaT/OoBlYDLxO3PeufYIwbdJXkOWuC/7RmUfUp3Aw15Ju1tXISO jQEhe/4HBaA+mYS5ICZp9oNnPAyozYjGmQDspDsz/tMzzfgmZ7KbknZs4iuOEHLRhMwnLJn0Xl7 4wBfa+J7DS/+ENSInX8j7Hs0rnAuPg8jjSFcUA0QLG9R1DnumBhPLvJhzju3h2Tp6UhK6JFy66v a4aKZf5nyxStpv2hZvVJQv9N9R5+FhT6E/ZQIj73 X-Google-Smtp-Source: AGHT+IESUNifRorN1RtbZ2H8fTui7Tpz5Qsemtxe3GpYAt5OStXssjwkj6m6pYWlMFs31ypkbCc+5A== X-Received: by 2002:a05:620a:3727:b0:7b1:557c:666f with SMTP id af79cd13be357-7b42ee1c773mr444630585a.25.1732119619586; Wed, 20 Nov 2024 08:20:19 -0800 (PST) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b479d90cc5sm112732885a.59.2024.11.20.08.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 08:20:19 -0800 (PST) Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfauth.phl.internal (Postfix) with ESMTP id 7A99C1200066; Wed, 20 Nov 2024 11:20:18 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 20 Nov 2024 11:20:18 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeeggdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtugfgjgesthekredttddtjeen ucfhrhhomhepuehoqhhunhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrd gtohhmqeenucggtffrrghtthgvrhhnpeevgffhueevkedutefgveduuedujeefledthffg heegkeekiefgudekhffggeelfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmh grihhlrdgtohhmsehfihigmhgvrdhnrghmvgdpnhgspghrtghpthhtohepudelpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopegrlhhitggvrhihhhhlsehgohhoghhlvgdrtg homhdprhgtphhtthhopeifihhllhihsehinhhfrhgruggvrggurdhorhhgpdhrtghpthht oheprggsughivghlrdhjrghnuhhlghhuvgesghhmrghilhdrtghomhdprhgtphhtthhope hruhhsthdqfhhorhdqlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphht thhopehojhgvuggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegrlhgvgidrghgrhi hnohhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepghgrrhihsehgrghrhihguhhordhn vghtpdhrtghpthhtohepsghjohhrnhefpghghhesphhrohhtohhnmhgrihhlrdgtohhmpd hrtghpthhtohepsggvnhhnohdrlhhoshhsihhnsehprhhothhonhdrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 20 Nov 2024 11:20:17 -0500 (EST) Date: Wed, 20 Nov 2024 08:20:16 -0800 From: Boqun Feng To: Alice Ryhl Cc: Matthew Wilcox , Abdiel Janulgue , rust-for-linux@vger.kernel.org, Miguel Ojeda , Alex Gaynor , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Wedson Almeida Filho , Valentin Obst , open list , Andrew Morton , "open list:MEMORY MANAGEMENT" , airlied@redhat.com Subject: Re: [PATCH v3 0/2] rust: page: Add support for existing struct page mappings Message-ID: References: <20241119112408.779243-1-abdiel.janulgue@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Rspamd-Queue-Id: AA38CC0016 X-Rspamd-Server: rspam01 X-Stat-Signature: o9x6kh5gsz9njekc7q6rritw6juo71z4 X-HE-Tag: 1732119565-804115 X-HE-Meta: U2FsdGVkX1/FgE2Woxa7+4cmEzzWBQ0cXsmZuhefn479ph66pqdPJD1SNhsbQ0BRY1aC81WNF3bkKZwLOq4ZlaJBOWvcuclO/ODYFYsxyLrI/ouVE+dSke14cF6QYmPbguRntHFit2pBnADir5SjgD0esvAy5c172FfB1DKtcPLzNtLBsJ+I7WjCZ5jj0EVV9XKjGGYrUulY+bz+VYQ6klObI+8SYRVYbw1MYfa8UVt7iXCj+BpzBFA6vw98WBxxeR1fibR6v0g3mPAtOZVwSOPNIQHjgrLnVKPeQ1yylYfAuOcCIZP/PDgGFJlqsEeMM9Z6d5kCthP9QMXVDmrXu1eDjnVc2QE5DA9q5aanUGR85NJ4hhyqayusNdEYCh6bfScocI3XkXdaqYww9cGTt+Hox3W/2th6k74h9IgnO4/7MSLiphqwehRaAnnr/w4bhJx9eLPXRUa5pGwoPSCH+gbH7v1BOwz3rBILkEdzrnt34oL842dm3Hq2p3erTbzxTvGXbJQxXqvZ/P2CM2k5bp1vOTgO7ugGaCL+gaRYMe+jeqWmhzvtA7eiD59Toe/Vb8CaYyqFXvYmx18IkGa05qq7FfPtpqedc1F3/tRFO8XnEJ9unUnzkMFHgaTvNEVzcDc3vDrOMRDJAN+iqQEdou7fwATxKd5OIvgUl4FahZpW/ySSau6Nwo41wvOKIHuHuIag4Qu4TzPrc6xtdukRd2PBuzfp5jB4pJAnIZ2ZSs+JJpsVgfxMXex64Glls2fEO/HdnKiUrorwQ+QOQ1tCADcseRBux0D1JejefefiopbewEgzcszUZF8Wzun63iKMzFuKE37eKbG02c3KX8n0UwAiY+PR/eI7ctIsuaQOTFqlK5iAlTxLa8kqaxNjE36tpsGox1nf8P91vyH1OJ8z3MPfiF91SflMEY+RgRWwRpgxi9ZP+oI6TNWHIuL/XAaiZp0deZWnuQ9GEp1SoA9 8GVDuWZP 5GTksK4W8+Koie3iRZrbmJSQToaq2b1DO0V3/gE+N6aULL7Zd+VQtOfD9UdEfNvegwRlvNYBNiuAxotFvtWK2NRBZa+i6kSLaKoeeOACT7IektwUl+7zJHnm8f31D88r7spcHCkq1hsdAT5XEVRPdYSnDM2sGi2G/nniDUsMlAcBg94VyS/AeWujNzjZBL+b8OrhXWDfc/RpB+KaiNaT6novQA/G2P704oD8YXFJUg8YyMM+K96K4nnbFBpmWBiTIytnNf2RmgnxlUhjxPkteBSpTz7rstXuovW9uTwarWIZFuTLxK9VKTsamiLSTLgIhxs8CZFy1bNB37NkOjBBuvY6zmj/yfJrVWonSiEVikDi0HPKBXP4dxRLntSXlFU/KMcVnoiih5SsDCo2b1ImRO1i+a1VC1JOFsn5ex/chzXyyHHSTmJBRZy/PmhiN6GkrMnVDis571/SN0aBzTEqnSQjIsL7P1EYl//0+dF8EKOgmgnp3Bt8t9RtqTEAHReu7dEcr+dMC+ZqkdndLhsIMcmw5SQ== 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: List-Subscribe: List-Unsubscribe: On Wed, Nov 20, 2024 at 10:10:44AM +0100, Alice Ryhl wrote: > On Wed, Nov 20, 2024 at 5:57 AM Matthew Wilcox wrote: > > > > On Tue, Nov 19, 2024 at 01:24:01PM +0200, Abdiel Janulgue wrote: > > > This series aims to add support for pages that are not constructed by an > > > instance of the rust Page abstraction, for example those returned by > > > vmalloc_to_page() or virt_to_page(). > > > > > > Changes sinve v3: > > > - Use the struct page's reference count to decide when to free the > > > allocation (Alice Ryhl, Boqun Feng). > > > > Bleh, this is going to be "exciting". We're in the middle of a multi-year > > project to remove refcounts from struct page. The lifetime of a page > > will be controlled by the memdesc that it belongs to. Some of those > > memdescs will have refcounts, but others will not. > > One question: will the page that doesn't have refcounts has an exclusive owner? I.e. there is one owner that's responsible to free the page and make sure other references to the page get properly invalidated (maybe via RCU?) > > We don't have a fully formed destination yet, so I can't give you a > > definite answer to a lot of questions. Obviously I don't want to hold > > up the Rust project in any way, but I need to know that what we're trying > > to do will be expressible in Rust. > > > > Can we avoid referring to a page's refcount? > > I don't think this patch needs the refcount at all, and the previous > version did not expose it. This came out of the advice to use put_page > over free_page. Does this mean that we should switch to put_page but > not use get_page? > I think the point is finding the exact lifetime model for pages, if it's not a simple refcounting, then what it is? Besides, we can still represent refcounting pages with `struct Page` and other pages with a different type name. So as far as I can see, this patch is OK for now. Regards, Boqun > Alice