Received: by 10.213.65.68 with SMTP id h4csp2315617imn; Thu, 5 Apr 2018 12:46:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+3fDCFxEVSwtrCfNhFflSuebweJBekoW8McUltNf9RnXISuqVFf3f3czk9+tXUb07SidmS X-Received: by 10.99.4.3 with SMTP id 3mr15710538pge.147.1522957609435; Thu, 05 Apr 2018 12:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522957609; cv=none; d=google.com; s=arc-20160816; b=Bm6PgAVYuFI0kkfFwV03LCMSquwWuoo/Ksc6WRy3pdUPK/TwOq9DJpkxxfX6r1lu9h QDJNKFGysVEEUezAKRFCvtuB1dTLRJAfG2X4AGFgkOFU2vy2fa/Us0dxoEXvi+o2p+5Q Mvzp9sIPmyOt9VwCTAFdNF8FvQ/RPklrARg4NJPUHirySXXaPJm41tSkw57NQhgHyB3y vUxlxPZxEjx9xBDtM2GjrybqcGT1JBMBN8RPBlPqDKy92GXU4NN7CK4fWPYqDEZjNiZU lO1rbnSMLoiZotUQ9NfEQx00WxuN040Hn7gQPYOYHZafhnvz4ESnAiyN5DlvKDEI1fz0 3Ekw== 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:dkim-signature:arc-authentication-results; bh=Lu84HhAZLrxfZ7APj9U2wL/V2z1LAEgNQc4VQ9m3ue8=; b=xx0TY1Tk6WfoH8pGK+ifcFdUanxmT4cBdYQFgPb1yfHBVwU9lFKSNsVYj46D/5lqsw /4EpC+IJhaLN4wC0LwYl3PxbY3GcTG1SE5jhZbMul28l3czn+SdUbAkvismejmMqnK4i AmQSTMCCxlE7xHN5sKAvtySoyreGnMyoM7k3xjkcQQthrpZGTgJeOsv6jITe8fcW7pwn smLiS7n01EfPhL0yv24g5QbFZnojIOWsU7e4Jl+triVz3I7VuodY7QfJJ2YFSETgJTZY u/rmCBZHl/J1NYO1MLNCB65OWY8rCIEC1PV+b9u8OBICuGimBrKyUL294fM3ldudsi/W SL+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ItMgZJIe; 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 z73si6073591pgd.688.2018.04.05.12.46.34; Thu, 05 Apr 2018 12:46:49 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ItMgZJIe; 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 S1752915AbeDETpR (ORCPT + 99 others); Thu, 5 Apr 2018 15:45:17 -0400 Received: from mail-yb0-f174.google.com ([209.85.213.174]:43674 "EHLO mail-yb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbeDETpP (ORCPT ); Thu, 5 Apr 2018 15:45:15 -0400 Received: by mail-yb0-f174.google.com with SMTP id z5-v6so11611490ybo.10; Thu, 05 Apr 2018 12:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Lu84HhAZLrxfZ7APj9U2wL/V2z1LAEgNQc4VQ9m3ue8=; b=ItMgZJIerwheaw+bM0d63QykEV57Dybf7syBVk0rcJWIAiFY5VcTToyOSo0rzJm8ZJ 0IHGy/n3lzQR+vcv2GHeqSNmbV6O4sj/pdLlS8oYgFmXdUVvp1peOxeXrLFuZ7G3y41g 4WSvs9AI9OabljiPK0d6U/TiFzy9e3kIC7SqEICGPeI8K2MKaEywAiikr1e77NLn7Kyx Wda7G/rhWht2BUmi8Kk274WeUIvzctYDuyrqr6zh1P6JfLcTBVk1A+KekZK3df774n07 leg8FlAwdiRa749UOp6ibs5eshZnP0J+lO9F5JNx/8Ie0Uc030+UHAgzGgFUF736L/KS G2tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Lu84HhAZLrxfZ7APj9U2wL/V2z1LAEgNQc4VQ9m3ue8=; b=QxBC5rVOaN6CCxZYB5TART7W5jV9H+UX+Q5YxyVSjUc8Di0+NQe68K5bMl8becbLPs BHGBPF/AnhvZoc60Nyzjnjkvv9+6vH/C3SMehkyT1HP7keuYYylYtsNxLMlKzpTjQCoa vHIXTZFmRQrpG1RsG8vRdMlFM1U72mX7YEIAfALtI5+f4ipniOzgNf0optc2RfO9qT7f 6Q4Mwnzvzj7xNvpqWPmVI+LuO64oQMpLILPSXRDMh+6Dk1zQTYdtV7dC/dVY0XHTZt8r KTM4T4hgYWOvKRj9sXh4/rCGk5b8QqvfmbZrEmg6ClVTgVzkge63ZaLfZlug0q6emZXJ K0sA== X-Gm-Message-State: ALQs6tDgUgiPRngBjFYlZ8Y3YD1RSvreFAJUxvXCXJrtImW2CrPLPuEz Jpnua95iezfa7VcWfTfxLcE= X-Received: by 10.129.68.19 with SMTP id r19mr5177950ywa.184.1522957514736; Thu, 05 Apr 2018 12:45:14 -0700 (PDT) Received: from localhost ([2620:10d:c091:200::3b76]) by smtp.gmail.com with ESMTPSA id e126sm819432ywb.91.2018.04.05.12.45.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 12:45:13 -0700 (PDT) Date: Thu, 5 Apr 2018 12:45:12 -0700 From: Tejun Heo To: Johannes Weiner Cc: Michal Hocko , 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: <20180405194512.GD3126663@devbig577.frc2.facebook.com> 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.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 05, 2018 at 01:55:16PM -0400, 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. > > Fixes: a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat reporting") > Reported-by: Tejun Heo > Signed-off-by: Johannes Weiner Yeah, that works. FWIW, Acked-by: Tejun Heo Thanks. -- tejun