linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nhat Pham <nphamcs@gmail.com>
To: Kairui Song <ryncsn@gmail.com>
Cc: Zhaoyu Liu <liuzhaoyu.zackary@bytedance.com>,
	akpm@linux-foundation.org,  ying.huang@intel.com,
	songmuchun@bytedance.com, david@redhat.com,  willy@infradead.org,
	chrisl@kernel.org, yosryahmed@google.com,
	 guo.ziliang@zte.com.cn, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: swap: prejudgement swap_has_cache to avoid page allocation
Date: Mon, 1 Apr 2024 08:20:40 -0700	[thread overview]
Message-ID: <CAKEwX=O8_arvHJy7ZUZP+j4zY8Yj=Z4iGEgDh4B-GG0cnHphLw@mail.gmail.com> (raw)
In-Reply-To: <CAMgjq7C-4H5zcbs_-mvSNBBWiGhx__0_sTTG32Nfsz7TnP=i5Q@mail.gmail.com>

On Mon, Apr 1, 2024 at 8:15 AM Kairui Song <ryncsn@gmail.com> wrote:
> eg. If swap_has_cache returns true, then swap cache is freed, and
> skip_if_exists is set to true, __read_swap_cache_async will return
> NULL for an entry that it should be able to alloc and cache, could
> this be a problem (for example, causing zswap writeback to fail with
> ENOMEM due to readahead)?

Yeah the scenario you describe sounds plausible to me. This will make
zswap writeback less efficient - it seems more pages will be
(unnecessarily) skipped because of this check.


  reply	other threads:[~2024-04-01 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 14:09 Zhaoyu Liu
2024-04-01 15:15 ` Kairui Song
2024-04-01 15:20   ` Nhat Pham [this message]
2024-04-02  8:50   ` Zhaoyu Liu

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='CAKEwX=O8_arvHJy7ZUZP+j4zY8Yj=Z4iGEgDh4B-GG0cnHphLw@mail.gmail.com' \
    --to=nphamcs@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=guo.ziliang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuzhaoyu.zackary@bytedance.com \
    --cc=ryncsn@gmail.com \
    --cc=songmuchun@bytedance.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=yosryahmed@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