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 83B8EC433EF for ; Fri, 22 Jul 2022 17:05:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904676B0072; Fri, 22 Jul 2022 13:05:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B3886B0073; Fri, 22 Jul 2022 13:05:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C9336B0074; Fri, 22 Jul 2022 13:05:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6E6336B0072 for ; Fri, 22 Jul 2022 13:05:51 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1E04AC0D04 for ; Fri, 22 Jul 2022 17:05:51 +0000 (UTC) X-FDA: 79715362902.16.EFF826F Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf14.hostedemail.com (Postfix) with ESMTP id 8997F100003 for ; Fri, 22 Jul 2022 17:05:50 +0000 (UTC) Date: Fri, 22 Jul 2022 10:05:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658509548; 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: in-reply-to:in-reply-to:references:references; bh=Y7js1RWyqBx3oqDhoWUrWmYCp205K7/u6aMi9Husos0=; b=r7ZEFRF55ukGJSsMqum8ZkCKf6/PLDX0tZRl767erRdenIBURHWA9F1mJlJDIhD2k54sd8 i38xddVh8wdQJ4uxAkd1BE/363j3hZ9M+lmyMSV5ta9ON9JOP2a41+b9R3+7O8Tcm3FOAA 8OxpP9CIfaMBpn0ieQXqAHXxtMKqouE= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Jiebin Sun Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, shakeelb@google.com, songmuchun@bytedance.com, akpm@linux-foundation.org, tim.c.chen@intel.com, ying.huang@intel.com, amadeuszx.slawinski@linux.intel.com, tianyou.li@intel.com, wangyang.guo@intel.com Subject: Re: [PATCH] mm: Remove the redundant updating of stats_flush_threshold Message-ID: References: <20220722164949.47760-1-jiebin.sun@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220722164949.47760-1-jiebin.sun@intel.com> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=r7ZEFRF5; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658509550; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Y7js1RWyqBx3oqDhoWUrWmYCp205K7/u6aMi9Husos0=; b=G8AYrZHo0q8vNI2736YdvmQY3ZgkkTKAoa9IXXnHp8fFWz66baQiyvK+6B51/TNHFipIZZ 7+5J5qifHUHEKVRSdlqmeVL+RSTBNvD+rm1TG63i01sqpi/62TW9dbdNF+0zWhXTYB1lgC jFSXWVM/AnBW6yy8F7dlQWHtrLSCe60= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658509550; a=rsa-sha256; cv=none; b=Hzadq2KrpIygw0EKdOjnxNpi9cRWXnpFBDNfiHVM1DzNEWuAAEqWz3IhCfQJtR/A0FKzAI QAkwn4iDSCOe53deCF8gzz9Ig/0hX7m3zb0mhqrO5KDHpcNn/kkr6WUT24AnJE+RDm0vn2 TmhXvDwinsGWzMRZTwF/fe4xPdDHcmQ= X-Rspam-User: X-Stat-Signature: 3dbn6g1n5bbw8fwp5nf843nfepyujwoc X-Rspamd-Queue-Id: 8997F100003 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=r7ZEFRF5; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspamd-Server: rspam04 X-HE-Tag: 1658509550-1018 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 Sat, Jul 23, 2022 at 12:49:49AM +0800, Jiebin Sun wrote: > From: jiebin sun > > Remove the redundant updating of stats_flush_threshold. If the > global var stats_flush_threshold has exceeded the trigger value > for __mem_cgroup_flush_stats, further increment is unnecessary. > > Apply the patch and test the pts/hackbench-1.0.0 Count:4 (160 threads). > > Score gain: 1.95x > Reduce CPU cycles in __mod_memcg_lruvec_state (44.88% -> 0.12%) > > CPU: ICX 8380 x 2 sockets > Core number: 40 x 2 physical cores > Benchmark: pts/hackbench-1.0.0 Count:4 (160 threads) > > Signed-off-by: Jiebin Sun Reviewed-by: Roman Gushchin Good optimization, thanks!