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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2412AC433EF for ; Fri, 22 Jul 2022 17:06:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235885AbiGVRGF (ORCPT ); Fri, 22 Jul 2022 13:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235591AbiGVRFz (ORCPT ); Fri, 22 Jul 2022 13:05:55 -0400 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D8008EEDF; Fri, 22 Jul 2022 10:05:50 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: Re: [PATCH] mm: Remove the redundant updating of stats_flush_threshold Date: Fri, 22 Jul 2022 10:05:41 -0700 Message-ID: References: <20220722164949.47760-1-jiebin.sun@intel.com> Mime-Version: 1.0 Return-path: 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= Content-Disposition: inline In-Reply-To: <20220722164949.47760-1-jiebin.sun-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jiebin Sun Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, tim.c.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, ying.huang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, amadeuszx.slawinski-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, tianyou.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, wangyang.guo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org 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!