On Wed, Jun 1, 2022 at 2:50 AM Michal Hocko <mhocko@xxxxxxxx> wrote: > > On Tue 31-05-22 16:47:49, Yang Shi wrote: > > On Fri, May 27, 2022 at 2:46 AM Michal Hocko <mhocko@xxxxxxxx> wrote: > [...] > > > I really do not see any good reason to tightly couple kernel and user > > > policies. Hints like MADV_{NO}HUGEPAGE are one thing and both kernel > > > and userspace might decide to interpret them. But binding MADV_COLLAPSE > > > to in kernel THP tunables just seems like pushing ourselves into the > > > corner. > > > > I don't mean we should tightly couple kernel and user policies. I > > think it is about how "never" is treated. AFAICT, typically sys admins > > tend to expect "never" as a global switch and they don't expect any > > THP allocation should happen in "never" mode even though it is > > requested by the users. Maybe they should not expect so in the first > > place. > > But this is not how the knob works, right? At least shmem has its own > thing. So we do not have any global kill switch for transparent huge > pages. Yeah, but shmem has "never" mode too, which has the same semantics and it is the default mode actually. Since MADV_COLLAPSE just collapse anon memory for now, so the discussion was focused on anon THP. But shmem is same. And shmem even has "deny" mode which has stronger semantics. > > -- > Michal Hocko > SUSE Labs