On Thu, 6 Apr 2023 09:53:37 -0700 Stefan Roesch <shr@xxxxxxxxxxxx> wrote: > So far KSM can only be enabled by calling madvise for memory regions. To > be able to use KSM for more workloads, KSM needs to have the ability to be > enabled / disabled at the process / cgroup level. > > ... > > @@ -53,6 +62,18 @@ void folio_migrate_ksm(struct folio *newfolio, struct folio *folio); > > #else /* !CONFIG_KSM */ > > +static inline int ksm_add_mm(struct mm_struct *mm) > +{ > +} The compiler doesn't like the lack of a return value. I queued up a patch to simply delete the above function - seems that ksm_add_mm() has no callers if CONFIG_KSM=n. The same might be true of the ksm_add_vma()...ksm_exit() stubs also, Perhaps some kind soul could take a look at whether we can simply clean those out.