Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp501411lqo; Fri, 10 May 2024 06:33:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQAea54baxO7HdeXFcTlgvZQQ6iijjk4jBWJJAQuWQsb++BQ80pTUjblETlrRlYqmO84SoPfxWI4V2+pi7RSyQWCKCsXl+DQNUhnPf3A== X-Google-Smtp-Source: AGHT+IHjcgW3C7LV2dP/NC8IOoq0XJbmdRlrwsJUGQy+VNdIynxLRqJ/mk5d+YSZSNjYebI5sto+ X-Received: by 2002:a05:6870:8189:b0:23f:d8e:292d with SMTP id 586e51a60fabf-24172f9a7dbmr2938942fac.58.1715348027480; Fri, 10 May 2024 06:33:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715348027; cv=pass; d=google.com; s=arc-20160816; b=uT0ltt1YArFcW2UIMtrAINkM8vC7bwEb5BCN25xG6aovMsC8TvpujtgsdVOQjA5qER 4795aUww6edpljGZQKoKb9vxZ9tZ6qD2pIaDEiQuv1G4c6Ftetdy7/H4ubM5epiRMENA jTk9C05onkwDsID1hv8FLjXG9Wm/BVdAdZYr6yLrp1uFy6GeIPIFsjTVq3UDQe6x3Gja 1YLimPJAlT/f4AJ2DFA2p1ak9zd1S0HzBmWgNk8duUIlgJQs2y3uca0MiQR4TYkoQdUA hOKxzxHbrvww0x/0xD2tni6Pr6+ezgRuwosXq5gTn9aGwiRnQRxTCy4u1GqJp4qKhhz6 PjQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=H7flCeeu/RqHijW2rCZbgRalVKYx9U95MIGkT6wJRF4=; fh=9o9dYtWny8Oc1K9a4TngM0uu0RioCZZGWGzyAmcp9lc=; b=SUDmHFcqI33zHls6X/fRmybwaz1hy1dGEMKP90ijeYx/EYNtfErdjirjd4Qne0t5YY bu2QV6epUUzBeAr2bHXKPTzb+kGiW0bw0GHS0feNMq50lgc+IYciWW63/nJNOGPgSu3G Bqx1LdegRvlnibffJwqWgvCNHKrJH298CsI+VToUS5G8KfdoT6wwOi+3Fhp/DKcrH/T3 oDQYSvre5vgBeFclvkBlnDNh8xWmxDenW5LbBR3KbrCcXl82syD4lHWRj9nqjYDyuKSU VOUuKaY/gdiPX6JE3o7EPPbLhOfP6Y0EFuzsbRM5F5U5gJ5UShPkyHsngdu6K45YTqAy yRwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=LWA3yB3n; dkim=pass header.i=@suse.com header.s=susede1 header.b=LWA3yB3n; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-175830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df54a128fsi35492891cf.133.2024.05.10.06.33.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 06:33:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=LWA3yB3n; dkim=pass header.i=@suse.com header.s=susede1 header.b=LWA3yB3n; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-175830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 095E11C208E0 for ; Fri, 10 May 2024 13:33:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0BE212C46B; Fri, 10 May 2024 13:33:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="LWA3yB3n"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="LWA3yB3n" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D88D75339E for ; Fri, 10 May 2024 13:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715348019; cv=none; b=fUotG4ksyNXOGoOcvw2h4Mvh1eUF8COVY4apg5/cF0oWHZRPEhf+1zqRG3VvDDYm9fgOm4LREO/7EJLB+rXfY6NjkiMj3q6ONMaZO3fCuq7EQ9tSW9QIswJcGAHvXl4OPZF7GkPbGswxcn/ATqr16bH91mpu2P/AdzD9JGuD254= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715348019; c=relaxed/simple; bh=uDOukQ73ZJHi76qm9+oS4eVsH62iJdBg7hMZoNnyZ58=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FLPiABk9yeaGUvsPFsgYDPhFqDbkXGCvF+wFNHqAeZKjgz3iCfNph+tCqUfkm7PEVja6v7Ya9patv8kX2pYAIaRAkINeGc8u0kZFHebFnDSxNY9wTAvBgx3mUmzdmzBqGHGTlUFUANWT96hxwafGU6DbyTCztbQnrguJbL3rSTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=LWA3yB3n; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=LWA3yB3n; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=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= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=LWA3yB3n 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-Spam-Level: X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: A8834670C0 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Score: -4.01 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