lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86b29391-ad2a-4c4b-b9a8-974d1876632c@redhat.com>
Date: Mon, 17 Jun 2024 19:49:32 +0200
From: David Hildenbrand <david@...hat.com>
To: Qi Zheng <zhengqi.arch@...edance.com>
Cc: hughd@...gle.com, willy@...radead.org, mgorman@...e.de,
 muchun.song@...ux.dev, akpm@...ux-foundation.org, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/3] asynchronously scan and free empty user PTE pages


>>
>> No strong opinion, something synchronous sounds to me like the
>> low-hanging fruit, that could add the infrastructure to be used by
>> something more advanced/synchronously :)
> 
> Got it, I will try to do the following in the next version.
> 
> a. for MADV_DONTNEED case, try synchronous reclaim as you said
> 

I think that really is the low hanging fruit that would cover quite some 
cases already: (1) reclaim when MADV_DONTNEED spans the complete page table.

Then, there is (2) reclaim when MADV_DONTNEED spans only part of the 
page table (e.g., single PTE), but my best guess is that it's better to 
scan for that asynchronously than making possibly each MADV_DONTNEED 
sycall invocation slower.

(1) would already help a lot and showcase how the locking/machinery 
would work.


> b. for MADV_FREE case:
> 
> 	- add a madvise option for synchronous reclaim
> 
> 	- add another madvise option to mark the vma, then add its
>             corresponding mm to a global list, and then traverse
>             the list and reclaim it when the memory is tight and
>             enters the system reclaim path.
>             (maybe there is an option to unmark)
> 
> c. for s390 case you mentioned, create a CONFIG_FREE_PT first, and
>      then s390 will not select this config until the problem is solved.
> 
> d. for lockless scan, try using disabling IRQ or (mmap read lock +
> pte_offset_map_nolock).

Although d) really only is desired when scanning asynchronously I think. 
During (1) above, we know that the table will be very likely empty 
(unless weird race).

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ