fix text reporting in O(1) proc_pid_statm()

From: William Lee Irwin III (wli_at_holomorphy.com)
Date: 08/24/04

  • Next message: Lee Revell: "Re: [patch] voluntary-preempt-2.6.8.1-P8"
    Date:	Tue, 24 Aug 2004 10:05:47 -0700
    To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
    
    

    On Tue, Aug 24, 2004 at 12:55:39AM -0700, William Lee Irwin III wrote:
    > Merely removing down_read(&mm->mmap_sem) from task_vsize() is too
    > half-assed to let stand. The following patch removes the vma iteration
    > as well as the down_read(&mm->mmap_sem) from both task_mem() and
    > task_statm() and callers for the CONFIG_MMU=y case in favor of
    > accounting the various stats reported at the times of vma creation,
    > destruction, and modification. Unlike the 2.4.x patches of the same
    > name, this has no per-pte-modification overhead whatsoever.
    > This patch quashes end user complaints of top(1) being slow as well as
    > kernel hacker complaints of per-pte accounting overhead simultaneously.
    > Incremental atop the task_vsize() de-mmap_sem-ification of 2.6.8.1-mm4:

    Some kind of brainfart happened here, though it's not visible on the
    default display from top(1) etc. This patch fixes up the gibberish I
    mistakenly put down for text with the proper text size, and subtracts
    it from data as per the O(vmas) code beforehand.

    Index: mm4-2.6.8.1/fs/proc/task_mmu.c
    ===================================================================
    --- mm4-2.6.8.1.orig/fs/proc/task_mmu.c 2004-08-23 18:29:33.000000000 -0700
    +++ mm4-2.6.8.1/fs/proc/task_mmu.c 2004-08-24 10:00:21.530755896 -0700
    @@ -36,8 +36,8 @@
                    int *data, int *resident)
     {
             *shared = mm->shared_vm;
    - *text = mm->exec_vm - ((mm->end_code - mm->start_code) >> PAGE_SHIFT);
    - *data = mm->total_vm - mm->shared_vm;
    + *text = (mm->end_code - mm->start_code) >> PAGE_SHIFT;
    + *data = mm->total_vm - mm->shared_vm - *text;
             *resident = mm->rss;
             return mm->total_vm;
     }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Lee Revell: "Re: [patch] voluntary-preempt-2.6.8.1-P8"

    Relevant Pages

    • Re: [patch] mlock-as-nonroot revisted
      ... > (which includes dropping refcount on the user struct) should be when ... >> other part of the patch, but reading those patches I can't see where the ... >> accounting for fs persistent storage. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 2.6.7] BSD accounting + IO stats
      ... Fields was already in the BSD accounting but they were ... The patch is based on the CSA accounting patch. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH 2.6.11-rc4-mm1] end-of-proces handling for acct-csa
      ... > This patch is to modify the acct_processin acct.c, ... > invoked from do_exitto handle eop for BSD accounting. ... > the acct_processwrapper will also take care of CSA, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] mlock-as-nonroot revisted
      ... >> This is exactly why named hugetlb files are NOT included ... >> in this accounting, only the ones created through the SHM ... Nope, Arjan's patch touch hugetlb_zero_setup, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch 2.6.8.1] BSD accounting: update chars transferred value
      ... > This patch is a subset of csa_io with your patch deals with character ... to add some CSA accounting values in the BSD-accounting. ...
      (Linux-Kernel)