Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4852560imm; Tue, 7 Aug 2018 08:23:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/4oaL62T9gG0sxWy7n2vMjssanN1buqzZ/YWa6fFSz9F2HAAubcTxe5KIDjG80fNAX0hW X-Received: by 2002:a17:902:b595:: with SMTP id a21-v6mr18394582pls.23.1533655413029; Tue, 07 Aug 2018 08:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533655412; cv=none; d=google.com; s=arc-20160816; b=s+vVidsneARbT0pW/M0Kx2nWXcVN1zjDuD17V2lKCqgUiSMK8o2FVHCyum+w1PBHO3 e+KYuKtleaA/Q8SZ/7itzBrHY8z5Q1/YfPMZYztG4mbVJaqiZ2zppwdScQClmTObGAi3 u2KV+8G/MB58wdG2Gzwn8eR1kaB25MNgqUZw9tpjTV/DWapqtjyrv5a3VjEr7qA9YhHe 7Wtaos2o/drxIOJsdAH5iG7yQ9qU2YP/+oJeux/Muz3YHtqEvg+BeRKVWDDkVGosJ/zt wXl0z6e5DvJmKE07WvaOfvhZQLeopdLRZCL1w3V0chd1X+hB7pf2qohnl8es69FTa1Bo YXyA== 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=IspYKn8aA7Wwm3ENxk/LZ3X9RRVT+aS3yIBl8lxrmmA=; b=WdUWFWvlSphh6bxanVk0tzopLIpPEk5SlR68/Iw79wO+zD+uxmXVWypxjGNpRyx3XZ HOHuj0bu1bVs7TKXe//ffgcjsMQ8OYTMfY3U3llnNM2ni2UutPH7s2vafckbA6G2gtLC PNAzr+Y/Ap/XgPGKa/eOSWafKCil1zYdumVA+pgPj68jxkY+aOd90LGwl2xgqketdzj0 Ara1G+DG755dFkluTwIz/is96E7T8xiW+38V/AwjiDOtfVreIMBdPalgWdhbvp5JxE0q keZ/9SDXW17KafBny4RQ6l4tjb82Z9OXYFnEWsEMKetfkdi/F0DmALAjJrBMl7xV4WzQ pihQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Ecq8f/sn"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si1773473pfb.218.2018.08.07.08.23.18; Tue, 07 Aug 2018 08:23:32 -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=@gmail.com header.s=20161025 header.b="Ecq8f/sn"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403810AbeHGRSR (ORCPT + 99 others); Tue, 7 Aug 2018 13:18:17 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39114 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732619AbeHGRSQ (ORCPT ); Tue, 7 Aug 2018 13:18:16 -0400 Received: by mail-pf1-f195.google.com with SMTP id j8-v6so8728393pff.6; Tue, 07 Aug 2018 08:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IspYKn8aA7Wwm3ENxk/LZ3X9RRVT+aS3yIBl8lxrmmA=; b=Ecq8f/snc8PvPyCVOTOrlfCPrkPq/RToknbTx5CP9tLN6IvdZB6wUR3oisgAoFYX4D XewHul8pmSqIoQWO2Wl0BNunW37iePkFPEAJWOBwVR9jtSmI9g4xAErUs42xzUt46t2j WgUGgesWReLL4i4eeFyVZA7hWOP2iUqQIr4qHRGgF3TxrNNZzry3HqzwCdHqHaAbVlz0 rn4w3bw13CVdpkEyJrGFZtXDa5J3cu/Ssb+mv6o6sLdmT9K5vXsScSrVvHozuRg2ELJo 2ZfBorX8xBoIMaBSXRafdSvQT7abvCkOieoK/bpverX4D8QU7Z851XaN3jeBGj30VgYF A0fw== 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=IspYKn8aA7Wwm3ENxk/LZ3X9RRVT+aS3yIBl8lxrmmA=; b=Pu/4YWEPexc9bYGhHwzf6Zy1Pc9wSGyL2sxZxC2/U7BxgN7AHr8pJKHFkmwDmW/322 VQxXSCe802K7cCUQrDkKlWO/M1xsLJTM0XvE9a7WZP44ip+i1biHV8t012MKbiOwJfkt /BCvat2AHiF4J8FhePiFghm1ljSVr7qVniuRagYvkubVkMRZ1LvRA+CqIl0GRDISaECp C3+DUXiLohluHVLrkXXkoQK5xsLOLnsliBdtjOZtUBG0AhUkTyAAqVNY2kIQKIcR8Wn9 +EJFjIlCq9OX8G+5T+FOsY4c7nLste5K4JiOnK09uwSbaucRIoyDzaB43P/PT4vg66Vd 8Srw== X-Gm-Message-State: AOUpUlG0imNGg3ZXuA3Uc/HX+euiTm7pYpejYSXiD/TtxYizFrLLToYe Ka0SK6ZX63O7+AddBZBOGHA= X-Received: by 2002:a65:5cc5:: with SMTP id b5-v6mr18752706pgt.425.1533654212143; Tue, 07 Aug 2018 08:03:32 -0700 (PDT) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c090:180::1:e25]) by smtp.gmail.com with ESMTPSA id d81-v6sm3891035pfj.122.2018.08.07.08.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Aug 2018 08:03:31 -0700 (PDT) Date: Tue, 7 Aug 2018 08:03:16 -0700 From: Dennis Zhou To: Vlastimil Babka Cc: Andrew Morton , Tejun Heo , Johannes Weiner , Christoph Lameter , Roman Gushchin , kernel-team@fb.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Linux API Subject: Re: [PATCH] proc: add percpu populated pages count to meminfo Message-ID: <20180807150315.GA59704@dennisz-mbp.dhcp.thefacebook.com> References: <20180807005607.53950-1-dennisszhou@gmail.com> <3b792413-184b-20b1-9d90-9e69f0df8cc4@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b792413-184b-20b1-9d90-9e69f0df8cc4@suse.cz> 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 Hi Vlastimil, On Tue, Aug 07, 2018 at 03:18:31PM +0200, Vlastimil Babka wrote: > > Documentation/filesystems/proc.txt should be updated as well > Will do. > > > > +/* > > + * The number of populated pages in use by the allocator, protected by > > + * pcpu_lock. This number is kept per a unit per chunk (i.e. when a page gets > > + * allocated/deallocated, it is allocated/deallocated in all units of a chunk > > + * and increments/decrements this count by 1). > > + */ > > +static int pcpu_nr_populated; > > It better be unsigned long, to match others. > Yeah that makes sense. I've changed this for v2. > > +/* > > + * pcpu_nr_populated_pages - calculate total number of populated backing pages > > + * > > + * This reflects the number of pages populated to back the chunks. > > + * Metadata is excluded in the number exposed in meminfo as the number of > > + * backing pages scales with the number of cpus and can quickly outweigh the > > + * memory used for metadata. It also keeps this calculation nice and simple. > > + * > > + * RETURNS: > > + * Total number of populated backing pages in use by the allocator. > > + */ > > +int pcpu_nr_populated_pages(void) > > Also unsigned long please. > Changed for v2. Thanks, Dennis