Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2012 18:51:04 -0400
From:      Andrew Duane <aduane@juniper.net>
To:        Ian Lepore <freebsd@damnhippie.dyndns.org>, Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   RE: /proc filesystem
Message-ID:  <AC6674AB7BC78549BB231821ABF7A9AEB8331670FD@EMBX01-WF.jnpr.net>
In-Reply-To: <1342132918.1123.140.camel@revolution.hippie.lan>
References:  <alpine.BSF.2.00.1206182030570.92893@wojtek.tensor.gdynia.pl> <4FDF8FF1.7020202@zonov.org> <alpine.BSF.2.00.1206190639580.1823@wojtek.tensor.gdynia.pl> <1342132918.1123.140.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Original Message-----
> From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd-
> hackers@freebsd.org] On Behalf Of Ian Lepore
> Sent: Thursday, July 12, 2012 6:42 PM
> To: Wojciech Puchar
> Cc: freebsd-hackers@freebsd.org
> Subject: Re: /proc filesystem
>=20
> On Tue, 2012-06-19 at 06:47 +0200, Wojciech Puchar wrote:
> > that is what i need.
> >
> > but still need some explanation after using it and reading manual
> >
> > say:
> >    PID              START                END PRT  RES PRES REF SHD  FL
> TP PATH
> >   1378           0x400000           0x5ac000 r-x  385  415   2   1 CN- =
vn /usr/local/bin/Xorg
> >   1378           0x7ab000           0x7bc000 rw-   17    0   1   0 C-- =
vn /usr/local/bin/Xorg
> >   1378           0x7bc000           0x800000 rw-   14    0   1   0 C-- =
df
> >   1378        0x8007ab000        0x8007c3000 r-x   24    0  32   0 CN- =
vn /libexec/ld-elf.so.1
> >   1378        0x8007c3000        0x8007f0000 rw-   43    0   1   0 C-- =
df
> >   1378        0x8007f0000        0x8007f2000 rw-    1    0   4   0 --- =
dv
> >   1378        0x8007f2000        0x8007f4000 rw-    2    0   4   0 --- =
dv
> >   1378        0x8007f4000        0x800874000 rw-   11    0   4   0 --- =
dv
> >   1378        0x800874000        0x800884000 rw-   16    0   4   0 --- =
dv
> >   1378        0x800884000        0x800895000 rw-   10    0   1   0 CN- =
df
> >   1378        0x8009c2000        0x8009c5000 rw-    3    0   1   0 C-- =
df
> >
> > 1) Xorg is mapped twice - IMHO first is text/rodata second is data. But
> > what "REF" really means here and why it is 2 once and 1 second.
> >
> > 2) what really PRES ("private resident") means? df (default) mappings a=
re
> > IMHO anonymous maps=3D=3Dprivate data of process. so why RES is nonzero=
 while
> > PRES is zero, while on shared code PRES is nonzero and large. what does=
 it
> > really means?
> >
> > thanks.
> >
>=20
> I'm catching up on threads I was following before I went on vacation,
> and it looks like there was never a response to this.  I'm interested in
> the answers to these questions too, so today I did some spelunking in
> the code to see what I could figure out.  I don't think I really
> understand things too well, but I'll just say what I think I found and
> hopefully the experts will correct anything I get wrong.
>=20
> I think you're right about the first two mappings in that procstat
> output.  The REF value is the reference count on the vm object (the
> vnode for the exe file, I presume).  I think the reason the reference
> count is 2 is that one reference is the open file itself, and the other
> is the shadow object.  I've always been a bit confused about the concept
> of shadow objects in freebsd's vm, but I think it's somehow related to
> the running processes that are based on that executable vnode.  For
> example, if another copy of Xorg were running, I think REF would be 3,
> and SHD would be 2.
>=20
> I don't know why there is no shadow object for the writable data mapping
> and why the refcount is only 1 for that.

BSS that doesn't exist in the file?

=A0...................................
Andrew Duane
Juniper Networks
+1 978-589-0551 (o)
+1 603-770-7088 (m)
aduane@juniper.net

=A0






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC6674AB7BC78549BB231821ABF7A9AEB8331670FD>