mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: xu xin <xu.xin.sc@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	shr@devkernel.io, hughd@google.com, xu.xin16@zte.com.cn
Subject: Re: [PATCH 1/3] ksm: add ksm involvement information for each process
Date: Tue, 3 Sep 2024 10:04:14 +0200	[thread overview]
Message-ID: <cec0ed06-b5d0-45aa-ad2b-eaca6dd7bacb@redhat.com> (raw)
In-Reply-To: <20240903042754.1776245-1-xu.xin16@zte.com.cn>

On 03.09.24 06:27, xu xin wrote:
>>> In /proc/<pid>/ksm_stat, Add two extra ksm involvement items including
>>> KSM_mergeable and KSM_merge_any. It helps administrators to
>>> better know the system's KSM behavior at process level.
>>>
>>> KSM_mergeable: yes/no
>>>      whether any VMAs of the process'mm are currently applicable to KSM.
>>>
>>> KSM_merge_any: yes/no
>>>      whether the process'mm is added by prctl() into the candidate list
>>>      of KSM or not, and fully enabled at process level.
>>>
>>> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
>>> ---
>>> Changelog
>>> =========
>>> v2 -> v3:
>>>           Update the KSM_mergeable getting method: loop up if any vma is
>>>           mergeable to KSM.
>>>          https://lore.kernel.org/all/bc0e1cdd-2d9d-437c-8fc9-4df0e13c48c0@redhat.com/
>>>
>>> v1 -> v2:
>>>           replace the internal flag names with straightforward strings.
>>>           * MMF_VM_MERGEABLE -> KSM_mergeable
>>>           * MMF_VM_MERGE_ANY -> KSM_merge_any
>>>
>>>    fs/proc/base.c      |  4 ++++
>>>    include/linux/ksm.h |  1 +
>>>    mm/ksm.c            | 16 ++++++++++++++++
>>>    3 files changed, 21 insertions(+)
>>>
>>> diff --git a/fs/proc/base.c b/fs/proc/base.c
>>> index 18550c071d71..45e12560e698 100644
>>> --- a/fs/proc/base.c
>>> +++ b/fs/proc/base.c
>>> @@ -3217,6 +3217,10 @@ static int proc_pid_ksm_stat(struct seq_file *m, struct pid_namespace *ns,
>>>            seq_printf(m, "ksm_zero_pages %lu\n", mm->ksm_zero_pages);
>>>            seq_printf(m, "ksm_merging_pages %lu\n", mm->ksm_merging_pages);
>>>            seq_printf(m, "ksm_process_profit %ld\n", ksm_process_profit(mm));
>>> +        seq_printf(m, "KSM_mergeable: %s\n",
>>> +                ksm_process_mergeable(mm) ? "yes" : "no");
>>> +        seq_printf(m, "KSM_merge_any: %s\n",
>>> +                test_bit(MMF_VM_MERGE_ANY, &mm->flags) ? "yes" : "no");
>>
>> Inconsistent "KSM" casing .
> 
> Excuse me, could you be more specific? I didn't get it

Everything is "ksm_" and you add "KSM_". Better keep that consistent.

-- 
Cheers,

David / dhildenb


      reply	other threads:[~2024-09-03  8:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240901043525.16831>
2024-09-03  4:27 ` xu xin
2024-09-03  8:04   ` David Hildenbrand [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=cec0ed06-b5d0-45aa-ad2b-eaca6dd7bacb@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shr@devkernel.io \
    --cc=xu.xin.sc@gmail.com \
    --cc=xu.xin16@zte.com.cn \
    /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®