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=-2.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 C2C3EC28CF6 for ; Thu, 26 Jul 2018 08:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8389D20673 for ; Thu, 26 Jul 2018 08:19:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8389D20673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729089AbeGZJfc (ORCPT ); Thu, 26 Jul 2018 05:35:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:58074 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727790AbeGZJfc (ORCPT ); Thu, 26 Jul 2018 05:35:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 68661AED4; Thu, 26 Jul 2018 08:19:48 +0000 (UTC) Date: Thu, 26 Jul 2018 10:19:47 +0200 From: Michal Hocko To: Bruce Merry Cc: "Singh, Balbir" , Shakeel Butt , Andrew Morton , LKML , Linux MM , Johannes Weiner , Vladimir Davydov Subject: Re: Showing /sys/fs/cgroup/memory/memory.stat very slow on some machines Message-ID: <20180726081947.GA28386@dhcp22.suse.cz> References: <20180717212307.d6803a3b0bbfeb32479c1e26@linux-foundation.org> <20180718104230.GC1431@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 26-07-18 08:41:35, Bruce Merry wrote: > On 26 July 2018 at 02:55, Singh, Balbir wrote: > > Do you by any chance have use_hierarch=1? memcg_stat_show should just rely on counters inside the memory cgroup and the the LRU sizes for each node. > > Yes, /sys/fs/cgroup/memory/memory.use_hierarchy is 1. I assume systemd > is doing that. And this is actually good. Non hierarchical behavior is discouraged. The real problem is that we are keeping way too many zombie memcgs around and waiting for memory pressure to reclaim them and so they go away on their own. As I've tried to explain in other email force_empty before removing the memcg should help. Fixing this properly would require quite some heavy lifting AFAICS. We would basically have to move zombies out of the way which is not hard but we do not want to hide their current memory consumption so we would have to somehow move their stats to the parent. And then we are back to reparenting which has been removed by b2052564e66d ("mm: memcontrol: continue cache reclaim from offlined groups"). -- Michal Hocko SUSE Labs