Re: [PATCH] mm: thp: remove use_zero_page sysfs knob

From: Yang Shi
Date: Fri Jul 20 2018 - 19:49:55 EST




On 7/20/18 2:05 PM, David Rientjes wrote:
On Fri, 20 Jul 2018, Yang Shi wrote:

We disable the huge zero page through this interface, there were issues
related to the huge zero page shrinker (probably best to never free a
per-node huge zero page after allocated) and CVE-2017-1000405 for huge
dirty COW.
Thanks for the information. It looks the CVE has been resolved by commit
a8f97366452ed491d13cf1e44241bc0b5740b1f0 ("mm, thp: Do not make page table
dirty unconditionally in touch_p[mu]d()"), which is in 4.15 already.

For users who run kernels earlier than 4.15 they may choose to mitigate
the CVE by using this tunable. It's not something we permanently need to
have, but it may likely be too early.

Yes, it might be good to keep it around for a while.


What was the shrinker related issue? I'm supposed it has been resolved, right?

The huge zero page can be reclaimed under memory pressure and, if it is,
it is attempted to be allocted again with gfp flags that attempt memory
compaction that can become expensive. If we are constantly under memory
pressure, it gets freed and reallocated millions of times always trying to
compact memory both directly and by kicking kcompactd in the background.

Even though we don't use huge zero page, we may also run into the similar issue under memory pressure. Just save the cost of calling huge zero page shrinker, but actually its cost sound not high.


It likely should also be per node.