Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3333582rwb; Mon, 19 Sep 2022 20:04:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SbtjZxMVZJmDHmYakKf/SbW9oixZzg6ZMrt3lc03kDzC8xZgKfpReiDIKQaqUBeutMJhg X-Received: by 2002:a05:6402:354b:b0:454:5162:42a6 with SMTP id f11-20020a056402354b00b00454516242a6mr3199963edd.281.1663643071848; Mon, 19 Sep 2022 20:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663643071; cv=none; d=google.com; s=arc-20160816; b=R1YEqghnhD6xJ/XH3w9Ue9EI9FvyZkqZ3EugAbd2hx+A+GaAetuX3MXfDQkfpFv0Yz 3EwMN7HBcBFJxmuh7ILuoPE74ewBq0UjHav/RLi/hmF+gEjeeDeqztclvlobZnFaBCYL iC6SVv8KcUl8OsWve0+GaZ+n/CHOPjziipD4fkIKAitHGoJ+y2TpNWNqMQ5SqJa7w+lH vpQOgakRvuN24N92edksXY/isAIT7wQz9jGezDBTS7tmYs891PP5H4LrP29sj/U+07El lN0j48RWKReZUSPf3hUuWYq3w/j99eA1Uvpmu2zX1iB+K1DnfBDgsfu8YbopHIDIrVfF FYCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=O8CRGXcYJbg7e39VGUOoP0cvfANv2U6Hp6Ub75UWqSA=; b=udqqGAIqGk6Gm78nItlR6oZGfQN7l5vnEn19LAUaeOtBWbbCODilSZqTp4oYf3gYhD tpnfc9CMjY7R/vnQMrDjI9sS5TnimSeB5MH9bybeE0pvCM7VodPQZTr++K8upQJ9yhLV tDoXfND8c2B2nX3cVXId2ynmdnUoCwPtP4kJSEKSUbivLOj60HeJU5ekJgmFlI4wn7Jl 9/vvDIQj5Sbl1s4Ra49i9Hi7KQEZG1qs0OBJCuOOVLonDa+spj92U+7SlV9W+M7I0nfx lCnA1Xx80qrvK908uWtpmn5A3On0zeb9MAxZyngIVQdpCkGOVlDbZQPmL83TjG4E29tI ZXUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="ncELY/m2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ey7-20020a0564022a0700b0044f288e02edsi406567edb.15.2022.09.19.20.04.07; Mon, 19 Sep 2022 20:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="ncELY/m2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiITCln (ORCPT + 99 others); Mon, 19 Sep 2022 22:41:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiITClh (ORCPT ); Mon, 19 Sep 2022 22:41:37 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A53051405; Mon, 19 Sep 2022 19:41:36 -0700 (PDT) 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 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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.