From: Andrew Morton <akpm@linux-foundation.org>
To: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: cgel.zte@gmail.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org, corbet@lwn.net,
xu xin <xu.xin16@zte.com.cn>, Yang Yang <yang.yang29@zte.com.cn>,
Ran Xiaokai <ran.xiaokai@zte.com.cn>,
wangyong <wang.yong12@zte.com.cn>,
Yunkai Zhang <zhang.yunkai@zte.com.cn>,
Matthew Wilcox <willy@infradead.org>
Subject: Re: [PATCH v6] mm/ksm: introduce ksm_force for each process
Date: Thu, 12 May 2022 15:37:53 -0700 [thread overview]
Message-ID: <20220512153753.6f999fa8f5519753d43b8fd5@linux-foundation.org> (raw)
In-Reply-To: <5820954.lOV4Wx5bFT@natalenko.name>
On Tue, 10 May 2022 15:30:36 +0200 Oleksandr Natalenko <oleksandr@natalenko.name> wrote:
> > If ksm_force is set to 1, force all anonymous and 'qualified' VMAs
> > of this mm to be involved in KSM scanning without explicitly calling
> > madvise to mark VMA as MADV_MERGEABLE. But It is effective only when
> > the klob of /sys/kernel/mm/ksm/run is set as 1.
> >
> > If ksm_force is set to 0, cancel the feature of ksm_force of this
> > process (fallback to the default state) and unmerge those merged pages
> > belonging to VMAs which is not madvised as MADV_MERGEABLE of this process,
> > but still leave MADV_MERGEABLE areas merged.
>
> To my best knowledge, last time a forcible KSM was discussed (see threads [1], [2], [3] and probably others) it was concluded that a) procfs was a horrible interface for things like this one; and b) process_madvise() syscall was among the best suggested places to implement this (which would require a more tricky handling from userspace, but still).
>
> So, what changed since that discussion?
>
> P.S. For now I do it via dedicated syscall, but I'm not trying to upstream this approach.
Why are you patching the kernel with a new syscall rather than using
process_madvise()?
next prev parent reply other threads:[~2022-05-12 22:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 12:22 [PATCH v6] mm/ksm: introduce ksm_force for each process cgel.zte
2022-05-10 13:30 ` Oleksandr Natalenko
2022-05-11 3:12 ` CGEL
2022-05-12 22:37 ` Andrew Morton [this message]
2022-05-13 9:51 ` Oleksandr Natalenko
2022-05-13 20:32 ` Andrew Morton
2022-05-13 20:53 ` Oleksandr Natalenko
2022-05-12 21:07 ` Matthew Wilcox
2022-05-13 6:50 ` CGEL
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=20220512153753.6f999fa8f5519753d43b8fd5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cgel.zte@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleksandr@natalenko.name \
--cc=ran.xiaokai@zte.com.cn \
--cc=wang.yong12@zte.com.cn \
--cc=willy@infradead.org \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=zhang.yunkai@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;
as well as URLs for NNTP newsgroup(s).