Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3526256pxv; Sun, 4 Jul 2021 22:33:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1Upu5uuFkNhlRXc5DsOlXAOD7d82yvhL+T93QCw48gC1kZTkE19ay/VAdx8nmetTcEorx X-Received: by 2002:aa7:c38f:: with SMTP id k15mr14226682edq.156.1625463223727; Sun, 04 Jul 2021 22:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625463223; cv=none; d=google.com; s=arc-20160816; b=VhhKpxV4nEmkRZIaq8EQeKuIEwOOeA2P4fKqzLVtpNT1rPh+7FqIFGQOsUAaKtp30/ 9fK3/Su2rGW/E+ttXK+OICr/chxMi8iZly683pYCv7LmAgG1Z9ZNCT6XcWKIgl8cQJAD jKgGJi+hy3TL4tx7gzJhcy28d8hXkV4KECSCPvvZCqMrnr3aGKmZcetsLcQ+7b8dk5w3 snKWV664JnvuAFw/0ylKtIs42erhYkMCGIvpdVJTWABzjzf8ySKGXNMi/kkP/Im8CFAx qFdGYiPk3jBDEc6OTKsCKNj1FD4W+L2ZMSamCgc3fBdkLOw4QjMZlHbQBlgoNFPJ/8hX ukRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=AdPUv4xgZ/IKn11ECPx2pvgdkPST034PvU5jRvKsRA0=; b=SlbjxoNAAL1MjMyAKNI7HTRpePnN8Mh3TJ+X5dgL4sUwujyDalGIAFm8k5dEMo8Tkl G+O04GKktba+ItNTk3gVdUXyE1jTBILH//Db2B1i0RHT4ybqtkE4oEWWh2f2N3rlZf+k zzR/pN8Bdb+7FbDNHLDjqTEzUjCxwjCOPyjDN2KClKcd0yOYVPfsIPD5C3lMFrxOqSPA kXB4fnZ7HskofcvXiZ1HBQ2Di5Td6cs7uoS9IPdpbQ4lmlEJGQGttjDdLomozupX5O3K fzuiifEApFHs+mr2FDY46qsbJzJ/QFyjwqFpt717jqdUCsfsXkI/Qi7bYUi16+VZWN3J YAbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si10363766edc.121.2021.07.04.22.33.08; Sun, 04 Jul 2021 22:33:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbhGEFdH (ORCPT + 99 others); Mon, 5 Jul 2021 01:33:07 -0400 Received: from mga04.intel.com ([192.55.52.120]:48282 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbhGEFdH (ORCPT ); Mon, 5 Jul 2021 01:33:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="207097821" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="207097821" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >