linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>
Cc: Michael Kerrisk-manpages <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>,
	Mark Mossberg <mark.mossberg@gmail.com>
Subject: Re: [PATCH] proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING
Date: Tue, 27 Oct 2020 19:56:41 +0100	[thread overview]
Message-ID: <bbe5b8f8-d636-377b-0172-ca5d634b7d61@suse.cz> (raw)
In-Reply-To: <20201012153313.GI29725@dhcp22.suse.cz>

On 10/12/20 5:33 PM, Michal Hocko wrote:
> On Mon 12-10-20 17:20:08, Jann Horn wrote:
>> On Mon, Oct 12, 2020 at 5:07 PM Michal Hocko <mhocko@suse.com> wrote:
>> > On Mon 12-10-20 13:49:40, Jann Horn wrote:
>> > > Since 34e55232e59f7b19050267a05ff1226e5cd122a5 (introduced back in
>> > > v2.6.34), Linux uses per-thread RSS counters to reduce cache contention on
>> > > the per-mm counters. With a 4K page size, that means that you can end up
>> > > with the counters off by up to 252KiB per thread.
>> >
>> > Do we actually have any strong case to keep this exception to the
>> > accounting?
>> 
>> I have no clue. The concept of "concurrently modified cache lines are
>> bad" seemed vaguely reasonable to me... but I have no idea how much
>> impact this actually has on massively multithreaded processes.
> 
> I do remember some discussion when imprecision turned out to be a real
> problem (Android?).
> 
> Anyway, I have to say that 34e55232e59f ("mm: avoid false sharing of
> mm_counter") sounds quite dubious to me and it begs for re-evaluation.

Agreed.
- false sharing? no, false sharing is when unrelated things share a cache line, 
this is a real sharing of a counter, AFAICS. If the problem is really 
exacerbated by false sharing of the counter with something else, then the fix is 
to move the counter or something else to a different cache line.
- the evaluation showing of 4.5 cache misses per fault reduced to 4, I think 0.5 
cache miss is negligible compared to a page fault
- "Anyway, the most contended object is mmap_sem if the number of threads 
grows." - and surprise surprise, 10 years later this is still true :)


> Btw. thanks for trying to document this weird behavior. This is
> certainly useful but I am suspecting that dropping it might be even
> better.
> 


      reply	other threads:[~2020-10-27 18:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 11:49 [PATCH] proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING Jann Horn
2020-10-12 14:52 ` Jann Horn
2020-10-27  7:05   ` Michael Kerrisk (man-pages)
2020-10-27 10:35     ` Jann Horn
2020-10-27 12:18       ` Michal Hocko
2020-10-27 13:49         ` Michal Hocko
2020-10-27 13:49       ` Michael Kerrisk (man-pages)
2020-10-12 15:07 ` Michal Hocko
2020-10-12 15:20   ` Jann Horn
2020-10-12 15:33     ` Michal Hocko
2020-10-27 18:56       ` Vlastimil Babka [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=bbe5b8f8-d636-377b-0172-ca5d634b7d61@suse.cz \
    --to=vbabka@suse.cz \
    --cc=jannh@google.com \
    --cc=linux-man@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.mossberg@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mtk.manpages@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).