mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "刘海龙(LaoLiu)" <liuhailong@oppo.com>
To: Barry Song <21cnbao@gmail.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"nathan@kernel.org" <nathan@kernel.org>,
	"ndesaulniers@google.com" <ndesaulniers@google.com>,
	"trix@redhat.com" <trix@redhat.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"llvm@lists.linux.dev" <llvm@lists.linux.dev>,
	"surenb@google.com" <surenb@google.com>,
	"zhaoyang.huang@unisoc.com" <zhaoyang.huang@unisoc.com>,
	"quic_charante@quicinc.com" <quic_charante@quicinc.com>,
	"yuzhao@google.com" <yuzhao@google.com>
Subject: Re: [PATCH v2] Revert "mm: skip CMA pages when they are not available"
Date: Fri, 15 Mar 2024 10:43:59 +0000	[thread overview]
Message-ID: <ba894762-d3ea-4773-b54c-ce063e1065e5@oppo.com> (raw)
In-Reply-To: <CAGsJ_4yMXE_4YuMTczF6u4YYp_TWksi+byszD09E2PT5pK8zfA@mail.gmail.com>

On 2024/3/15 16:46, Barry Song wrote:
> On Fri, Mar 15, 2024 at 9:18 PM <liuhailong@oppo.com> wrote:
>>
>> From: "Hailong.Liu" <liuhailong@oppo.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.



  reply	other threads:[~2024-03-15 10:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 14:15 [PATCH] " liuhailong
2024-03-14 17:47 ` Yu Zhao
2024-03-15  7:41   ` reply: " 黄朝阳 (Zhaoyang Huang)
2024-03-15 10:36     ` 刘海龙(LaoLiu)
2024-03-15  8:18 ` [PATCH v2] " liuhailong
2024-03-15  8:46   ` Barry Song
2024-03-15 10:43     ` 刘海龙(LaoLiu) [this message]
2024-03-17  5:47       ` Barry Song
2024-03-19  8:55   ` Michal Hocko
2024-03-19 11:09     ` Barry Song
2024-03-19 12:27       ` 刘海龙(LaoLiu)
2024-03-22  1:25         ` Barry Song
2024-03-19 13:40       ` Michal Hocko
2024-03-22  1:28         ` Barry Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba894762-d3ea-4773-b54c-ce063e1065e5@oppo.com \
    --to=liuhailong@oppo.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=quic_charante@quicinc.com \
    --cc=surenb@google.com \
    --cc=trix@redhat.com \
    --cc=yuzhao@google.com \
    --cc=zhaoyang.huang@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®