Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1272999

Re: [PATCH v5 4/6] mm, proc: reduce cost of /proc/pid/smaps for unpopulated shmem mappings

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/6] mm, proc: reduce cost of /proc/pid/smaps for unpopulated shmem mappings
Date 2015-11-19 11:20 +0100
Message-ID <qwutR-7Ys-29@gated-at.bofh.it> (permalink)
References <qw7nA-13M-3@gated-at.bofh.it> <qw7nC-13M-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed 18-11-15 10:29:34, Vlastimil Babka wrote:
> Following the previous patch, further reduction of /proc/pid/smaps cost is
> possible for private writable shmem mappings with unpopulated areas where
> the page walk invokes the .pte_hole function. We can use radix tree iterator
> for each such area instead of calling find_get_entry() in a loop. This is
> possible at the extra maintenance cost of introducing another shmem function
> shmem_partial_swap_usage().
> 
> To demonstrate the diference, I have measured this on a process that creates a
> private writable 2GB mapping of a partially swapped out /dev/shm/file (which
> cannot employ the optimizations from the prvious patch) and doesn't populate it
> at all. I time how long does it take to cat /proc/pid/smaps of this process 100
> times.
> 
> Before this patch:
> 
> real    0m3.831s
> user    0m0.180s
> sys     0m3.212s
> 
> After this patch:
> 
> real    0m1.176s
> user    0m0.180s
> sys     0m0.684s
> 
> The time is similar to case where radix tree iterator is employed on the whole
> mapping.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Looks good as well.
Acked-by: Michal Hocko <mhocko@suse.com>
[...]
-- 
Michal Hocko
SUSE Labs
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/6] enhance shmem process and swap accounting Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100
  [PATCH v5 3/6] mm, proc: reduce cost of /proc/pid/smaps for shmem mappings Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100
    Re: [PATCH v5 3/6] mm, proc: reduce cost of /proc/pid/smaps for  shmem mappings Michal Hocko <mhocko@kernel.org> - 2015-11-19 11:10 +0100
  [PATCH v5 2/6] mm, proc: account for shmem swap in /proc/pid/smaps Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100
  [PATCH v5 1/6] mm, documentation: clarify /proc/pid/status VmSwap limitations for shmem Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100
  [PATCH v5 4/6] mm, proc: reduce cost of /proc/pid/smaps for unpopulated shmem mappings Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100
    Re: [PATCH v5 4/6] mm, proc: reduce cost of /proc/pid/smaps for  unpopulated shmem mappings Michal Hocko <mhocko@kernel.org> - 2015-11-19 11:20 +0100
  [PATCH v5 5/6] mm, shmem: add internal shmem resident memory accounting Vlastimil Babka <vbabka@suse.cz> - 2015-11-18 10:40 +0100

csiph-web