mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@amd.com>
To: Usama Arif <usamaarif642@gmail.com>, akpm@linux-foundation.org
Cc: yuzhao@google.com, david@redhat.com, leitao@debian.org,
	huangzhaoyang@gmail.com, willy@infradead.org, vbabka@suse.cz,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH RESEND] mm: drop lruvec->lru_lock if contended when skipping folio
Date: Tue, 20 Aug 2024 10:08:39 +0530	[thread overview]
Message-ID: <16573630-4cd5-4539-8f02-85cbbeb3866d@amd.com> (raw)
In-Reply-To: <20240819184648.2175883-1-usamaarif642@gmail.com>

On 20-Aug-24 12:16 AM, Usama Arif wrote:
> lruvec->lru_lock is highly contended and is held when calling
> isolate_lru_folios. If the lru has a large number of CMA folios
> consecutively, while the allocation type requested is not MIGRATE_MOVABLE,
> isolate_lru_folios can hold the lock for a very long time while it
> skips those. vmscan_lru_isolate tracepoint showed that skipped can go
> above 70k in production and lockstat shows that waittime-max is x1000
> higher without this patch.
> This can cause lockups [1] and high memory pressure for extended periods of
> time [2]. Hence release the lock if its contended when skipping a folio to
> give other tasks a chance to acquire it and not stall.
> 
> [1] https://lore.kernel.org/all/CAOUHufbkhMZYz20aM_3rHZ3OcK4m2puji2FGpUpn_-DevGk3Kg@mail.gmail.com/
> [2] https://lore.kernel.org/all/ZrssOrcJIDy8hacI@gmail.com/

Though the above link[2] mentions it, can you explicitly include the 
specific condition that we saw in the patch description?

"isolate_lru_folios() can end up scanning through a huge number of 
folios with lruvec spinlock held. For FIO workload, ~150million order=0 
folios were skipped to isolate a few ZONE_DMA folios."

Regards,
Bharata.

      parent reply	other threads:[~2024-08-20  4:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 18:46 Usama Arif
2024-08-20  1:17 ` Andrew Morton
2024-08-20 15:45   ` Usama Arif
2024-08-20 17:13     ` Breno Leitao
2024-08-21  0:51     ` Zhaoyang Huang
2024-08-21 18:33       ` Usama Arif
2024-08-20  4:38 ` Bharata B Rao [this message]

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=16573630-4cd5-4539-8f02-85cbbeb3866d@amd.com \
    --to=bharata@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=huangzhaoyang@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=usamaarif642@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=yuzhao@google.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®