All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joel@joelfernandes.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@suse.com,
	riel@redhat.com, minchan@google.com, hannes@cmpxchg.org,
	kirill.shutemov@linux.intel.com
Subject: Re: rmap for shmem pages
Date: Thu, 12 Dec 2019 09:43:13 -0500	[thread overview]
Message-ID: <20191212144313.GC129023@google.com> (raw)
In-Reply-To: <20191212105521.kwqn6hiudt3tbr6g@box>

On Thu, Dec 12, 2019 at 01:55:21PM +0300, Kirill A. Shutemov wrote:
> On Wed, Dec 11, 2019 at 06:51:08PM -0500, Joel Fernandes wrote:
> > Hi,
> > I am looking into a weird behavior of the VmRSS counter in /proc/pid/status
> > which I think is a bug.
> > 
> > The issue is if a memfd is mapped into the same process twice as MAP_SHARED, and
> > you write to both maps, then the RSS doubles even though the pages were
> > mapped elsewhere within the same address space before. We expect RSS to
> > increase only once in this case, not twice.
> 
> VmRSS is a best effort. Meeting your expectation would require rmap walk
> (as your patch does). It's way too expensive for fault path (especially
> under page table lock) just to keep percise statistics. Sorry, but you
> will not get it.

No problem. I was under the same impression that this is difficult to do in a
scalable way. I am glad I reached out but if anyone has any other ideas, let
me know.

thanks,

 - Joel


> 
> -- 
>  Kirill A. Shutemov


      reply	other threads:[~2019-12-12 14:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 23:51 rmap for shmem pages Joel Fernandes
2019-12-12 10:55 ` Kirill A. Shutemov
2019-12-12 14:43   ` Joel Fernandes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191212144313.GC129023@google.com \
    --to=joel@joelfernandes.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=minchan@google.com \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.