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 1A4ACC25B5F for ; Fri, 10 May 2024 13:33:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93AFD6B00E2; Fri, 10 May 2024 09:33:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8EB1C6B00E3; Fri, 10 May 2024 09:33:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B2896B00E4; Fri, 10 May 2024 09:33:34 -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 5BE7A6B00E2 for ; Fri, 10 May 2024 09:33:34 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id CA5261203F1 for ; Fri, 10 May 2024 13:33:33 +0000 (UTC) X-FDA: 82102578306.06.531E3B1 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf24.hostedemail.com (Postfix) with ESMTP id A61D9180010 for ; Fri, 10 May 2024 13:33:31 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=LWA3yB3n; dkim=pass header.d=suse.com header.s=susede1 header.b=LWA3yB3n; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf24.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715348012; 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=H7flCeeu/RqHijW2rCZbgRalVKYx9U95MIGkT6wJRF4=; b=CdYlv318fgXitPEorRnCnd2h7MlIWM642GMFlXGk7QeJO8MmgqKZ0+4mHkFlryFdz2qSTy xQAE3Byw9LSI1zVfROMdndAFfSOKqUOzx9e0xFbF3UHOxVYnSht/zzS0c2NQvUHW9fl5O4 F3gLuwi8WKWCXeGrGa/6jLZNsmxH0pA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715348012; a=rsa-sha256; cv=none; b=1LH7Vor3h534t3hwiNmlIShmQUyoTOP/+vf73b3gKlC39EASjgsZqwHDhq9Kcw49NtsVKD NbeSQF63Xx5B6BIjrA3Ro1OmEI7ue7hH+GeIdJiyoyjFazzgmrbejHmcINCeMJj93IKuic 0rFdk0vbTGFCHs9KrYplxG6pBTj8PWQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=LWA3yB3n; dkim=pass header.d=suse.com header.s=susede1 header.b=LWA3yB3n; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf24.hostedemail.com: domain of mhocko@suse.com designates 195.135.223.131 as permitted sender) smtp.mailfrom=mhocko@suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A8834670C0; Fri, 10 May 2024 13:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715348009; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=H7flCeeu/RqHijW2rCZbgRalVKYx9U95MIGkT6wJRF4=; b=LWA3yB3n2h6A9F2zfs3K64ygwUTdGdLCEbzkEnqgEOHn6X/33t/f2M427FkntTdPcwULTA TtV8ASS341OFDlmQkyZ9CwiSknvBxIHm2zOk5DeV43IRxOIzHvIwQ9ArLN34SpvWOiiE2z wkCul0JoEamzw6mF/E/vYxPHLaQhqRw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715348009; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=H7flCeeu/RqHijW2rCZbgRalVKYx9U95MIGkT6wJRF4=; b=LWA3yB3n2h6A9F2zfs3K64ygwUTdGdLCEbzkEnqgEOHn6X/33t/f2M427FkntTdPcwULTA TtV8ASS341OFDlmQkyZ9CwiSknvBxIHm2zOk5DeV43IRxOIzHvIwQ9ArLN34SpvWOiiE2z wkCul0JoEamzw6mF/E/vYxPHLaQhqRw= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8A3B7139AA; Fri, 10 May 2024 13:33:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id bKHNHikiPmZpBwAAD6G6ig (envelope-from ); Fri, 10 May 2024 13:33:29 +0000 Date: Fri, 10 May 2024 15:33:28 +0200 From: Michal Hocko To: Roman Gushchin Cc: Andrew Morton , Muchun Song , Johannes Weiner , Shakeel Butt , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH rfc 0/9] mm: memcg: separate legacy cgroup v1 code and put under config option Message-ID: References: <20240509034138.2207186-1-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240509034138.2207186-1-roman.gushchin@linux.dev> X-Rspamd-Action: no action X-Rspamd-Queue-Id: A61D9180010 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: wtnb3o3tuzir5kwh4adys59ekrrukd5t X-HE-Tag: 1715348011-722307 X-HE-Meta: U2FsdGVkX1+rv0qbKkMB+fdwRcvwYnAKMgYY9RwsZy6/MxguDrbKVbEbKxT+VnQO/G/GlS9xxRnZycESwjeQjMPYFGMkzrjAnlw8thpmygl/kFUx/pwRz5lKD5B8aQsulviMTVu7e76NSNa+eq3uS2j4k+O8ShEQFvPqmotd8FAeMW8N5j8Bd1N+sOfTlrn+LoaqDTUNOBfHc5nC15oHCr/9lGT0wt87979V5ZZeEm7d8KdyJeYPZMrKPhqt0AwZXP5ZJpaHQ/y3v/gJShVkny8UzfOsESMEITJ/zvwDEYiGE3SI1u2B+aPEg1vCVq1Rc5aQ80wFrFl6g3ApP5JS1X0c7gMyb/D93q4+kDGVPQLbZFhCJi1oCSzxvUS9772YVPqfafKSegv0YPPORp9wWiTLifow7dwUeNOGAD93k/+Cf1re5JM6hjxbytfi4U/n1cTeXIw6rLQPqw2dP81YDIF9yubAh5uMF5ywroWlebgO39PJHPoObr+vOjv9VAv4QaNN2woIISa83qP+YAh3rIeZz9n1PiaQPHNwlvUjg3cM6suCSBbeF2euLLY+ZjLRc5T92rUE76Wi6MLzEc9KBV+MITqLVt3uMPp81VjPSHiHK/YOIMbeEZBNVQL4wN0nweGkQLb+73AylPcQ84blsbziVr/hzmhlnkqU3Rv5joasTnCuBlkbDu18DXRzvuXsvGZgp9FrtE2UxEGm4mczIIZNTJff21opJ4WM2GN90fdmBtQDX+BJfZ/ibvnHUaN2xu9aCFnl5zQOBQ1AqKK5vPThb4gjR7jhejYH0k3lIQcz51x1Rahki4J9tyEcvdbEFdvc2oNvTf79ElZaPfI0gRJYX35Va9f5cnAwdmfYkNmeDo8U9rf1bXPMH9T1FD86UwmY63PM56dII/YkuWWg0OMueeQmU/5yzejzQvSdsof+t6zRNivhO+khcKtG2YMldYJxCRPqtH8uIxAFBwd yIqqzJPh syGqhrqp+JQu6k12C7kNfFaFLRNSeZ0wvYp1+U0Dn2fpfgqHFZqQvHV+6MbecZqLX6jrFR8dqLvZYpBEwK0OFVu7Wz3HNABAbHb08rEe1dw0cFj/ybYi0/n9oS1eS18FwA2VO+vdxDwhcTpwjq/0oxs1KYI52k2DMBBWp/9WYtcoSOLHuXNXiwvkId4QVt4QzZMk7OYFe0qdtgQ8QI+M91vjy1Q== 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 08-05-24 20:41:29, Roman Gushchin wrote: > Cgroups v2 have been around for a while and many users have fully adopted them, > so they never use cgroups v1 features and functionality. Yet they have to "pay" > for the cgroup v1 support anyway: > 1) the kernel binary contains useless cgroup v1 code, > 2) some common structures like task_struct and mem_cgroup have never used > cgroup v1-specific members, > 3) some code paths have additional checks which are not needed. > > Cgroup v1's memory controller has a number of features that are not supported > by cgroup v2 and their implementation is pretty much self contained. > Most notably, these features are: soft limit reclaim, oom handling in userspace, > complicated event notification system, charge migration. > > Cgroup v1-specific code in memcontrol.c is close to 4k lines in size and it's > intervened with generic and cgroup v2-specific code. It's a burden on > developers and maintainers. > > This patchset aims to solve these problems by: > 1) moving cgroup v1-specific memcg code to the new mm/memcontrol-v1.c file, > 2) putting definitions shared by memcontrol.c and memcontrol-v1.c into the > mm/internal.h header > 3) introducing the CONFIG_MEMCG_V1 config option, turned on by default > 4) making memcontrol-v1.c to compile only if CONFIG_MEMCG_V1 is set > 5) putting unused struct memory_cgroup and task_struct members under > CONFIG_MEMCG_V1 as well. This makes sense and I have to admit I didn't think this was so much code to move. It will make the code base much esier to follow. I do not think we can drop that code anytime soon as there is still quite a lot of use of v1 out there. From my experience there is no good reason for many other than inertia and those are just waiting for somebody to move them to v2. There are some workloads which depend on v1 only features and we should discuss what to do about those. -- Michal Hocko SUSE Labs