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 X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75682C433E0 for ; Tue, 7 Jul 2020 17:52:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 39FAF20708 for ; Tue, 7 Jul 2020 17:52:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZDkM67lx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39FAF20708 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D6B626B00A4; Tue, 7 Jul 2020 13:52:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D1B266B00A6; Tue, 7 Jul 2020 13:52:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0A5F6B00A7; Tue, 7 Jul 2020 13:52:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id A7D816B00A4 for ; Tue, 7 Jul 2020 13:52:49 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 588181EE6 for ; Tue, 7 Jul 2020 17:52:49 +0000 (UTC) X-FDA: 77012025258.23.tray26_6008cbf26eb6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 2BD4737606 for ; Tue, 7 Jul 2020 17:52:49 +0000 (UTC) X-HE-Tag: tray26_6008cbf26eb6 X-Filterd-Recvd-Size: 3591 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Jul 2020 17:52:48 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id s9so50927305ljm.11 for ; Tue, 07 Jul 2020 10:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V/nLHP/a64QASjJIAOtt8ipI7UU8QCW6oWvo4l1cggo=; b=ZDkM67lxowhQftwo2fr4VRbpqt97Y6UFmgbkf27HOImXfi3YyD+s8bPZPt/EjIpGkB nmTNdVHBFvy41HqE03tLmcuzBxc8cEQWKWp980b0XL2mrguXcBWOK5lox+lCWNREQ/A3 wx1MHW9Fs4svwt8ZepMQN5MoFPygNHBgUYIwJIJD5lcpoLrn3VfNRYqwmNYEnIXcT2v9 WNOG37rCksUqsBLha5kNlLfn+ki5TNHXd07cF49OGt6BF6N5Afzv2z5rKd4bSj2Dsmih Z452EAh2SkwTASgBtKyahaXJy51MgohKtYwC+rLpKzH9LQC2zAjWGA3xMtK4AjYeaJ80 xrLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V/nLHP/a64QASjJIAOtt8ipI7UU8QCW6oWvo4l1cggo=; b=QixXH56Nf+pLANanW/gygbIvZ48cjQ6wXYAWDsV/m1sLZrldiKd7n+Ga57Lk76ECpw 5gSZ6goHfvfBHxgsH6bpn3sLTx6Ehb8FimA5Nivm5MoiIGGpXXGd7Ugnr9+LW1sGLhO0 oerL3MHqlsOPImsbjZLSGxIZ5qq5gdjTuOVaZ+jEThEU1IzpAvxor9zpUeNrswWm4V7o nic6STRaHQiyuJ3xh1H/H67e1OkYD1Vj5Di4YAeuPEOOhajJ0tmc17O6VG/pmFLlehPT 6QA8kkNF1i0sy7b2CK/topjJXM0DMmmiAHDFKtgHWJkOlD1Qo0hbJmpif/sxjxQaD0ni 3ENA== X-Gm-Message-State: AOAM530EpgbxUjXEHxSMC1pzOylD/Axbrq02/vxpbR8uV3amfIo4Fvqq 5nc3Dd0gZ0XqfijqoWJu6X6MleMQlQdHs+ZvLh1Y1A== X-Google-Smtp-Source: ABdhPJxmEviU4ufhbV7r3K3OAkUAqQc0pZDEiuTDPx1mQ5sjBFGPtYcHmchmvbDtsXiaWKN0VPnhHGNbl0jM+9b7egs= X-Received: by 2002:a2e:978c:: with SMTP id y12mr19271931lji.270.1594144367221; Tue, 07 Jul 2020 10:52:47 -0700 (PDT) MIME-Version: 1.0 References: <20200707173612.124425-1-guro@fb.com> <20200707173612.124425-3-guro@fb.com> In-Reply-To: <20200707173612.124425-3-guro@fb.com> From: Shakeel Butt Date: Tue, 7 Jul 2020 10:52:36 -0700 Message-ID: Subject: Re: [PATCH 3/3] mm: kmem: switch to static_branch_likely() in memcg_kmem_enabled() To: Roman Gushchin Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Linux MM , Vlastimil Babka , Kernel Team , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 2BD4737606 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.009505, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jul 7, 2020 at 10:36 AM Roman Gushchin wrote: > > Currently memcg_kmem_enabled() is optimized for the kernel memory > accounting being off. It was so for a long time, and arguably the > reason behind was that the kernel memory accounting was initially an > opt-in feature. However, now it's on by default on both cgroup v1 > and cgroup v2, and it's on for all cgroups. So let's switch over > to static_branch_likely() to reflect this fact. > > Unlikely there is a significant performance difference, as the cost > of a memory allocation and its accounting significantly exceeds the > cost of a jump. However, the conversion makes the code look more > logically. > > Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt