Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp109050ybi; Thu, 13 Jun 2019 12:30:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUsTk3xqaUMK2coqm9Vek1rBo5XBqSpT1sgoFGvqwDOwolJiTufKfw+TWhBTcwH074db0b X-Received: by 2002:a62:6844:: with SMTP id d65mr95300932pfc.175.1560454218077; Thu, 13 Jun 2019 12:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560454218; cv=none; d=google.com; s=arc-20160816; b=OiKIuJDic4NULgTfdcuq+2JgevDDrhMyigrkxXRIpeuBQdigcI6VXbrrT1WkgnZYgB S6U1DB9Wk2xvUAtnPtAcSBY2E1T5LsikxL+zjqgWcut783+qLZcloU5ilOQU4uVeHI7D gAIxjBMPPj+5TsXTlywxsFAWAsnkx3IZ5in9RuB4UV0ypoMcVjLAf/OdEmKt/LLZ+ivf fy3zEUdCCpaqPsC8wMjFu86dvwlA9fK9e98csq6EKjLBcAhYF+sQP9NfRb4CRTm9OqGN GlEx7lAl6r56AJKaZF0QN1v9j0gTy8n4sp/yyNiGIiDYuf04XLO9v1WQrHZ3GSonzOfD wiNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=D5VuumMmQckexCkx1gvf8MG4/teLQOkFAExHtMrV75E=; b=qIUw4d477M/7dFi+1+H7nr1fup+dKVeMUHBQqlp/FyY+vCDmgpLTNW83q8BydhPFPc ViK2ORMXRxHsgaFEGdv/ToY4gZBrYmz5wZiL1URX3gwf/JNzI3GPudUFgJKtNqKMatUA neHxHYcu5JinUwLEbhSVbveh8ygMNb75TjdbpXNRbqB0Jvp/Ns+xml6XZ0Ua2xCDwqoQ 7YXkMpcQ1aGL9xxFXsztjfuZASo41VRDi6UciA8FayUiFgTzwGoGFvBaDB61YpJOJ0n2 dtk+vSqZND3S1jyITgTbX8F1wDZJdfzb/PCNyTCvOxapUrqda88WRnSjYIVyYw2GKkXc LWXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PsKvLzul; 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 m64si478996pgm.274.2019.06.13.12.30.02; Thu, 13 Jun 2019 12:30:18 -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=@kernel.org header.s=default header.b=PsKvLzul; 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 S1727076AbfFMT36 (ORCPT + 99 others); Thu, 13 Jun 2019 15:29:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbfFMT36 (ORCPT ); Thu, 13 Jun 2019 15:29:58 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55DF62147A; Thu, 13 Jun 2019 19:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560454197; bh=3nq7RwSer/Bwj8wjlB+pF0Ss6fAkxhqxBxJF0LKmZok=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PsKvLzul3M76GkVQT+iREuWkduH+sv/EbpqVqvWMxorQopPHVDOT2k5gkJNIiKZLo Wt8JuIjy7KWL7G7WfDWj49p2z5kDCYd6eCd4e/tJkh8JYO8BuqeKnzN4SCFIjyzuSX 8pGOSssDk1JR7zA93vfBURmASTgo8/sfqPOhARXQ= Date: Thu, 13 Jun 2019 12:29:56 -0700 From: Andrew Morton To: Joel Savitz Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan , Vlastimil Babka , "Aneesh Kumar K.V" , Michael Ellerman , Ram Pai , Andrea Arcangeli , Huang Ying , Sandeep Patil , Rafael Aquini , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4] fs/proc: add VmTaskSize field to /proc/$$/status Message-Id: <20190613122956.2fe1e200419c6497159044a0@linux-foundation.org> In-Reply-To: <1560437690-13919-1-git-send-email-jsavitz@redhat.com> References: <1560437690-13919-1-git-send-email-jsavitz@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Jun 2019 10:54:50 -0400 Joel Savitz wrote: > The kernel provides no architecture-independent mechanism to get the > size of the virtual address space of a task (userspace process) without > brute-force calculation. This patch allows a user to easily retrieve > this value via a new VmTaskSize entry in /proc/$$/status. Why is access to ->task_size required? Please fully describe the use case. > --- a/Documentation/filesystems/proc.txt > +++ b/Documentation/filesystems/proc.txt > @@ -187,6 +187,7 @@ read the file /proc/PID/status: > VmLib: 1412 kB > VmPTE: 20 kb > VmSwap: 0 kB > + VmTaskSize: 137438953468 kB > HugetlbPages: 0 kB > CoreDumping: 0 > THP_enabled: 1 > @@ -263,6 +264,7 @@ Table 1-2: Contents of the status files (as of 4.19) > VmPTE size of page table entries > VmSwap amount of swap used by anonymous private data > (shmem swap usage is not included) > + VmTaskSize size of task (userspace process) vm space This is rather vague. Is it the total amount of physical memory? The sum of all vma sizes, populated or otherwise? Something else?