[procps] Re: feature request: hugepage support in ps tools

  • From: Jaromir Capik <jcapik@xxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Mon, 2 Dec 2013 12:43:17 -0500 (EST)

Hello Dan.

The hugepage support has been introduced in the procps-ng/pmap tool
several months ago (switches -XX, -C, -c, -N, -n should allow you
to configure and display any entries supported by the running kernel)
and that means the prerequisity for backporting this feature
to RHEL6/procps is already met, but you need to do it the right way
(via support tickets / bugzilla).

Regards,
Jaromir.

--
Jaromir Capik
Red Hat Czech, s.r.o.
Software Engineer / Secondary Arch

Email: jcapik@xxxxxxxxxx
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkynova 99/71, 612 45, Brno, Czech Republic
IC: 27690016 


----- Original Message -----
> From: "Dan Pritts" <danno@xxxxxxxxx>
> To: procps@xxxxxxxxxxxxx
> Sent: Monday, December 2, 2013 5:51:14 PM
> Subject: [procps] feature request: hugepage support in ps tools
> 
> Hi folks,
> 
> Sorry for the spam, I really wasn't sure where to ask about this.
> 
> We're running several tomcat apps on an RHEL6 server.  We've
> configured Java to use hugepages, which seems to work fine.
> 
> I have been unable to find any tools that account for how much
> hugepage memory each java process is using.  The same problem
> is there for KVM guests, I guess.
> 
> I poked around in /proc and found some info in each process's
> numa_maps. for example:
> 
> 7f6463800000 default file=/anon_hugepage\040(deleted) huge anon=2
> dirty=2 N2=1 N3=1
> 
> I'm not entirely sure I've got everything correct, although my results
> are plausible.
> However, it's quite fragile, numa_maps is not readable by normal users,
> and it would sure be nice to have this in normal userland tools.
> 
> 
> 
> For the record and for anyone who happens across this in the archives,
> here's the perl I came up with.
> 
> sub counthugepages {
>      my $pid=$_[0];
>      open (NUMAMAPS, "/proc/$pid/numa_maps") || die "can't open numa_maps";
>      my $HUGEPAGECOUNT=0;
>      while (my $line=<NUMAMAPS>) {
>          next unless ($line =~ m{ huge }) ;
>          next unless ($line =~ m{dirty=});
>          chomp $line;
>          $line =~ s{.*dirty=}{};
>          $line =~ s{\s.*$}{};
>          $HUGEPAGECOUNT+=$line;
>      }
>      close NUMAMAPS;
>      # we want megabytes out, but we counted 2-megabyte hugepages
>      return ($HUGEPAGECOUNT*2);
> }
> 
> thanks
> danno
> --
> Dan Pritts
> ICPSR Computing & Network Services
> University of Michigan
> +1 (734)615-7362
> 

Other related posts: