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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 0D251C433FE for ; Tue, 8 Dec 2020 17:12:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 879E523B03 for ; Tue, 8 Dec 2020 17:12:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 879E523B03 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 B9A5E6B005C; Tue, 8 Dec 2020 12:12:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B4C376B005D; Tue, 8 Dec 2020 12:12:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3BA66B006C; Tue, 8 Dec 2020 12:12:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 8B71A6B005C for ; Tue, 8 Dec 2020 12:12:37 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4C3C71EF1 for ; Tue, 8 Dec 2020 17:12:37 +0000 (UTC) X-FDA: 77570759154.07.beam78_320e35d273e8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 2B1DB1803F9A5 for ; Tue, 8 Dec 2020 17:12:37 +0000 (UTC) X-HE-Tag: beam78_320e35d273e8 X-Filterd-Recvd-Size: 4214 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Tue, 8 Dec 2020 17:12:36 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id r24so24748041lfm.8 for ; Tue, 08 Dec 2020 09:12:36 -0800 (PST) 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=bnx49xFSvA7q3rgIKoEpfKZQJyDfrQ+btFsm1ai/FT0=; b=JihjsAonP1AKn20jbkLUY4mpmXSySX+rP2HMcmnqKhDmGRo2U3313PQR4RgwtPqJZP V6UfCH7fHr2bqTCNsojyQzj4uPaoXLmZwc+YVu43F6u3Kcnm6pWxSqJmf3/1ZjijAXUG bE9H2H1f46qcjUgGFBqR3LEHDJ/UyFKl1btIyrTnlVTAkZG+CT8p7OVML870e6dc7jpp CBMVZ26RvlI3XfWeZBMm/LQZ25mrvczdjXufWEWd7FLXqUafCn12+afXeyASN/++5hBJ nWFu4nC4C/LpRS+K93Erneo1JrUwVOsQOY7N8drsj9DMI7WLuY7fT11/iYTknFOpqrzz KDRw== 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=bnx49xFSvA7q3rgIKoEpfKZQJyDfrQ+btFsm1ai/FT0=; b=hYt/e2yHb84iuE0t0QaEqzOwL4CsErKjN1gFM/A+8wIhFVqI5vcNhi4oLW4qx4ayy2 0xMTaPnpFxy3XhRImP1t8wU35UMAv5i3DTeWBX2r/IUGJZoIiqzWZU5nfNoL3h3JXX80 WQ3xOFNbcfNBfR2BILFtqn1VE0QhmkmPhtB4pD4nxKKe2o2QKDkoBVQvxzjObOKJoNdb 3hwB9ZdBvrEvCmvlZGN7mGtiC6AK3j+3MKxTyH1PYmkJK5M2q4Q1kXqYnn/fzHQRoP3n I78WK+7ZMxzCSPmen19UCtyaYUGiyQfPsGdgLEy1JIqEImdbWzxDCPCxs3inKpWtdESZ 3ZHg== X-Gm-Message-State: AOAM532/00mip1Ms3DTRFGtYcxiLsXTdIJkf8ecsm+sdHcvSboxo7ej6 2y9QuRdzN1WEC94Ba7lfbkI2Lhg5bXy9TbxEFnMCrCN5WxmjEw== X-Google-Smtp-Source: ABdhPJxaNrPWz97bRVdzz5ZQvgE29Mdjc4AC5iEBrElK/INA22veT35CFfeLF8RTemZsCi3dm/3yxgR+JvKOisuRlKY= X-Received: by 2002:a05:6512:1082:: with SMTP id j2mr5683700lfg.347.1607447554225; Tue, 08 Dec 2020 09:12:34 -0800 (PST) MIME-Version: 1.0 References: <20201207142204.GA18516@rlk> <20201208060747.GA56968@rlk> In-Reply-To: <20201208060747.GA56968@rlk> From: Shakeel Butt Date: Tue, 8 Dec 2020 09:12:23 -0800 Message-ID: Subject: Re: [PATCH] mm/page_alloc: simplify kmem cgroup charge/uncharge code To: Hui Su , Michal Hocko Cc: LKML , Linux MM , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.006721, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: +Michal Hocko Message starts at https://lkml.kernel.org/r/20201207142204.GA18516@rlk On Mon, Dec 7, 2020 at 10:08 PM Hui Su wrote: > > On Mon, Dec 07, 2020 at 09:28:46AM -0800, Shakeel Butt wrote: > > On Mon, Dec 7, 2020 at 6:22 AM Hui Su wrote: > > > > The reason to keep __memcg_kmem_[un]charge_page functions is that they > > were called in the very hot path. Can you please check the performance > > impact of your change and if the generated code is actually same or > > different. > > Hi, Shakeel: > > I objdump the mm/page_alloc.o and comapre them, it change the assemble code > indeed. In fact, it change some code order, which i personally think won't have > impact on performance. And i ran the ltp mm and conatiner test, it seems nothing > abnormal. Did you run the tests in a memcg? The change is behind a static key of kmem accounting which is enabled for subcontainers. > > BUT i still want to check whether this change will have negative impact on > perforance due to this change code was called in the very hot path like you > said, AND saddly i did not find a way to quantify the impact on performance. > Can you give me some suggestion about how to quantify the performance or some > tool? > At least I think we can try with a simple page allocation in a loop i.e. alloc_page(GFP_KERNEL_ACCOUNT). I will think of any existing benchmark which exercises this code path. Michal, do you have any suggestions?