From: Chengming Zhou <chengming.zhou@linux.dev>
To: Sung-hun Kim <sfoon.kim@samsung.com>,
'David Hildenbrand' <david@redhat.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: sungguk.na@samsung.com, sw0312.kim@samsung.com, sebuns@gmail.com,
akpm@linux-foundation.org
Subject: Re: [PATCH v2] mm: ksm: Consider the number of ksm_mm_slot in the general_profit calculation
Date: Thu, 11 Jul 2024 14:32:53 +0800 [thread overview]
Message-ID: <727feddd-bc2d-4b70-aa0a-148b73a62948@linux.dev> (raw)
In-Reply-To: <0fe501dad351$ef692cb0$ce3b8610$@samsung.com>
On 2024/7/11 13:19, Sung-hun Kim wrote:
> Hello,
> I'm sorry for late reply, because there was an issue in the mail system of my company.
>
> In my humble opinion, this problem can be considered due to the objective of the value
> that can be gotten through general_profit.
> I think that there is no problem in getting the more accurate value through general_profit
> because it involves only negligible overhead due to the accounting of allocated metadata.
> Even the difference is small, it could affect the decision in the use of KSM on the
> memory-restricted device.
Seems reasonable, not sure how does it matters with a few more pages
consumption in your case.
> Since KSM only wastes the CPU time to find identical pages if the gain is small, so more
> accurate information is needed to decide whether KSM is used or not.
Apart from the CPU time for scanning and merging, another important
consideration is how dynamic changing of your merged pages, since it
has to CoW when fault on writing.
(And if you have swap enabled, KSM rmap can also bring some performance
affects, since it breaks CoW unconditionally.)
> Even though ksm_mm_slot and ksm_stable_node occupy few pages (or tens of pages), if KSM
> found small amount of pages_sharing, it can affect the gained profit.
> Because of that, I think that including other metadata in general_profit calculation is
> not a big problem if tracking such metadata causes negligible overhead.
>
> It's my mistake in omitting the consideration of ksm_stable_node. The patch should include
> the calculation of the amount of ksm_stable_node.
FYI: I sent a patch that includes ksm_stable_node in general_profit some
time ago. You can take it as you want:
https://lore.kernel.org/all/20240508-b4-ksm-counters-v1-4-e2a9b13f70c5@linux.dev/
Thanks.
next prev parent reply other threads:[~2024-07-11 6:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240620043920epcas1p1b57dce789304aa96fd83e5b2b194d244@epcas1p1.samsung.com>
2024-06-20 4:39 ` Sung-hun Kim
2024-06-20 19:38 ` David Hildenbrand
2024-06-21 2:30 ` Chengming Zhou
2024-07-11 5:19 ` Sung-hun Kim
2024-07-11 6:32 ` Chengming Zhou [this message]
2024-06-20 20:47 ` Andrew Morton
2024-07-11 5:25 ` Sung-hun Kim
2024-07-11 6:10 ` Sung-hun Kim
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=727feddd-bc2d-4b70-aa0a-148b73a62948@linux.dev \
--to=chengming.zhou@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sebuns@gmail.com \
--cc=sfoon.kim@samsung.com \
--cc=sungguk.na@samsung.com \
--cc=sw0312.kim@samsung.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