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 61845C5B543 for ; Thu, 5 Jun 2025 12:32:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9E166B00F3; Thu, 5 Jun 2025 08:32:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E4E826B05B1; Thu, 5 Jun 2025 08:32:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D16B26B05B2; Thu, 5 Jun 2025 08:32:06 -0400 (EDT) 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 ADC596B00F3 for ; Thu, 5 Jun 2025 08:32:06 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5830B1A0835 for ; Thu, 5 Jun 2025 12:32:06 +0000 (UTC) X-FDA: 83521284252.25.01B853C Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by imf25.hostedemail.com (Postfix) with ESMTP id 30859A0008 for ; Thu, 5 Jun 2025 12:32:03 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=bQlvVQZE; spf=pass (imf25.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.221.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749126724; 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=dbLVCYoHw89K1sMrvh2/XLW0a7eFbrKEsFO9EoIT/p8=; b=LoQCDSzjmiVRR3L5C87HGOVqG63zSlugYlqmuQakRxlU6NpFDe5TceI8gquyKmcJhGVVI3 vJgtWAx27uzpEjRzNPN8d50t/OVS+RM2ijtfxiTnEhqs2lnEQS8Mzo/kNpXlhPonnlG04O kjZt1AhLA/uUrc0FmIMVsS2sX57sw2o= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=bQlvVQZE; spf=pass (imf25.hostedemail.com: domain of hannes@cmpxchg.org designates 209.85.221.52 as permitted sender) smtp.mailfrom=hannes@cmpxchg.org; dmarc=pass (policy=none) header.from=cmpxchg.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749126724; a=rsa-sha256; cv=none; b=iTIm5GjsBNC+2xyl1lXfXzYOWaq5XDtaJg1TxIYlNq82bI0D243bjlN20N/qNxRgaOah3k ZUvpvG14oFK6jsJBXuim5wxEs8S48xOyzq4jp4pCwqk9kBgOmKrtzO6WVRPwRUfy242lQG PSQ+rn/OIVNBRTDf544Klg0nvMWNSzM= Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3a52874d593so767728f8f.0 for ; Thu, 05 Jun 2025 05:32:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1749126722; x=1749731522; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dbLVCYoHw89K1sMrvh2/XLW0a7eFbrKEsFO9EoIT/p8=; b=bQlvVQZEqBha9VXAIXfzM1O1BzKnyHjrf2kkBF0BI7qwSwYyf2S6JWlkPa3DBE4JkM 6t8zF05DQ+IhY8L6n/2F4+x0gp9lV8RSt243l1fLnje5MTL8ED4+5gi55rlQJzG4YQMt yaq/waU8lEMZftqGjS1SuVYPgV3snyFqjUwnLdydQ/w7VTwZiNOqpq/R10k9i+irYgZn 0JHPaiSDN3K/yj7hjCQTKWyY6VMIYg55Y/wSOdQeWyI+0e3fTklgWwN4CcdW2PqNXrop CCCntJD5/0JTVKzh4Nz7zwQyza2jZD+k1Aomx+kSQMPVNLnBtNyXByStEBRZM74J2oa6 rZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749126722; x=1749731522; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dbLVCYoHw89K1sMrvh2/XLW0a7eFbrKEsFO9EoIT/p8=; b=QLxlobZTrPhn/V2qJGsJ4peMoV5ucGB3/trgYIhfmsn1RWItaHDFTPp3No09g28x75 2EZiacX39NDPBk2pw47FhKGBUsERLc7Z008mXNjijgWPVxzMCWPE+4FJCiv6Xemr7JpU Uhd2lf1tZTrthxfpE2KgmKTg4bTh/PVboNf/HXTvxSZwN2+KUWGuIrGWJc1gXWN7/As4 osGaMU+hXnUMaXuY2iHAaMvvwc6WejQg4lFUy9AbobbDOhNIrlwq/jQajIPUs/mu/W0X EYmL2iajqVLlvtzViw4BdvH7E+Jh2fk3FQJJyR4KKXkKZWd/9Qpv0cNxDXLER1b/j0pf hMaQ== X-Forwarded-Encrypted: i=1; AJvYcCUuDLs3Sh1TOj4qi7BGcSasFUZ5MZ6i8xGvzdI6sWB1LomE93kaoGG3zfqledRLARUwu0Hr9i3pOg==@kvack.org X-Gm-Message-State: AOJu0Yy1fWut30qeYYLypX5Z04WJp8J5lfZ1OFc7TdE165LrJGo2+ekF XhTKxpoAOdVR3Yadxp9CJSa6ZMhCAjsBZYiTCH8uazSBTfA40pzQnRCOTt4YDaEIIjM= X-Gm-Gg: ASbGncuINS0u+RstDiP5N7Yg5R3m9ptJZb+w+R2k9e5cN5uD9bbVTjz8DavECxbDcN0 vrCHLkznUwTSE1B0uYUEg2iqUJ2waVDtU3U8bYtyzEMOLZdTwLZYprVp4zYaaa2lg/J1nFI4AJU T/k7Bg5rNIDrYdmyiY/1ibgIBPwEFkNConp4norhh8s5hM2lAJbAek/4XoWlvysyk6Md7pbZseG gP0JZKUQXbz57EBs1a+24rFKiFSvsiy09VIrt0rsEzgUa8Xgmab7WmcafFX5t3eMIrGMmFJZYGA tLaLQxEiywIiZeJwS6fSROFsLYzseS9YnmO2tqiDtwdOwfaj X-Google-Smtp-Source: AGHT+IFXHPkHPf2uCdDe9+EQcmvwifuUNGAljP9j70NUml2wxh1XWMThBMmV1XTwFDvkJEfjag4DDQ== X-Received: by 2002:a05:6000:290d:b0:3a4:dfa9:ce28 with SMTP id ffacd0b85a97d-3a51d8f5959mr6009327f8f.5.1749126722211; Thu, 05 Jun 2025 05:32:02 -0700 (PDT) Received: from localhost ([2a02:8071:6401:180:da11:6260:39d6:12c]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a4f00a0a96sm24730734f8f.96.2025.06.05.05.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Jun 2025 05:32:01 -0700 (PDT) Date: Thu, 5 Jun 2025 08:31:56 -0400 From: Johannes Weiner To: Vlastimil Babka Cc: Matthew Wilcox , Lorenzo Stoakes , Andrew Morton , Shakeel Butt , "Liam R . Howlett" , David Hildenbrand , Jann Horn , Arnd Bergmann , Christian Brauner , SeongJae Park , Usama Arif , Mike Rapoport , Barry Song <21cnbao@gmail.com>, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Pedro Falcato , Tejun Heo Subject: Re: [DISCUSSION] proposed mctl() API Message-ID: <20250605123156.GA2812@cmpxchg.org> References: <85778a76-7dc8-4ea8-8827-acb45f74ee05@lucifer.local> <20250529211423.GA1271329@cmpxchg.org> <0aeb6d8b-2abb-43a7-b47d-448f37f8a3bf@suse.cz> <20250604121923.GB1431@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250604121923.GB1431@cmpxchg.org> X-Stat-Signature: rg77szpgsp1aceqbni4wwr7tqi4fmafz X-Rspamd-Queue-Id: 30859A0008 X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1749126723-713341 X-HE-Meta: U2FsdGVkX1+BRyVQvHhpwfjE7ddMSfJ053nh/iCe0pn4WmRG//55cJy4ev4o0n4pHJFuygZy/aeexPsvmegzeEof3eOub3YueIAkL4/8vYOHnjPjjv3R8Wh05yVtt3YIyqo4z78fEaZNY0eOSedFoMnQwWybbwbEqZDEmCaxsd2o20GWzxzcfr+ZzFp6QT5Qmz4oWhdeld+CISi8xoskUefRsTAugLRGNtG3CdJRFmOy5SOjQbqHEtO2VeDLFb/Oq5ZuftXaDECFWMbU4r/OJtPC9jFjf2b9xB1TpF6jR3yI5c00WSEdMLoDLbhe42mb0+kTfSJar8jpqbROTDYcuGmmHa5u01HQJoyiRLv6ApsPLkkrgIWl3znZuz96BYz48Gha7RPhRUSsVM/HpeQgz8ZcdwvB2E5h9eBFkmxUrbQwB1vhynVm9+/MIWI6ySu3hM5WRjLRIobQTKZyfns62M2wvAtPVkXg+S6zgm5HmLn8wIrV/iWRlItU/g9cXOntb2CypY9VDJuiaT5TYuUv60lEIClokM7Vet0FPi3aZ96cwLn+c046G1DEndK89yPdGN/L/KRoqnF4X0QeoR9R7KQhPSzLTEfRuyyU4k47LnPP8lhjKp5jcqpskXa9Y6LGO5kG98KbTRFl9MovmVWOGW2htjUv15kVLHoUNlFRssFGnIMoa66vIohYX9j//cfyILbBt8dS878tV1om0XhOXP25xnS74v+A5Ds62ujq5Uuqm5vQW8DpEcN+vZZ5U/JbQ+ClztonoivYD19j6NyxU/bqwW4mB+RiT04RKqAOmS1A6+grIwrBSqnevLNMw5m6y6W5Z43tgzyfUP7nlb2UBgChARn4QN8t1KSmHt2TRkOocOUD64WMlCkq6d8UrDaqU2KspKfD6I5dxSb8q6VXt8IMAHFWSufwZLQZPooQe1QKEt8o2S+TYeTgHfHT9y9drPd+VrYx5HHs9/tfJjP a1BJuz3x O6GDnPPqfldcxMbvjCF4JEpI8MSNB+LBaSLvSqUWsYtVu9pCV8KMWFFF4XiGQzQZbvD1a4ecRW8jGfkwzxNuVfH7h/IjN5gQF2RdNITCCyQ917+UC0G6eydSwIQVRCBwCohsmyyacUeDA+FVRNf7oompgoM2bQaNPqJUSg9zHaYRgxLkC8cZCR61YLP+8jmosf9CuJxsjIeZUv3Ys1EeV23yZdhNAupWkDtGYtPD/qKHGhqYF9PbbEcWxgQ2xzsXt4wJ9H2C6DfBJd0pycrTH/GhEwlPs2qb7vce99M0ypNQSSXAXHIMcB6yEr95CnBX8f57WPpnU24/a2EvrfGxj/H7Nq5HUOC8eALr9LFK3qw+YGqYuWgmcxFYSPC9UsKYXBiK2cRaM827LOyMpZdbqTZQmKX/3nrB5y8Ad/Qr6bYuPsUT2ePTE97zUfqPGLqvq1HT7v0z6dwFZE3mLz2eAnwjNyg== 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: CCing Tejun - with the right mutt alias this time. On Wed, Jun 04, 2025 at 08:19:28AM -0400, Johannes Weiner wrote: > On Fri, May 30, 2025 at 12:31:35PM +0200, Vlastimil Babka wrote: > > On 5/29/25 23:14, Johannes Weiner wrote: > > > On Thu, May 29, 2025 at 04:28:46PM +0100, Matthew Wilcox wrote: > > >> Barry's problem is that we're all nervous about possibly regressing > > >> performance on some unknown workloads. Just try Barry's proposal, see > > >> if anyone actually compains or if we're just afraid of our own shadows. > > > > > > I actually explained why I think this is a terrible idea. But okay, I > > > tried the patch anyway. > > > > > > This is 'git log' on a hot kernel repo after a large IO stream: > > > > > > VANILLA BARRY > > > Real time 49.93 ( +0.00%) 60.36 ( +20.48%) > > > User time 32.10 ( +0.00%) 32.09 ( -0.04%) > > > System time 14.41 ( +0.00%) 14.64 ( +1.50%) > > > pgmajfault 9227.00 ( +0.00%) 18390.00 ( +99.30%) > > > workingset_refault_file 184.00 ( +0.00%) 236899.00 (+127954.05%) > > > > > > Clearly we can't generally ignore page cache hits just because the > > > mmaps() are intermittent. > > > > > > The whole point is to cache across processes and their various > > > apertures into a common, long-lived filesystem space. > > > > > > Barry knows something about the relationship between certain processes > > > and certain files that he could exploit with MADV_COLD-on-exit > > > semantics. But that's not something the kernel can safely assume. Not > > > without defeating the page cache for an entire class of file accesses. > > > > I've just read the previous threads about Barry's proposal and if doing this > > always isn't feasible, I'm wondering if memcg would be a better interface to > > opt-in for this kind of behavior than both prctl or mctl. I think at least > > conceptually it fits what memcg is doing? The question is if the > > implementation would be feasible, and if android puts apps in separate memcgs... > > CCing Tejun. > > Cgroups has been trying to resist flag settings like these. The cgroup > tree is a nested hierarchical structure designed for dividing up > system resources. But flag properties don't have natural inheritance > rules. What does it mean if the parent group says one thing and the > child says another? Which one has precedence? > > Hence the proposal to make it a per-process property that propagates > through fork() and exec(). This also enables the container usecase (by > setting the flag in the container launching process), without there > being any confusion what the *effective* setting for any given process > in the system is.