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 4A2CEC63705 for ; Wed, 7 Dec 2022 21:51:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 930468E0003; Wed, 7 Dec 2022 16:51:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E0898E0001; Wed, 7 Dec 2022 16:51:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A73F8E0003; Wed, 7 Dec 2022 16:51:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 684D38E0001 for ; Wed, 7 Dec 2022 16:51:15 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 28E241C5FF5 for ; Wed, 7 Dec 2022 21:51:15 +0000 (UTC) X-FDA: 80216856510.20.6A7CE15 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id 515731C0003 for ; Wed, 7 Dec 2022 21:51:12 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=qAeunG95; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670449872; 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=GFjq/TgO4JS7WFGOZmPSU3pRseC3LQ77BINl+rMexJs=; b=r25l5ha7KkiWezPBmLkubenugj0BF8HStMRaj8eSR33r1I39YlXOepiTetxXMZHUf4Lr1E btoIBYP+EowhbE5NkXehYWY9barWkxbJqamHcqMB1aFINrexl3ivsdZ9eYf2ynHo5z3c+I CYLZO0M47vVrNYgdeAS7Qn32kAIy1aM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=qAeunG95; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670449872; a=rsa-sha256; cv=none; b=iaq/thf7kmGrVt/C5WsVnENg6v/AZPTgNQIABGzz2X2e4JFEy+swHOcigZTNW4cE1BeUBP Unna56vs8zUD2It/68vXnToVzTNnvsioFBCXS/WVhtrS17g6SNSc4/nHk87C1LH4T8Q6ip HY3GdMjkSMPY0jO3PwZEW1YkM6xTLYU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 03EF3B8212F; Wed, 7 Dec 2022 21:51:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C774C433D6; Wed, 7 Dec 2022 21:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1670449869; bh=lOzePfG+gfzij5YGhbjycoi2p2PKhj4xCr9a0XLkW7U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qAeunG95UWOW53nZ4bn+0tSSku08KCUXDW0eYgErfMITVSEM0r0BgPOUJEwHKCEsw Qk1Ug0XI/fjFr1Dr4jnFNUIUdbJpkvdtrW1s/VhUqfkyXF/grfKFD0z/YPBFUy2kCE sSQZHlM4fu8tYRGxpXTtq06S1jSnpS2fpOmaaB8g= Date: Wed, 7 Dec 2022 13:51:08 -0800 From: Andrew Morton To: Shakeel Butt Cc: Johannes Weiner , Linus Torvalds , Hugh Dickins , Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm: memcontrol: deprecate charge moving Message-Id: <20221207135108.fe1d51f7581f6ff86dbf9bc8@linux-foundation.org> In-Reply-To: References: <20221206171340.139790-1-hannes@cmpxchg.org> <20221206171340.139790-4-hannes@cmpxchg.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: ikg4mr7s44mg1gmc5r9hz87851efj9fy X-Rspam-User: X-Rspamd-Queue-Id: 515731C0003 X-Rspamd-Server: rspam06 X-HE-Tag: 1670449872-184109 X-HE-Meta: U2FsdGVkX18+wp6FIokpC5h50PM0NgIwzZ4hYHS7To/FJuNbyw5Uojyx5DqOxSQob+TMVL139VwMlgW5cY9wf2Rm+HzHpwPqgEs1Ii40AhPPcd1hWaahPO0Xl4YphSSfgAtezO2/PTsx2JqcQeI7E9TLgjTATySgfD5o77kOgZ6R9OaXfFBfuQ9VzFVJUj+dojOlGgIyR+aLxELhKjIRNlpOcQBQ0eiXYJUh0lR++vQj32TO4ZMROSOg0+1nlVpPiJGyhvmbhVHQQih0s0iHOO2jQa3m58weiZhbEcwA38Iu7J85z9omx+TfTswdh/UBCMkgV/mlFDFKa5YhM09NVxKlnwHbgeaUo69NNLMoKV9+DRrlIl+VuyMmPOMCEei/IEY5csnCaAsUqlS558rCm65Q8bBOIfWhpskQ3CFJHz7vBDc88hFoLo2Hclh2HAwhsapE2G7mOfNtTjHeloHjsFnrh/ku0jyUrJ3o0IfeE6N4cGCBvUKUHXtaiSISTSN+g7Ike8KtAxDIadcQHZtvXPpGPYjYi4K92KInhGsKBG65GfoKjW2qSC2WHxuKp84VncLKUKVNM1IPJxAQetU5vTZ1x1QWXnRqevY1OKaC+1bZ6zDeDQYrhu4sYzhuvLhdxxLgrBAKKg67yxe1W+MQV3Gxs5QoP+KoKOd44rJMXRV5qj1FmTjeXzphDNGQ9ZECE6QAm3XkUuoY/PbVn35XXfSwY85NL15gpFFzjvHqHFa+Xf4yI8qKNr8sIo/uPQRdGOyluukA+UAkjft0z4jeSsWwDucWlHxU5J27kDeVKpTIhnC0lV7/Zl+N9GL9BY0i3Yp3fUHUwkrHP+KRs8/JR8Y+YoTwWUvvvKLnMkE63RFaHa/YDHnoLEN1OEJOkJH7VpK9iPLq/LY9js9E1hr5VviBH2MGIu89hw59LhQDtKwdLqclBrKyeniOAiZnjhzEemUos/CrHiRa+xYqpXN VP27KGva iCnTleqnb0LlFs92vhXMdMyzMVB5VbyC9uRgWZIVrTwbxM6IiXdLs97u2R9ZeECfRUnm0 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: On Tue, 6 Dec 2022 16:03:54 -0800 Shakeel Butt wrote: > On Tue, Dec 6, 2022 at 9:14 AM Johannes Weiner wrote: > > > > Charge moving mode in cgroup1 allows memory to follow tasks as they > > migrate between cgroups. This is, and always has been, a questionable > > thing to do - for several reasons. > > > > First, it's expensive. Pages need to be identified, locked and > > isolated from various MM operations, and reassigned, one by one. > > > > Second, it's unreliable. Once pages are charged to a cgroup, there > > isn't always a clear owner task anymore. Cache isn't moved at all, for > > example. Mapped memory is moved - but if trylocking or isolating a > > page fails, it's arbitrarily left behind. Frequent moving between > > domains may leave a task's memory scattered all over the place. > > > > Third, it isn't really needed. Launcher tasks can kick off workload > > tasks directly in their target cgroup. Using dedicated per-workload > > groups allows fine-grained policy adjustments - no need to move tasks > > and their physical pages between control domains. The feature was > > never forward-ported to cgroup2, and it hasn't been missed. > > > > Despite it being a niche usecase, the maintenance overhead of > > supporting it is enormous. Because pages are moved while they are live > > and subject to various MM operations, the synchronization rules are > > complicated. There are lock_page_memcg() in MM and FS code, which > > non-cgroup people don't understand. In some cases we've been able to > > shift code and cgroup API calls around such that we can rely on native > > locking as much as possible. But that's fragile, and sometimes we need > > to hold MM locks for longer than we otherwise would (pte lock e.g.). > > > > Mark the feature deprecated. Hopefully we can remove it soon. > > > > Signed-off-by: Johannes Weiner > > Acked-by: Shakeel Butt > > I would request this patch to be backported to stable kernels as well > for early warnings to users which update to newer kernels very late. Sounds reasonable, but the changelog should have a few words in it explaining why we're requesting the backport. I guess I can type those in. We're at -rc8 and I'm not planning on merging these up until after 6.2-rc1 is out. Please feel free to argue with me on that score.