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 545FCC54E65 for ; Thu, 22 May 2025 15:32:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA8696B007B; Thu, 22 May 2025 11:32:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C319A6B0082; Thu, 22 May 2025 11:32:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF9476B0083; Thu, 22 May 2025 11:32:23 -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 8D8976B007B for ; Thu, 22 May 2025 11:32:23 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3BB8A1219CD for ; Thu, 22 May 2025 15:32:23 +0000 (UTC) X-FDA: 83470935366.14.702FCBB Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf12.hostedemail.com (Postfix) with ESMTP id 8B76140010 for ; Thu, 22 May 2025 15:32:21 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UPOSeoVt; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747927941; 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=KChbWjeMiSdKtizRukYMZF17kp6/+t0VqG1CLPcASdc=; b=YvKnX8yLs9XEgjYhf+3q/ywRhJsbc3/Zy3IshqYWEXK5yUIJ9ZExm6vffo2YGm3CflYkrk msAhYOHj+okkvwSex2ILJKF4WIHrqz2Vs7cCRbWSBnyDR137nfnnBZmr3uj0Uq1vFp9UPd QMpbnd2VdWocl0iQgQWNxTUVuUV2eHM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747927941; a=rsa-sha256; cv=none; b=u32wu7eUEe43Nba3H9fw9+X3tTQU6H/sp8SEBlwYns3Rc7SIpce2KSwdXXMm2LMgq1er+B d9oW6UwzUlyjgWRD46rC1PjVzGNz50Jgj3sbjGYS9iq8D1jWpP5bFyRPXNJC6wlY46awbk uEY5/uOv0MWy2N9K9ClVC9hAIaNFEwQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=UPOSeoVt; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 9C9A6A493C3; Thu, 22 May 2025 15:32:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65FE9C4CEE4; Thu, 22 May 2025 15:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747927940; bh=06uyp7Qdl4FbpaK88/amERaA+BHfk/0oiBoW6DdT6Do=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UPOSeoVtrBidSC/VM15RLjpQhV6Cb2BgJaJ0py/+wbBEbHGnRM9bG36hDt7LfmeSi ULYfiySnYY9mlLgTRsbMx0FuBJMXIiK7bIMOm77pklWlq9FgQ3tnZxGriJ0IVx+suK GWRnpaH2WgVf1N7+/gg3pzpwFniZUChSQE5qw2+QkW0KXe9mzAcDdzg52NmY/0BEPE Tx9+0rIp2+gCSek3gJGxrU/qWJjygXeJ8hDlcJnw/No3KpA4Af24QaQGm58p6Wr2em tlhYqzF8qmK19jQY8T8fuI0xu0t+CnX4t0WEDGW2CNbRA3eeiJL2haDmsla+tFoZqc SJYMpQPgaMUwg== Date: Thu, 22 May 2025 18:32:11 +0300 From: Mike Rapoport To: Johannes Weiner Cc: Lorenzo Stoakes , Shakeel Butt , Andrew Morton , "Liam R . Howlett" , David Hildenbrand , Vlastimil Babka , Jann Horn , Arnd Bergmann , Christian Brauner , linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park , Usama Arif Subject: Re: [RFC PATCH 0/5] add process_madvise() flags to modify behaviour Message-ID: References: <7tzfy4mmbo2utodqr5clk24mcawef5l2gwrgmnp5jmqxmhkpav@jpzaaoys6jro> <5604190c-3309-4cb8-b746-2301615d933c@lucifer.local> <226owobtknee4iirb7sdm3hs26u4nvytdugxgxtz23kcrx6tzg@nryescaj266u> <7a214bee-d184-460f-88d6-2249b9d513ba@lucifer.local> <20250521173200.GA1065351@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250521173200.GA1065351@cmpxchg.org> X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 8B76140010 X-Stat-Signature: ceod3h5mmzwhfbb7a7jom5dkqc78h83u X-Rspam-User: X-HE-Tag: 1747927941-180333 X-HE-Meta: U2FsdGVkX195l0iR2mRbkpmEQi37cLpBdMFWjQ75NczR98RdDeLSckX4NWamdk1fBkvMFUZg1S+0Egapt9N1q/vcKfmEroWIOmnVU/uqXnpL1s6LbZefuJClYJP8KrvOpXVG4yQf5EQSQPILjQhgDRwUw6ujfxMUI62h8wHi4Wtd4Gu6XmV4umM4cabuA7mW69kPQoXN0yYtUeY6FMdu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vbmDRcVe4Y= 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, May 21, 2025 at 01:32:00PM -0400, Johannes Weiner wrote: > On Wed, May 21, 2025 at 05:21:19AM +0100, Lorenzo Stoakes wrote: > > So, something Liam mentioned off-list was the beautifully named > > 'mmadvise()'. Idea being that we have a system call _explicitly for_ > > mm-wide modifications. > > > > With Barry's series doing a prctl() for something similar, and a whole host > > of mm->flags existing for modifying behaviour, it would seem a natural fit. > > That's an interesting idea. > > So we'd have THP policies and Barry's FADE_ON_DEATH to start; and it > might also be a good fit for the coredump stuff and ksm if we wanted > to incorporate them into that (although it would duplicate the > existing proc/prctl knobs). The other MMF_s are internal AFAICS. > > I think my main concern would be making something very generic and > versatile without having sufficiently broad/popular usecases for it. > > But no strong feelings either way. Like I said, I don't have a strong > dislike for prctl(), but this idea would obviously be cleaner if we > think there is enough of a demand for a new syscall. To me it seems like having a "global mm control" system call makes much more sense that adding more arms to prctl or overloading process_madvise(). With a dedicated syscall it's much clearer that the operation targets an mm and it works for the entire mm. And two usescase seem enough to me to justify a new syscall. And it's easier to reason about a dedicated syscall designed for a certain operation that for multiplexed ioctl() style controls. > > I guess let me work that up so we can see how that looks? > > I think it's worth exploring! > -- Sincerely yours, Mike.