lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 May 2022 07:40:30 +0000
From:   CGEL <cgel.zte@...il.com>
To:     Balbir Singh <bsingharora@...il.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>
Subject: Re: [PATCH] mm/ksm: introduce ksm_enabled for each processg

On Wed, May 18, 2022 at 04:58:27PM +1000, Balbir Singh wrote:
> On Tue, May 17, 2022 at 09:27:01AM +0000, cgel.zte@...il.com wrote:
> > From: xu xin <xu.xin16@....com.cn>
> > 
> > For now, if we want to use KSM to merge pages of some apps, we have to
> > explicitly call madvise() in application code, which means installed
> > apps on OS needs to be uninstall and source code needs to be modified.
> > It is very inconvenient because sometimes users or app developers are not
> > willing to modify their app source codes for any reasons.
> >
> 
> I thought we got process_madvise in 5.13, doesn't that help solve the
> problem with extensions to advice and an appropriate wrapper? Granted
> it might be a little racy with a running process potentially
> participating in KSM already. 

The reasons why I don't use process_madvise to achieve this include:

1. see https://lore.kernel.org/lkml/1835064.A2aMcgg3dW@natalenko.name/

2. process_madvise is still a kind of madvise. processs_madvise from
another process overrides the intention of origin app code ifself that
also calls madvise, which is unrecoverable. For example, if a process "A"
which madvises just one part of VMAs (not all) as MERGEABLE run on the OS
already, meanwhile, if another process which doesn't know the information
of "A" 's MERGEABLE areas, then call process_madvise to advise all VMAs of
"A" as MERGEABLE, the original MERGEABLE information of "A" calling madivse
is erasured permanently.

> If we are concerned about KSM, I would assume that we care about long running processes, is that true?
> 

Yes, it is.

> Balbir Singh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ