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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 AE5BBC433FE for ; Wed, 9 Dec 2020 16:29:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4FDFA2076B for ; Wed, 9 Dec 2020 16:29:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FDFA2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A21046B00EA; Wed, 9 Dec 2020 11:29:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D1C36B00EB; Wed, 9 Dec 2020 11:29:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 899F86B00EC; Wed, 9 Dec 2020 11:29:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id 71E026B00EA for ; Wed, 9 Dec 2020 11:29:41 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7945B1EE6 for ; Wed, 9 Dec 2020 16:29:40 +0000 (UTC) X-FDA: 77574279720.13.tiger83_071834f273f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 4982518140B70 for ; Wed, 9 Dec 2020 16:29:40 +0000 (UTC) X-HE-Tag: tiger83_071834f273f1 X-Filterd-Recvd-Size: 3512 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 9 Dec 2020 16:29:37 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607531376; h=from:from:reply-to: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=9xUW8Dmv5mRMmD07Vnox+GxN1NtoZFKgjjUp7YIwwjg=; b=fUEW8+h0L6wEknj3P4q4OGgeLzaYH6bXInbPHNzFUGnBNwx2u5SY2U0Vp2ojubvOSS8UPQ dbrYzPBlWEgXsxbYF3CSHKzt1Afgu+6JKmrSCPmi6W0n5jsvJGGHIMSuTAP23LXrVlKjHw PWjfU96c+eRvRKqGTBYVIOlCCO/i6Ik= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7C279AD71; Wed, 9 Dec 2020 16:29:36 +0000 (UTC) Date: Wed, 9 Dec 2020 17:29:35 +0100 From: Michal Hocko To: Shakeel Butt Cc: Hui Su , LKML , Linux MM , Andrew Morton Subject: Re: [PATCH] mm/page_alloc: simplify kmem cgroup charge/uncharge code Message-ID: <20201209162935.GD26090@dhcp22.suse.cz> References: <20201207142204.GA18516@rlk> <20201208060747.GA56968@rlk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue 08-12-20 09:12:23, Shakeel Butt wrote: > +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? I have to say I do not see any big benefit from the patch and it alters a real hot path to check for the flag even in cases where kmem accounting is not enabled, unless I am misreading the code. -- Michal Hocko SUSE Labs