lkml.org 
[lkml]   [2023]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/6] ksm: support unsharing zero pages placed by KSM
> Why use flags if they both conditions are mutually exclusive?

Just to make the return value of break_ksm_pmd_entry() more expressive and
understandable. because break_ksm_pmd_entry have three types of returned
values (0, 1, 2).

> MADV_UNMERGEABLE -> unmerge_ksm_pages() will never unshare the shared
> zeropage? I thought the patch description mentions that that is one of
> the goals?

No, MADV_UNMERGEABLE will trigger KSM to unshare the shared zeropages in the
context of "get_next_rmap_item() -> unshare_zero_pages(), but not directly in the
context of " madvise()-> unmerge_ksm_pages() ". The reason for this is to avoid
increasing long delays of madvise() calling on unsharing zero pages.

\
 
 \ /
  Last update: 2023-03-27 00:09    [W:0.182 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site