Re: [PATCH] mm/ksm: introduce ksm_enabled for each process

From: Balbir Singh
Date: Wed May 18 2022 - 02:58:43 EST


On Tue, May 17, 2022 at 09:27:01AM +0000, cgel.zte@xxxxxxxxx wrote:
> From: xu xin <xu.xin16@xxxxxxxxxx>
>
> 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. If we are concerned about KSM, I would
assume that we care about long running processes, is that true?

Balbir Singh