public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Hui Zhu <hui.zhu@linux.dev>
Cc: Minchan Kim <minchan@kernel.org>,
	 Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	teawater <zhuhui@kylinos.cn>
Subject: Re: [PATCH] zsmalloc: return -EAGAIN for zspage migration lock contention
Date: Wed, 18 Mar 2026 19:21:48 +0900	[thread overview]
Message-ID: <abp7HJRZQi35wHn-@google.com> (raw)
In-Reply-To: <20260318073114.34858-1-hui.zhu@linux.dev>

On (26/03/18 15:31), Hui Zhu wrote:
> movable_operations::migrate_page() should return -EAGAIN for temporary
> migration failures so the migration core can retry. Other negative
> errors are treated as permanent failures.
> 
> zs_page_migrate() currently returns -EINVAL when zspage_write_trylock()
> fails. That path reflects transient lock contention, not invalid input.
> Returning -EINVAL misclassifies the failure and can reduce migration
> success under contention.

The zspage's reader-lock owner can be preempted for unknown duration,
so I don't know if returning -EAGAIN is safe.  On one hand, migration
attempts are limited by NR_MAX_MIGRATE_PAGES_RETRY, on the other hand,
those attempts are performed basically immediately (?), I'm not sure
if we have good chances for preempted reader-lock owner to get scheduled
and release the lock in time.


  reply	other threads:[~2026-03-18 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18  7:31 [PATCH] zsmalloc: return -EAGAIN for zspage migration lock contention Hui Zhu
2026-03-18 10:21 ` Sergey Senozhatsky [this message]
2026-03-18 10:31   ` Sergey Senozhatsky

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=abp7HJRZQi35wHn-@google.com \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=hui.zhu@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=zhuhui@kylinos.cn \
    /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