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


Groups > linux.kernel > #1591260

Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps
Date 2017-03-02 17:40 +0100
Message-ID <tgBVM-4ZX-3@gated-at.bofh.it> (permalink)
References (1 earlier) <tevKN-693-17@gated-at.bofh.it> <tgdgK-4b6-21@gated-at.bofh.it> <tghDH-77b-11@gated-at.bofh.it> <tghDH-77b-9@gated-at.bofh.it> <tgzTY-3s2-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 02-03-17 09:01:01, Johannes Weiner wrote:
> On Wed, Mar 01, 2017 at 07:57:35PM +0100, Michal Hocko wrote:
> > On Wed 01-03-17 13:31:49, Johannes Weiner wrote:
[...]
> > > The error when reading a specific smaps should be completely ok.
> > > 
> > > In numbers: even if your process is madvising from 16 different CPUs,
> > > the error in its smaps file will peak at 896K in the worst case. That
> > > level of concurrency tends to come with much bigger memory quantities
> > > for that amount of error to matter.
> > 
> > It is still an unexpected behavior IMHO and an implementation detail
> > which leaks to the userspace.
> 
> We have per-cpu fuzz in every single vmstat counter. Look at
> calculate_normal_threshold() in vmstat.c and the sample thresholds for
> when per-cpu deltas are flushed. In the vast majority of machines, the
> per-cpu error in these counters is much higher than what we get with
> pagevecs holding back a few pages.

Yes but vmstat counters have a different usecase AFAIK. You mostly look
at those when debugging or watching the system. /proc/<pid>/smaps is
quite often used to do per task metrics which are then used for some
decision making so it should be less fuzzy if that is possible.

> It's not that I think you're wrong: it *is* an implementation detail.
> But we take a bit of incoherency from batching all over the place, so
> it's a little odd to take a stand over this particular instance of it
> - whether demanding that it'd be fixed, or be documented, which would
> only suggest to users that this is special when it really isn't etc.

I am not aware of other counter printed in smaps that would suffer from
the same problem, but I haven't checked too deeply so I might be wrong. 

Anyway it seems that I am alone in my position so I will not insist.
If we have any bug report then we can still fix it.

-- 
Michal Hocko
SUSE Labs

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


Thread

Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Michal Hocko <mhocko@kernel.org> - 2017-03-01 15:20 +0100
  Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Michal Hocko <mhocko@kernel.org> - 2017-03-01 19:00 +0100
  Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Michal Hocko <mhocko@kernel.org> - 2017-03-01 20:00 +0100
    Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Minchan Kim <minchan@kernel.org> - 2017-03-02 09:00 +0100
    Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Johannes Weiner <hannes@cmpxchg.org> - 2017-03-02 15:30 +0100
      Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Michal Hocko <mhocko@kernel.org> - 2017-03-02 17:40 +0100
        Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Andrew Morton <akpm@linux-foundation.org> - 2017-03-04 01:20 +0100
          Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Michal Hocko <mhocko@kernel.org> - 2017-03-07 13:30 +0100
            Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Andrew Morton <akpm@linux-foundation.org> - 2017-03-08 02:30 +0100
              Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Minchan Kim <minchan@kernel.org> - 2017-03-08 07:00 +0100
  Re: [PATCH V5 6/6] proc: show MADV_FREE pages info in smaps Johannes Weiner <hannes@cmpxchg.org> - 2017-03-01 21:30 +0100

csiph-web