From: David Hildenbrand <david@redhat.com>
To: Chen Taotao <chentt10@chinatelecom.cn>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] mm: get_mm_counter() get the total memory usage of the process
Date: Thu, 4 Apr 2024 21:30:36 +0200 [thread overview]
Message-ID: <e8810a1c-2fbd-4c48-a462-43014dadc608@redhat.com> (raw)
In-Reply-To: <20240322151139.7417-1-chentt10@chinatelecom.cn>
On 22.03.24 16:11, Chen Taotao wrote:
> Currently, the get_mm_counter() function returns only the value of
> the process memory counter percpu_counter ->count record, ignoring
> the memory usage count maintained by each CPU in the
> percpu_counter->counters array, which leads to an error in obtaining
> the memory usage count of a process, especially when there are many
> CPU cores. counts, especially when there are many CPU cores.
>
> It is now possible to have get_mm_counter() get the memory count of a
> process by adding the memory counts maintained by each cpu, thus getting
> an accurate memory count of the process.
>
> This patch is an unofficial version that simply fixes the above problem,
> as I'm not sure if it makes sense to do so.
What is the effective change? Do you have any real examples where we can
observe a real difference, so it's worth the churn?
On the other hand, doing the sum gets more expensive, do we care? How
expensive is it?
Such a discussion should ideally be part of this change log.
"I'm not sure if it makes sense" -- you tell us, how did you come up
with the idea? :)
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-04-04 19:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 15:11 Chen Taotao
2024-04-04 19:30 ` David Hildenbrand [this message]
2024-04-10 2:17 ` Tim Chen
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=e8810a1c-2fbd-4c48-a462-43014dadc608@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chentt10@chinatelecom.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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
all inboxes | Powered by JetHome®