Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp613427ybi; Sat, 15 Jun 2019 07:56:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNAasl9k2f0MGP8iBawD6stf9Yli/RfkdfER8utL/x+jzdvbtUChB/6TLFpfqcDOpzFF8G X-Received: by 2002:a17:90a:9281:: with SMTP id n1mr16155790pjo.25.1560610579956; Sat, 15 Jun 2019 07:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560610579; cv=none; d=google.com; s=arc-20160816; b=yiJlCrYTLlpe/ztk9esRq2cmqenmDVylaXc4l2v2J1pAp9KSukalW/Jt4KbC1zwUwW U2chYUDPMuDkXz3ksRYk8rrx3WvhmCV760qV+zs2FRXl+lTQJ0WoZFgZn2VpKoiLRkaz A6be4141vwnNIHvDNnoZO2akxbAESPh72z86DdhoWFMrM2hA32PzqS9868Rnnyb+vQkH V/CTm4tjg7TDJOz0SHsRx9790D6cjiVGWwvHLt6vUUJmTIEIIAA37ULKt6KXyId7RMgr T2OsDhuSLbrzrxOPbZ9Xn/NS6PjXuz3jzxhqdjoihPKqjOkL3Gr8G++9NU8g/QRPqRwe Cg2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=gFmJrg9gTcnKcoZCiQypnNRQNxX/k8DGBmBoxNPZno8=; b=fpfNDEXEldRaPZTXDBmlcj7B1+oa5WnsoikzynWvLF68IN6LRXdmKNnhmoXrbvyTxB IbarQM7/1ZSah2PlPzZOULlKbnhk1EyrwAVjxPxuoDpVQudKECs4EvN8jCKlyKCcHvhk EodumGnSBfnBrSRiCxHFIWojs/SNK2nwHb25jsBkwzfsVVDrjV4mHANvb0bW5+Ht+Ok3 9kn4P4jtw8/ECAeXbHyjyNjHD6cSqAxxz4ymCnMLGlLGdzmOw9/7qPgFJhamheFIb/ge +oY3KZLlQEIx4WTGPAIH+O90lk2UkAoEBz6RnjbqgRQe60v6WD6hicqxrxk3r+Y99Nxk YAbg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si5197800pfn.182.2019.06.15.07.56.03; Sat, 15 Jun 2019 07:56:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726658AbfFOOzr (ORCPT + 99 others); Sat, 15 Jun 2019 10:55:47 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:41738 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfFOOzq (ORCPT ); Sat, 15 Jun 2019 10:55:46 -0400 Received: by mail-ot1-f68.google.com with SMTP id 107so5379175otj.8 for ; Sat, 15 Jun 2019 07:55:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gFmJrg9gTcnKcoZCiQypnNRQNxX/k8DGBmBoxNPZno8=; b=r4Ef5xci3IcfgANTOYuexqeiC7A1+hdCfHSv8mrCB7yFhftOgmoAdImtlBuQ08ySPF e+RbnhgG5Z4cosPH/h9AgPpmnEJXQcQIwQTnfCXJmKa69OvxPgaCkn9RxHd8YP+Tqyuo TPNpzi64mzQLNQqT66YzpMFdRaM7x+ACNK8qSR6EYXDcXXYJs8MA1z/9qR4pJVLb1LEv qVbCHBKrSVbh6Fi97Z0fX10RZtzbNYHpyjllu3s75puGckuwXTBJwqpXOnCrpvzpbNxS F0fnaZ+CulKndUb6Lj7Oi7fFejjxYkxGaY3JXZpZfHSFE5vD2GRAOn1hf316PgwoSwBG /Glw== X-Gm-Message-State: APjAAAWTeg5s0jQ+NwWckza5kg5hL2z0+0/f+bLWp69NOR5HVxw776Ic 6g1W27BNtoqa/5KqBYuwtHkeXTzsDjZxa6euDWQ/yQ== X-Received: by 2002:a9d:67d5:: with SMTP id c21mr33729557otn.243.1560610546148; Sat, 15 Jun 2019 07:55:46 -0700 (PDT) MIME-Version: 1.0 References: <1560437690-13919-1-git-send-email-jsavitz@redhat.com> <20190613122956.2fe1e200419c6497159044a0@linux-foundation.org> In-Reply-To: <20190613122956.2fe1e200419c6497159044a0@linux-foundation.org> From: Joel Savitz Date: Sat, 15 Jun 2019 10:55:31 -0400 Message-ID: Subject: Re: [PATCH v4] fs/proc: add VmTaskSize field to /proc/$$/status To: Andrew Morton 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The most immediate use case is the optimization of an internal test, but upon closer examination neither this patch nor the test itself turn out to be worth pursuing. Thank you for your time and constructive comments. Best, Joel Savitz On Thu, Jun 13, 2019 at 3:30 PM Andrew Morton wrote: > > 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? > >