Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1188074ybi; Wed, 17 Jul 2019 10:55:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwOYdcBhjhV0CBC+eLluRLZr4KoZHZ1gqdzsKb8wF7lumaMBJiU8JTjZnrljKh0LjtXbVT X-Received: by 2002:a17:902:26c:: with SMTP id 99mr46315202plc.215.1563386138584; Wed, 17 Jul 2019 10:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563386138; cv=none; d=google.com; s=arc-20160816; b=xUowqLaNa2LUqKKDNJaIonaNGQkoFAZxuwI7kBHvswumcRlrj2fXMBKngyqHgT5hni qmi3L0ztpWyXy4uDJmiSPR0Qy56eRi4+vfKXXnG+ojZplsD87qmccftW8oZ/rg6m+0jQ dby/cymmDOK0HgsHareGe3skZy1Y8xxKQUoMUI+xeGmVbs+cceN7xqctF8G9HWZahr7/ wWXN+ctR3tbskrEDPGdjgVQnF/7yCcz8qUfU62q3h1EfFdkTl/zLQYLvtYjFN69XF8MI 186HXr67XOFZ1jzkKy/eKjNcOG1mAALerdzAABVFbok9CByAZ4T40hIyZmaUGPMThtby nXDA== 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; bh=z2SSmhd68h87dQhwvWTjUlLYyoXB//o48emXKDITCxQ=; b=JpdZMG6MEZJvIVvp3JOW/5KUmEoXeecB0uZnA55516QRv62zm7p2kLFuJwsgeJIrIS Dg8KSgqaTGuCj9N2XEpsYaqRyZcyB0qQcIvQ9t4uKf+7eNTnjNcfs2w99FgzR0FO/KWG 9+KovWihWXCZVJc834DbV8mQAKF0S3TaHMk338qTXLvdyRWZ49h4FHnXxPtJ2yN4BZXA t/Z1jNZBCwEtsGOyI9WNUuuhMoaqq/dyIUZ4Dbz1Nr/or6BUzpUorVAx9xG30+V13WlF DIgILMof1WcYBLkffwyoCNE6xj9Fs8A2X0pPxKnHDESz8hEYN1o8iWsjN2ShOuloLEje 7DJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=PicqJS4o; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a123si24734001pfd.114.2019.07.17.10.55.22; Wed, 17 Jul 2019 10:55:38 -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=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=PicqJS4o; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728638AbfGQRxX (ORCPT + 99 others); Wed, 17 Jul 2019 13:53:23 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35683 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbfGQRxX (ORCPT ); Wed, 17 Jul 2019 13:53:23 -0400 Received: by mail-pf1-f195.google.com with SMTP id u14so11219463pfn.2 for ; Wed, 17 Jul 2019 10:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z2SSmhd68h87dQhwvWTjUlLYyoXB//o48emXKDITCxQ=; b=PicqJS4oQ5peSgXROAA8eXF277L4r7XmQo7cZukrfLSYdqLgbwsEd5Dqzk8QpxK7iV Jr7zEtrtR7thmPO+J1QqTaT3j+I0++ACo6TT6aLs2O6D/+ubRqwsDUj8iqkYUHlSu3uP S2KX/7zlhOpvgyqTAThJQxGs1jnQy4eGdv0gbpjnWh/cRorbYj9HH98ccTyznWgcEXac q+hc0yDQCCnUJLqZHjU4NiRzAjIzNBE+SyaYhXxaMZoParySRgAtaVZmE7db4nbJWShy 2wprrKIAvpplpmvdMXRr1OD5xBE/XjJHL4qajuxjvrPz4tpMfAgYgXaVJxT7SoPPfBK0 oskQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=z2SSmhd68h87dQhwvWTjUlLYyoXB//o48emXKDITCxQ=; b=OGfAmv4DA98GIfNRvKfktw8Z2b3VYWcJiS5KSXnKnzHU9ZSU2Uhc9PEgtGfl28L8KM tHm1fz65+J7oTiLvNfCKW+Vw9Fp1NchiFhIqDH4JbsKz1MlIzxpRvztt/ukrp3dhhHMP 7gwvcUkx0/eUIe6V9kOEjUNcjUDZd4nbnyu8ZmU4NRIEiPBpEMZEbTU4ZpclTT8E1Sh4 q7Na1yq3nyqgD90uq9M1pSU7lJkgcmZAYsegCcwj7AVV8pvFSehS5QtjBObBrjVdly2B ZsHmB5KvpWM4nPnQTUxee6Dskbjb+7GeDDYsiLpa0SfFDNsHuB0+ADyTAuvUn2UDVaGK TW2Q== X-Gm-Message-State: APjAAAXGrDlbKJBAdSwB+TVh1aDD4bwc0ldeiHo9Qub7p7IH17/C7F6k pM3TXk94WYoXBMFemcuGKuI= X-Received: by 2002:a65:4d4e:: with SMTP id j14mr42320858pgt.50.1563386002312; Wed, 17 Jul 2019 10:53:22 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::3:4db]) by smtp.gmail.com with ESMTPSA id b26sm29434788pfo.129.2019.07.17.10.53.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 10:53:21 -0700 (PDT) Date: Wed, 17 Jul 2019 13:53:19 -0400 From: Johannes Weiner To: Konstantin Khlebnikov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko Subject: Re: [PATCH 2/2] mm/memcontrol: split local and nested atomic vmstats/vmevents counters Message-ID: <20190717175319.GB25882@cmpxchg.org> References: <156336655741.2828.4721531901883313745.stgit@buzz> <156336655979.2828.15196553724473875230.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <156336655979.2828.15196553724473875230.stgit@buzz> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 17, 2019 at 03:29:19PM +0300, Konstantin Khlebnikov wrote: > This is alternative solution for problem addressed in commit 815744d75152 > ("mm: memcontrol: don't batch updates of local VM stats and events"). > > Instead of adding second set of percpu counters which wastes memory and > slows down showing statistics in cgroup-v1 this patch use two arrays of > atomic counters: local and nested statistics. > > Then update has the same amount of atomic operations: local update and > one nested for each parent cgroup. Readers of hierarchical statistics > have to sum two atomics which isn't a big deal. > > All updates are still batched using one set of percpu counters. > > Signed-off-by: Konstantin Khlebnikov Yeah that looks better. Note that it was never about the atomics, though, but rather the number of cachelines dirtied. Your patch should solve this problem as well, but it might be a good idea to run will-it-scale on it to make sure the struct layout is still fine.