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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 996E7C07E98 for ; Mon, 5 Jul 2021 05:30:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F400613DA for ; Mon, 5 Jul 2021 05:30:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F400613DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B65846B0011; Mon, 5 Jul 2021 01:30:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B14FB6B0036; Mon, 5 Jul 2021 01:30:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DD4C6B005D; Mon, 5 Jul 2021 01:30:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 7C79C6B0011 for ; Mon, 5 Jul 2021 01:30:37 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F1F748248047 for ; Mon, 5 Jul 2021 05:30:36 +0000 (UTC) X-FDA: 78327409272.25.CD72ED3 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf01.hostedemail.com (Postfix) with ESMTP id 9E3385002C2C for ; Mon, 5 Jul 2021 05:30:32 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="272775198" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="272775198" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 22:30:29 -0700 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="495996838" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.119]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 22:30:23 -0700 From: "Huang, Ying" To: Shakeel Butt Cc: Tejun Heo , Johannes Weiner , Muchun Song , Michal Hocko , Roman Gushchin , =?utf-8?Q?Michal_Kou?= =?utf-8?Q?tn=C3=BD?= , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] memcg: switch lruvec stats to rstat References: <20210615174435.4174364-1-shakeelb@google.com> Date: Mon, 05 Jul 2021 13:30:21 +0800 In-Reply-To: <20210615174435.4174364-1-shakeelb@google.com> (Shakeel Butt's message of "Tue, 15 Jun 2021 10:44:34 -0700") Message-ID: <877di549aq.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9E3385002C2C Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf01.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=ying.huang@intel.com X-Stat-Signature: iaqqpqwfttegqrzgjyrqwhoewi1mkjjd X-HE-Tag: 1625463032-772584 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: Hi, Shakeel, Shakeel Butt writes: > The commit 2d146aa3aa84 ("mm: memcontrol: switch to rstat") but skipped > the conversion of the lruvec stats as such stats are read in the > performance critical code paths and flushing stats may have impacted the > performances of the applications. This patch converts the lruvec stats > to rstat and later patch adds the periodic flushing of the stats and > thus remove the need to synchronously flushing the stats in the > performance critical code paths. > > The rstat conversion comes with the price i.e. memory cost. Effectively > this patch reverts the savings done by the commit f3344adf38bd ("mm: > memcontrol: optimize per-lruvec stats counter memory usage"). However > this cost is justified due to negative impact of the inaccurate lruvec > stats on many heuristics. One such case is reported in [1]. > > The memory reclaim code is filled with plethora of heuristics and many > of those heuristics reads the lruvec stats. So, inaccurate stats can > make such heuristics ineffective. [1] reports the impact of inaccurate > lruvec stats on the "cache trim mode" heuristic. Inaccurate lruvec stats > can impact the deactivation and aging anon heuristics as well. > > [1] https://lore.kernel.org/linux-mm/20210311004449.1170308-1-ying.huang@intel.com/ Sorry for late reply. I have just verified that this patchset can resolve the problem as in the above link for me. Thanks! Best Regards, Huang, Ying > Signed-off-by: Shakeel Butt > --- > Changes since v1: > - no changes >