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 037EAD6EC05 for ; Fri, 29 Nov 2024 12:26:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8553E6B0083; Fri, 29 Nov 2024 07:26:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 805BC6B0085; Fri, 29 Nov 2024 07:26:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CDD36B0088; Fri, 29 Nov 2024 07:26:34 -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 4E8516B0083 for ; Fri, 29 Nov 2024 07:26:34 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D55B2AED55 for ; Fri, 29 Nov 2024 12:26:33 +0000 (UTC) X-FDA: 82839055782.28.5D0ECC1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id EE1EA20017 for ; Fri, 29 Nov 2024 12:26:19 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="gJMb/ujd"; spf=none (imf13.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732883186; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E5PHdBcZ7E2Sz57KgUghDb+dnK9fhZZoK3Dg1gINpug=; b=n92uGJArHQco9D1VuziYwF71gLuLkzQhkW221aTw1S+RtBv/dz2T1i7vTau41oUPwvrS9n fo+OPFkTKzrQxxguhZ/5BNAxp73HGg4gIjfkmyPdZ3dqR85m9/ZUoiiAczVqrvqKCm4pUF uj2rssomnt8V2r0nsn2sE5OQSw5bypE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="gJMb/ujd"; spf=none (imf13.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732883186; a=rsa-sha256; cv=none; b=8Qonya6kIvnW4vkEnuFG8p8Ip21JONKdj6RamAET+c1R/gNAnm9v6HrFS4PCM/iIRdTd3/ nDApRFWICp3aangnBr5xdYPw2H6uyfiJcD+acfWfjaqjVyM1M0ps2DfOIDcuxB1GQqBDKm mANNTCXqbotbSTrt2p6dZQZWe1WkDaU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=E5PHdBcZ7E2Sz57KgUghDb+dnK9fhZZoK3Dg1gINpug=; b=gJMb/ujd6dMaig0EBXfRnzgaov 7HVZ3t5Hu3sUp6sQ9Mv4e2FeZBcK8/czH+/SJ4Sigkoj0gpw3XJD4JBB0Gf4j0QkVHtM+QQBhVRHK stx11l0OWxsI6iEmnyJ7EHihbtnWY601wy+qwmx//qoRyyZ44J8mOqcTgakVCW7RtaKBsCffYrliv rc25K2gpLMSsex9rnVqx+1uECYGUn0y4Vz1mi6eRlQ+1FcWW/WAoRXw/basVLZCaZ+9TLqZPmlDnC X1lg0LNbl1OnWH+b4RnEZq7rb3bR301B8HUI+T43kbppMvrtFJivqlLtuF2Tgoci19qjLwdb0bGms s8ONSAxA==; Received: from 77-249-17-89.cable.dynamic.v4.ziggo.nl ([77.249.17.89] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tH04m-000000040Ay-2Er9; Fri, 29 Nov 2024 12:26:25 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 1638730026A; Fri, 29 Nov 2024 13:26:25 +0100 (CET) Date: Fri, 29 Nov 2024 13:26:24 +0100 From: Peter Zijlstra To: David Hildenbrand Cc: Lorenzo Stoakes , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox Subject: Re: [PATCH] perf: map pages in advance Message-ID: <20241129122624.GH24400@noisy.programming.kicks-ass.net> References: <20241128113714.492474-1-lorenzo.stoakes@oracle.com> <9f9fd840-6421-43b5-9a12-edfa96e067cc@redhat.com> <1af66528-0551-4735-87f3-d5feadadf33a@lucifer.local> <926b3829-784f-47b8-9903-ea7b9ad484ac@redhat.com> <31e8202d-f3db-4dcd-a988-2f531b14e40f@lucifer.local> <84fed269-3f82-47f7-89cb-671fcee5a23a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84fed269-3f82-47f7-89cb-671fcee5a23a@redhat.com> X-Rspamd-Server: rspam05 X-Stat-Signature: crzruxey3echseqr5zi1681a97uh1oea X-Rspamd-Queue-Id: EE1EA20017 X-Rspam-User: X-HE-Tag: 1732883179-108534 X-HE-Meta: U2FsdGVkX1+wcFRaxO6agqhGSd3lxnu4PzTVl3rY0qvFG3dnoRhXvMQbXTkwT0KbeCWA/Lkm+G5GxQQthbo/b5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lEAIPIMjAJxr3j4yEtNuYNk1P7GKF4PXiw== 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 Fri, Nov 29, 2024 at 01:12:57PM +0100, David Hildenbrand wrote: > Well, I think we simply will want vm_insert_pages_prot() that stops treating > these things like folios :) . *likely* we'd want a distinct memdesc/type. > > We could start that work right now by making some user (iouring, > ring_buffer) set a new page->_type, and checking that in > vm_insert_pages_prot() + vm_normal_page(). If set, don't touch the refcount > and the mapcount. > > Because then, we can just make all the relevant drivers set the type, refuse > in vm_insert_pages_prot() anything that doesn't have the type set, and > refuse in vm_normal_page() any pages with this memdesc. > > Maybe we'd have to teach CoW to copy from such pages, maybe not. GUP of > these things will stop working, I hope that is not a problem. Well... perf-tool likes to call write() upon these pages in order to write out the data from the mmap() into a file.