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 8F394C54EE9 for ; Tue, 20 Sep 2022 02:41:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B87F8000D; Mon, 19 Sep 2022 22:41:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 167DF80007; Mon, 19 Sep 2022 22:41:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02F958000D; Mon, 19 Sep 2022 22:41:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E7F9180007 for ; Mon, 19 Sep 2022 22:41:37 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C171FC1ABC for ; Tue, 20 Sep 2022 02:41:37 +0000 (UTC) X-FDA: 79930913034.30.BBD5B54 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf07.hostedemail.com (Postfix) with ESMTP id 208754000F for ; Tue, 20 Sep 2022 02:41:35 +0000 (UTC) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1663641695; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O8CRGXcYJbg7e39VGUOoP0cvfANv2U6Hp6Ub75UWqSA=; b=ncELY/m2Pq+Ul9c9A06Wnwt6KrLq04OoRYfFX2fukI0jrRq8cokDk/JGwuncwPwuutyb5N 7brzDS886ctW/mVWCfXMWGPfvw6TV6dU3hhz1+n5pVghA9EsC24JfUxVU0KUKHfPojZhS0 84fBopquCieZPExOJ3OqXUilQDuATUE= MIME-Version: 1.0 Subject: Re: [PATCH v2 1/2] mm: memcontrol: use memcg_kmem_enabled in count_objcg_event X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20220919180634.45958-2-ryncsn@gmail.com> Date: Tue, 20 Sep 2022 10:41:29 +0800 Cc: cgroups@vger.kernel.org, Linux MM , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: References: <20220919180634.45958-1-ryncsn@gmail.com> <20220919180634.45958-2-ryncsn@gmail.com> To: Kairui Song X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663641696; a=rsa-sha256; cv=none; b=tz4H7sxPJpB4/H3t5By70qhLAuW506EByEupDSHZi1+cAyvEvFPDm/Qu2vOgoQS6taWq5X q7N4sEJUsajzE8U7kMLUyyU50Te7pI/KMceOM9C2qgeRFYtJO5vIHuEl5w/eBjyZI/aXR0 opKefcCrOQiRDmV/OqoMllm+Ml0P3fM= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="ncELY/m2"; spf=pass (imf07.hostedemail.com: domain of muchun.song@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663641696; 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=O8CRGXcYJbg7e39VGUOoP0cvfANv2U6Hp6Ub75UWqSA=; b=T0dcJQgBRKPZjtvhQy+fzi06HAUy+D/y/0tf4f48Zc/x4RXCVXx43HJXJH1F4UZ3tB/NWq 4SYzJaxjgKVcToBbUcpjkCy4PvodKPxpLNSWgqwz9vLob7P6/n3HNU2ptbdP4BQc0Vi9hH b1OITPyZ23j16mwq+i5SPZ1WEeTWQ3E= X-Stat-Signature: ppdfw9qpg7wchfwnqtqcn5f9btzb1yup X-Rspamd-Queue-Id: 208754000F Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="ncELY/m2"; spf=pass (imf07.hostedemail.com: domain of muchun.song@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=muchun.song@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1663641695-942644 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 Sep 20, 2022, at 02:06, Kairui Song wrote: > > From: Kairui Song > > There are currently two helpers for checking if cgroup kmem > accounting is enabled: > > - mem_cgroup_kmem_disabled > - memcg_kmem_enabled > > mem_cgroup_kmem_disabled is a simple helper that returns true > if cgroup.memory=nokmem is specified, otherwise returns false. > > memcg_kmem_enabled is a bit different, it returns true if > cgroup.memory=nokmem is not specified and there was at least one > non-root memory control enabled cgroup ever created. This help improve > performance when kmem accounting was not actually activated. And it's > optimized with static branch. > > The usage of mem_cgroup_kmem_disabled is for sub-systems that need to > preallocate data for kmem accounting since they could be initialized > before kmem accounting is activated. But count_objcg_event doesn't > need that, so using memcg_kmem_enabled is better here. > > Signed-off-by: Kairui Song Acked-by: Muchun Song Thanks.