Re: [PATCH v1 0/9] mm/memory: optimize unmap/zap with PTE-mapped THP

David Hildenbrand
2024-01-31T14:20:11Z

On 31.01.24 15:08, Michal Hocko wrote:
> On Wed 31-01-24 10:26:13, Ryan Roberts wrote:
>> IIRC there is an option to zero memory when it is freed back to the buddy? So
>> that could be a place where time is proportional to size rather than
>> proportional to folio count? But I think that option is intended for debug only?
>> So perhaps not a problem in practice?
>
> init_on_free is considered a security/hardening feature more than a
> debugging one. It will surely add an overhead and I guess this is
> something people who use it know about. The batch size limit is a latency
> reduction feature for !PREEMPT kernels but by no means it should be
> considered low latency guarantee feature. A lot of has changed since
> the limit was introduced and the current latency numbers will surely be
> different than back then. As long as soft lockups do not trigger again
> this should be acceptable IMHO.

It could now be zeroing out ~512 MiB. That shouldn't take double-digit
seconds unless we are running in a very problematic environment
(over-committed VM). But then, we might have different problems already.

I'll do some sanity checks with an extremely large processes (as much as
I can fit on my machines), with a !CONFIG_PREEMPT kernel and
init_on_free, to see if anything pops up.

Thanks Michal!

--
Cheers,

David / dhildenb