Received: by 10.213.65.68 with SMTP id h4csp546566imn; Fri, 6 Apr 2018 05:04:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+N0JPUMUdQ3LjzYekw6wLyzFv3gmaXT0mZpTtpdHR/j8+6qzUr2OKFkaLa6W0qaGXGaODN X-Received: by 2002:a17:902:aa96:: with SMTP id d22-v6mr26864151plr.106.1523016267488; Fri, 06 Apr 2018 05:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523016267; cv=none; d=google.com; s=arc-20160816; b=uf6Bo4OJ2BIyu/3O0X26LwENY74CyBOu6CP14e6qlFy9uEb/0qDmmpGnWUEkrd8axu tnSWo8ugn77gh/70pCeYT7SoA5bCPwNmW3K8iK2O++U3i7YnL+f1P62VfeKY4qs7zafB oYYTagVsyv6u/kGIl08JtZh1SOOapVk7e1Ak9kDOLrl6nZU2CGtbjW09spw8xXeh7fwP MyChCWAnnADhB6Rodv3VUypq8WNSizqaxCNKI/GU5W4RbUkI1ZC6O3Bgh3vUUu3lBCrP EyTt/BNw5iVKykqnbid4q4hrOchshqaWlTNrlrDKo5a8tV3g0Yputb26aLodNznyKBPb 5Kqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0Je1+HMOX0mMZ5mC2maaaG8+gsyr85t6on+FXwZHGCU=; b=t6k6Rk6k6JqmSrDFF/9slaXFk9g/h3UaYERVbcNmuvYeG8ZS24dXl0QTeCSHWJuyoQ wL096my9uPgqzWKHuGW8h75GBD24FzV92FoZ8Md9PTH0L6LI1o+WoTaBOz2ygjjakNUO SQBP3DsF4X/1o7KDWVPP6X/id4aLv3RdjZYd/mCVqgJcE6/or8cjxJW5EAWhylzwbNi/ CJCVunLbQPqkvm+QF5tSHB8ITN/BoJcl3gm76rSSu2Zjs5GB222bM/zT6aDlZJ+W4G4S VdQ93xlvzvBRYydHMGo6eQDFaVR/cDNQo4/3ZBNbx/7D3Hu4/KjAHw0dYRDjY0A0cFDW /tZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si5106380pgf.499.2018.04.06.05.04.12; Fri, 06 Apr 2018 05:04:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbeDFMDH (ORCPT + 99 others); Fri, 6 Apr 2018 08:03:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:44632 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbeDFMDF (ORCPT ); Fri, 6 Apr 2018 08:03:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F0096AF13; Fri, 6 Apr 2018 12:03:03 +0000 (UTC) Date: Fri, 6 Apr 2018 14:03:02 +0200 From: Michal Hocko To: Johannes Weiner Cc: Tejun Heo , vdavydov.dev@gmail.com, guro@fb.com, riel@surriel.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, cgroups@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: memcg: make sure memory.events is uptodate when waking pollers Message-ID: <20180406120302.GL8286@dhcp22.suse.cz> References: <20180324160901.512135-1-tj@kernel.org> <20180324160901.512135-2-tj@kernel.org> <20180404140855.GA28966@cmpxchg.org> <20180404141850.GC28966@cmpxchg.org> <20180404143447.GJ6312@dhcp22.suse.cz> <20180404165829.GA3126663@devbig577.frc2.facebook.com> <20180405175507.GA24817@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180405175507.GA24817@cmpxchg.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 05-04-18 13:55:16, Johannes Weiner wrote: [...] > >From 4369ce161a9085aa408f2eca54f9de72909ee1b1 Mon Sep 17 00:00:00 2001 > From: Johannes Weiner > Date: Thu, 5 Apr 2018 11:53:55 -0400 > Subject: [PATCH] mm: memcg: make sure memory.events is uptodate when waking > pollers > > a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat > reporting") added per-cpu drift to all memory cgroup stats and events > shown in memory.stat and memory.events. > > For memory.stat this is acceptable. But memory.events issues file > notifications, and somebody polling the file for changes will be > confused when the counters in it are unchanged after a wakeup. > > Luckily, the events in memory.events - MEMCG_LOW, MEMCG_HIGH, > MEMCG_MAX, MEMCG_OOM - are sufficiently rare and high-level that we > don't need per-cpu buffering for them: MEMCG_HIGH and MEMCG_MAX would > be the most frequent, but they're counting invocations of reclaim, > which is a complex operation that touches many shared cachelines. > > This splits memory.events from the generic VM events and tracks them > in their own, unbuffered atomic counters. That's also cleaner, as it > eliminates the ugly enum nesting of VM and cgroup events. I agree with the patch I am just worried about the naming a bit. It is quite confusing TBH. events should be vm_events and memory_events should be limit_events or something like that. > Fixes: a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat reporting") > Reported-by: Tejun Heo > Signed-off-by: Johannes Weiner Anyway Acked-by: Michal Hocko -- Michal Hocko SUSE Labs