[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6285f983.1c69fb81.b0a8b.837f@mx.google.com>
Date: Thu, 19 May 2022 08:02:10 +0000
From: CGEL <cgel.zte@...il.com>
To: Michal Hocko <mhocko@...e.com>
Cc: akpm@...ux-foundation.org, ammarfaizi2@...weeb.org,
oleksandr@...alenko.name, willy@...radead.org, linux-mm@...ck.org,
corbet@....net, linux-kernel@...r.kernel.org,
xu xin <xu.xin16@....com.cn>,
Yang Yang <yang.yang29@....com.cn>,
Ran Xiaokai <ran.xiaokai@....com.cn>,
wangyong <wang.yong12@....com.cn>,
Yunkai Zhang <zhang.yunkai@....com.cn>,
Jiang Xuexin <jiang.xuexin@....com.cn>,
Hugh Dickins <hughd@...gle.com>, linux-api@...r.kernel.org
Subject: Re: [PATCH] mm/ksm: introduce ksm_enabled for each process
On Thu, May 19, 2022 at 09:35:30AM +0200, Michal Hocko wrote:
> On Thu 19-05-22 06:23:30, CGEL wrote:
> > On Wed, May 18, 2022 at 02:12:26PM +0200, Michal Hocko wrote:
> > > On Wed 18-05-22 02:47:06, CGEL wrote:
> > > > On Tue, May 17, 2022 at 04:04:38PM +0200, Michal Hocko wrote:
> > > > > [CCing Hugh and linux-api]
> > > > >
> > > > > On Tue 17-05-22 09:27:01, cgel.zte@...il.com wrote:
> > > > > per mm but the actual implementation currently relies on the per-vma
> > > > > flags. That means that one can explicitly disallow merging by madvise
> > > > > for a range. Is it wise to override that by a per-process knob? I mean
> > > > > there might be a very good reason why a particular memory ranges should
> > > > > never be merged but a per-process knob could easily ignore that hint
> > > > > from the application. Or am I just confuse?
> > > > For now, there is no any hints for letting KSM never merge some memory
> > > > ranges.
> > >
> > > I am not sure I understand. Could you be more specific?
> >
> > Not like THP, KSM doesn't have anything like VM_NOHUGEPAGE, so apps
> > cann't explicitly disallow merging by madvise. If it is really necessary for
> > a particular meory ranges of a process to be never merged, we have to submit
> > one more patch to achieve that.
>
> What about MADV_UNMERGEABLE?
MADV_UNMERGEABLE and MADV_MERGEABLE usually appear in pairs, MADV_UNMERGEABLE cannot
appear alone. I mean MADV_UNMERGEABLE is used to unmerges whatever it merged in the
specifed range, not to disallow merging.
> --
> Michal Hocko
> SUSE Labs
Powered by blists - more mailing lists