Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1321128lql; Tue, 12 Mar 2024 13:37:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2f0/CN2KC8e3DSscUhfgij9fcQdIooDxvGK7ZJIyrJep2ceD+LPsIA4jBPtT8LdJoUV8eK6oUE/aXR6bQOaHIzKg1ymDugSQnAoAS5A== X-Google-Smtp-Source: AGHT+IEVhumBR4JUJpkIL/ZBCfEvbu5HyYGNmExqfm2nPS2udG0fYzjY95XLI7D3kilzEL8Y+zWw X-Received: by 2002:ac2:420f:0:b0:513:80b3:3eef with SMTP id y15-20020ac2420f000000b0051380b33eefmr6763715lfh.24.1710275849652; Tue, 12 Mar 2024 13:37:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710275849; cv=pass; d=google.com; s=arc-20160816; b=OBqazAvsN3DduIAT3+WHvBAulW2Ok3IjnTY9Y93f7BECytK2NNqiOPYHb22/VVwnry NYJcMrcENEnfRcxKRWSHaB61ay4n6pv6duhlcB5OtlMtZ3UIO0IiOdH0fFMNC8LjB2H5 h7fnLP1m/9IUTNhVLCvvPdIeCfRLuUqyWo3b7088kERjhVgANcIIlUBOEbM40+aEnmgH D98MZVTv/rbC7/AN7dYtmh2y4MRD1hBS7gUMpnEM3C2qyLTGnpG9aRUb0Qro/lZU9LY0 GfMz+cI3CXzgzXDalZErrOGbHy4cgZpo8mOqwZil3FB9Sx5Tn9Umfnn74lv7EtAzmFVJ yXYg== 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:dkim-signature:date; bh=uAqALqr1rdPH8sdbmVB4VkVDqs3g9V4IllJSBYc1FHc=; fh=d5CJin65g/YiV13usw7cZOQBEBMQ+vqy1DNr2TBgH/c=; b=vQIrLAiLTB+ROjjVyR1rgonITOVgctfPL1oxFoS/vz6dyb6HuVS/4lqs19LSxWzrHN O8U3QnvXwTiHlV+w3dLeVQ98thi9GbN5Jh64NfF9+QvOqxgyDmt2C7vv4+Ei3QQs0f0D NMWz1bQ+N5BmkDUSFugzMyuhWhw/dccrOGnCILSzkjNFB+GfmaZsdYNMgGFq9LWD7Ltr tNUQZeOA5w7VIhwKQlCXO5hpFVTinPj1KEPPigkRo0XXJ4MBKjiPD5LmjNbGmqiQSGL7 4TkJUZTwZ7wB+r8kEC7NT8tPQ9f4CYBw9OgOHDfE20vHqy5ZdlQCESLCEHnhk4YL3pHI gIvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HZXpeDYD; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-100769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100769-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n8-20020a170906118800b00a4628a74556si2179765eja.279.2024.03.12.13.37.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 13:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HZXpeDYD; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-100769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100769-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E5C41F221E9 for ; Tue, 12 Mar 2024 20:37:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FC0914291F; Tue, 12 Mar 2024 20:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HZXpeDYD" Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 049101E529; Tue, 12 Mar 2024 20:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710275837; cv=none; b=l2il+F3QgSQfKoSGuTuZqoPsNWmAxxEGkR6FbYTizxJCw2bFRhY63l81khQzA2QzEm9+btO2a3kXw5o4fGOez9vGM+VpoKOdbiNrYJ+OwRZfm94oG+Z3n6tzSVMP7FuKstDavm1gTCu0Tqq13Tbj4tNKFkZ40/vfxdVzkNN4hy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710275837; c=relaxed/simple; bh=KRIT8RSl8j92RKVbXYm+JfThLcRNkmtbFfcf0XKauR8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ql7htFmqhUnm/gwXZk2Cjrl4IYnirwGt5jXQrOKz7tin+Si2UkeYHZzAzqlLvf4QzqcxcreFWTnPmnORDWRrwarzO7vMayFScSCtDlqcyDmX4p1peWdgewCSfMZg787gtz4raIBwlg5WrgGnmGDyyRbQTSiaS9zC5qqIyWsoGzE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=HZXpeDYD; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Tue, 12 Mar 2024 13:36:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710275834; h=from:from:reply-to:subject:subject: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=uAqALqr1rdPH8sdbmVB4VkVDqs3g9V4IllJSBYc1FHc=; b=HZXpeDYD0w65xyXfNRa7nKoN85fwgSPBYCylhns9hpHruUJ3UL5pTGeoeVWfGN0tweYVBf UKF4GnESETxQFudkc7MEA5P8Gg2KhzWNWGMn9Lt+P+7G6a+/J/s22SGiV6rW7oKL1P7Q5h p8LVxeur3vJydFpomBcAYoJToGWwexQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Matthew Wilcox 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: X-Migadu-Flow: FLOW_OUT On Tue, Mar 12, 2024 at 07:32:57PM +0000, Matthew Wilcox wrote: > 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 ;-) Good call. We already have cgroup/cgroup-v1.c and cgroup/legacy_freezer.c. Thanks!