Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1456727lql; Tue, 12 Mar 2024 19:42:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWrC3kFvs1h0r20rnaF3PjhCLROXUrxbPWPdM5mBL+Dli0YVoI5WIHbg92gz5MWPGYvwjGz6HI8ooxg8scX5ff8XENUNAJlSGuNCdt4Dg== X-Google-Smtp-Source: AGHT+IG66DqRIlmTxhBt4PR/MNzIxjNqPBOJp3+Sp5d8qGkYmFzeBzJXZBGSyEyxQcr3TqNNHs1F X-Received: by 2002:a05:6871:8916:b0:221:3bb8:3e22 with SMTP id ti22-20020a056871891600b002213bb83e22mr12250548oab.14.1710297751395; Tue, 12 Mar 2024 19:42:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710297751; cv=pass; d=google.com; s=arc-20160816; b=vDHyncxr5MpiaRKXk1HTjmDv4ofRrTCx5aLKc9EsJhcw0SUZT2HHUnPytlyC1CYxb6 hPNErsPHhEiW3p+5pscfDnFQ7EmOdGcexVAoU/P4M8cSwoK5G6DJ7ysnlCj8BclXIkwr XuSM1Ee9J0fJSJQHI+b+65Rd0Vao6QcsDj4SM5pJm54GgJxEie7mRqJCho7JRjcV5JvO IVz0+E8gWI5f/64Rj9mk2MXnQtI+LI+5aZJiV1BPxR/y5v74EvrJy3AlI0lESdkLZtsq aNnNPuFr9gO+aiK0849G0Mp91C3wDsWyFHN5Q9xSbEj+yAv2DDM5lfwyyfuCYXnUlT8j PBrw== 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; bh=kubIgq/GdbJcvxgMJi1o1EH2/AWxnGiUKA6KgBSz0r4=; fh=4JEirlYrX7WdF06fVieGy77nlEIM622gQSx+h6zNDEk=; b=srD24UP2b/PLwfqkwceGtfP3aU0Mrm28tXEOZCXiIVCSQGlw3GShTFdr0Y1HVlqKih xrxQeyS09j/lJQa/gVS3tRqjx3FTOpMMbs+yw+OmRvHDVuubsWU0fIYodPPfLxwR9iYK D2QawOo4GOjtPeeoJIXbVeqbMTXDcoBRX5e9IJ0Md8kLXxIQdDvy4NdFbNWKjkU8QbdM 3Ll2WFMN8sfxGmpiI6lCGdTAUwkaqSwGLwcujjZtTOsWBqWsk/ZGZsailxcDvtlJuWGA tKS1YGnYcFbiNJ0qwWDEX18dftazvsm7HOfiuP3gccsyjPgkFFr3tXFJVjqVV/Gc8xhz YjQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LqyDIbGj; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100712-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bw29-20020a056a02049d00b005dc88b23289si8863664pgb.585.2024.03.12.19.42.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 19:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LqyDIbGj; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100712-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100712-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EC91E28989A for ; Tue, 12 Mar 2024 19:33:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 45C63142907; Tue, 12 Mar 2024 19:33:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="LqyDIbGj" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AA4114263A; Tue, 12 Mar 2024 19:33:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710271992; cv=none; b=GRhIQ3k/FizvD8et6Jn6M0HpAV2GdJ+lC8UgsZQUk/HyGzAQy3Q7IZOr12XkPvECFm8egP74qHSp8s4SKGirODVusI6cyqPdIXMJvOv9cQsntjTqZfrFpnAUtvcNlkAaGP9AV+j9jwBKLqFdtL42L0ToSfypmLEB5cYo4QUqjZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710271992; c=relaxed/simple; bh=YmQF7O6DR+mxRv2WxozK861oQq0jmfUGuyvloZmLcco=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sDFtzn6Qlgg7wpMyZlW2YAxj4rdZs4c4SCubQJXZ58B7L1W9Vv9L8zr85gEA0vvj0qErHwP50flKqHL3wuycuYI4yVZf7XU60PSo4DOad+rlQ1nQWQrajML76AP/67kx2vLhrKrM8xXCajN+BZgcLTi59wI64Bz++J4jf0XUQ9s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=LqyDIbGj; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kubIgq/GdbJcvxgMJi1o1EH2/AWxnGiUKA6KgBSz0r4=; b=LqyDIbGj41wCOr/hh8HuGexIVM hKJs36dID9db94U5lPlL9RGQn4OGs56qUagNn3RN+BuhkHxSkWAPv8LGx46v43R6a3VnNNgJxraVA +oXI0XYJZEqr19DPK5pVw8C/rg4Xr0YPEjUebI2nI6xHRWb1ToC+vCRSA18CirbJbRCLKk/Bkf0TN SCijgrPz2C4jqtXvHv5z24xlvun8gekZrgxKprK3c3AC1DesTU8q4ym1m+mKVMZWhm117BGtWNXrp CF25rtoQzkJ++o1FL6ZsOlOnOP2JVkBHTbKIYNyEXpjm2ktIWzW6KeM25jO7j79hGY9+U5WuRoC7w 0/+4mblg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk7rt-00000003k5Z-3F5B; Tue, 12 Mar 2024 19:32:57 +0000 Date: Tue, 12 Mar 2024 19:32:57 +0000 From: Matthew Wilcox To: Roman Gushchin Cc: Vlastimil Babka , Linus Torvalds , Josh Poimboeuf , Jeff Layton , Chuck Lever , Kees Cook , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Alexander Viro , Christian Brauner , Jan Kara , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC 2/4] mm, slab: move slab_memcg hooks to mm/memcontrol.c Message-ID: References: <20240301-slab-memcg-v1-0-359328a46596@suse.cz> <20240301-slab-memcg-v1-2-359328a46596@suse.cz> 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: On Tue, Mar 12, 2024 at 11:56:31AM -0700, Roman Gushchin wrote: > On Fri, Mar 01, 2024 at 06:07:09PM +0100, Vlastimil Babka wrote: > > The hooks make multiple calls to functions in mm/memcontrol.c, including > > to th current_obj_cgroup() marked __always_inline. It might be faster to > > make a single call to the hook in mm/memcontrol.c instead. The hooks > > also don't use almost anything from mm/slub.c. obj_full_size() can move > > with the hooks and cache_vmstat_idx() to the internal mm/slab.h > > > > Signed-off-by: Vlastimil Babka > > --- > > mm/memcontrol.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > mm/slab.h | 10 ++++++ > > mm/slub.c | 100 -------------------------------------------------------- > > 3 files changed, 100 insertions(+), 100 deletions(-) > > Reviewed-by: Roman Gushchin > > Btw, even before your change: > $ cat mm/memcontrol.c | wc -l > 8318 > so I wonder if soon we might want to split it into some smaller parts. If we are going to split it, perhaps a mm/memcg-v1.c would make sense, because I certainly don't have a good idea about what's v1 and what's v2. And maybe we could even conditionally compile the v1 file ;-)