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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba894762-d3ea-4773-b54c-ce063e1065e5@oppo.com>
Date: Fri, 15 Mar 2024 10:43:59 +0000
From: 刘海龙(LaoLiu) <liuhailong@...o.com>
To: Barry Song <21cnbao@...il.com>
CC: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"nathan@...nel.org" <nathan@...nel.org>, "ndesaulniers@...gle.com"
	<ndesaulniers@...gle.com>, "trix@...hat.com" <trix@...hat.com>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "llvm@...ts.linux.dev"
	<llvm@...ts.linux.dev>, "surenb@...gle.com" <surenb@...gle.com>,
	"zhaoyang.huang@...soc.com" <zhaoyang.huang@...soc.com>,
	"quic_charante@...cinc.com" <quic_charante@...cinc.com>, "yuzhao@...gle.com"
	<yuzhao@...gle.com>
Subject: Re: [PATCH v2] Revert "mm: skip CMA pages when they are not
 available"

On 2024/3/15 16:46, Barry Song wrote:
> On Fri, Mar 15, 2024 at 9:18 PM <liuhailong@...o.com> wrote:
>>
>> From: "Hailong.Liu" <liuhailong@...o.com>
>>
>> This reverts
>> commit b7108d66318a ("Multi-gen LRU: skip CMA pages when they are not eligible")
>> commit 5da226dbfce3 ("mm: skip CMA pages when they are not available")
> 
> Reverting these changes seems inappropriate since the original patches
> did improve most cases.
> While doing direct reclamation without MOVABLE flags, scanning cma
> folio doesn't help at all.
> 

Absolutely, but without this patch  it give chance to reclaim cma pages to freelist, 
other tasks without this flag would work normally without holding too much time 
on lru lock and lru size decrease。 it also trigger memory psi event to allow 
admin do something to release memory.

>>
>> skip_cma may cause system not responding. if cma pages is large in lru_list
>> and system is in lowmemory, many tasks would direct reclaim and waste
>> cpu time to isolate_lru_pages and return.
>>
>> Test this patch on android-5.15 8G device
>> reproducer:
>> - cma_declare_contiguous 3G pages
>> - set /proc/sys/vm/swappiness 0 to enable direct_reclaim reclaim file
>>   only.
>> - run a memleak process in userspace
> 
> 
> I assume that scanning cma folio provides additional opportunities to reclaim
> anonymous memory, even though it is ineffective for allocating NON-MOVABLE
> folios. Consequently, we alleviate pressure for future allocations of anonymous
> folios. Moreover, setting swappiness=0 is a rare scenario. Instead of entirely
> removing the mechanism, could we detect such corner cases and handle them
> differently.
> 
> Otherwise, I don't see any chance of this being acknowledged.

It happens in internal aging test. open camera and record 8K video which use 
more than 2Gib dmabuf pages. without this patch the devices would kill camera process,
but the system hang with it.

In fact, in my opinion the issue of this patch increase the scanning lru time 
and reclaim nothing. Do you have a better solution ?

Brs,
Hailong.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ