2015-02-03 03:26:44

by Petr Cermak

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] task_mmu: Add user-space support for resetting mm->hiwater_rss (peak RSS)

On Mon, Jan 26, 2015 at 04:00:20PM -0800, David Rientjes wrote:
> [...]
> This is a result of allowing something external (process B) be able to
> clear hwm so that you never knew the value went to 100MB. That's the
> definition of a race, I don't know how to explain it any better and making
> any connection between clearing PG_referenced and mm->hiwater_rss is a
> stretch. This approach just makes mm->hiwater_rss meaningless.

I understand your concern, but I hope you agree that the functionality we
are proposing would be very useful for profiling. Therefore, I suggest
adding an extra resettable field to /proc/pid/status (e.g.
resettable_hiwater_rss) instead. What is your view on this approach?


2015-02-03 15:51:13

by Minchan Kim

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] task_mmu: Add user-space support for resetting mm->hiwater_rss (peak RSS)

Hello,

On Tue, Feb 03, 2015 at 03:26:28AM +0000, Petr Cermak wrote:
> On Mon, Jan 26, 2015 at 04:00:20PM -0800, David Rientjes wrote:
> > [...]
> > This is a result of allowing something external (process B) be able to
> > clear hwm so that you never knew the value went to 100MB. That's the
> > definition of a race, I don't know how to explain it any better and making
> > any connection between clearing PG_referenced and mm->hiwater_rss is a
> > stretch. This approach just makes mm->hiwater_rss meaningless.
>
> I understand your concern, but I hope you agree that the functionality we
> are proposing would be very useful for profiling. Therefore, I suggest
> adding an extra resettable field to /proc/pid/status (e.g.
> resettable_hiwater_rss) instead. What is your view on this approach?

The idea would be very useful for measuring working set size for
efficient memory management in userside, which becomes very popular
with many platforms for embedded world with tight memory.

>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to [email protected]. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

--
Kind regards,
Minchan Kim

2015-02-03 20:16:40

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] task_mmu: Add user-space support for resetting mm->hiwater_rss (peak RSS)

On Wed, 4 Feb 2015, Minchan Kim wrote:

> > > This is a result of allowing something external (process B) be able to
> > > clear hwm so that you never knew the value went to 100MB. That's the
> > > definition of a race, I don't know how to explain it any better and making
> > > any connection between clearing PG_referenced and mm->hiwater_rss is a
> > > stretch. This approach just makes mm->hiwater_rss meaningless.
> >
> > I understand your concern, but I hope you agree that the functionality we
> > are proposing would be very useful for profiling. Therefore, I suggest
> > adding an extra resettable field to /proc/pid/status (e.g.
> > resettable_hiwater_rss) instead. What is your view on this approach?
>
> The idea would be very useful for measuring working set size for
> efficient memory management in userside, which becomes very popular
> with many platforms for embedded world with tight memory.
>

The problem is the same as the aforementioned if you're only going to be
adding one field. If another process happens to clear the
resettable_hiwater_rss before you can read it, you don't see potentially
large spikes in size.

I understand the need for measuring working set size, and we have an
in-house solution for that, but I don't think we should be introducing new
fields that require only one root process on the system to be touching it
for it to be effective. Let me talk with some people about how difficult
it would be to propose our in-house solution.