linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yosry Ahmed <yosryahmed@google.com>
To: Barry Song <21cnbao@gmail.com>
Cc: David Hildenbrand <david@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Nhat Pham <nphamcs@gmail.com>,
	 Chengming Zhou <chengming.zhou@linux.dev>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	 Chris Li <chrisl@kernel.org>,
	Ryan Roberts <ryan.roberts@arm.com>,
	 Matthew Wilcox <willy@infradead.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: zswap: add VM_BUG_ON() if large folio swapin is attempted
Date: Fri, 7 Jun 2024 16:17:11 -0700	[thread overview]
Message-ID: <CAJD7tkZkChE_bGJCnf3u0493PZOe1=+Y8S_nq2=j1uP-BtZ9Mg@mail.gmail.com> (raw)
In-Reply-To: <CAGsJ_4ywmVbO+nrbcxz9YMdzi_y5qSUG3Cg=3oz3kNpQ6gg6iA@mail.gmail.com>

[..]
> > One problem is that even if zswap was never enabled, the warning will
> > be emitted just if CONFIG_ZSWAP is on. Perhaps we need a variable or
> > static key if zswap was "ever" enabled.
> >
> > Barry, I suspect your is_zswap_enabled() check is deficient for
> > similar reasons, zswap could have been enabled before then became
> > disabled.
>
> I don't understand this. if zswap was enabled before but is disabled when
> I am loading data, will I get corrupted data before zswap was once enabled?
> If not, it seems nothing important.

If zswap was enabled and then disabled, some pages may still be in
zswap. We do not load the pages from zswap when it is disabled, we
just stop storing new pages.

So if you just rely in checking whether zswap is enabled at swapin
time to decide whether to use large folios, you may end up with a
situation where zswap is disabled, yet parts of the large folio you
are trying to swapin (or all of it) is in zswap.

This is why I think we'll need to track whether zswap was ever enabled
instead (or if a page was ever stored).

>
> Thanks
> Barry


  reply	other threads:[~2024-06-07 23:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 18:48 Yosry Ahmed
     [not found] ` <84d78362-e75c-40c8-b6c2-56d5d5292aa7@redhat.com>
2024-06-06 20:31   ` Yosry Ahmed
2024-06-06 20:54     ` Barry Song
2024-06-06 21:00       ` Yosry Ahmed
     [not found]     ` <7507d075-9f4d-4a9b-836c-1fbb2fbd2257@redhat.com>
2024-06-06 21:30       ` Barry Song
2024-06-06 21:37         ` Yosry Ahmed
2024-06-06 21:53           ` Barry Song
2024-06-07  7:11             ` David Hildenbrand
2024-06-07 17:43               ` Yosry Ahmed
2024-06-07 18:52                 ` David Hildenbrand
2024-06-07 18:58                   ` Yosry Ahmed
2024-06-07 19:03                     ` David Hildenbrand
2024-06-07 21:13                     ` Chris Li
2024-06-07 23:14                       ` Yosry Ahmed
2024-06-07 22:09                     ` Barry Song
2024-06-08  0:28                       ` Yosry Ahmed
2024-06-07 21:20                 ` Barry Song
2024-06-07 23:17                   ` Yosry Ahmed [this message]
2024-06-07 22:28                     ` Barry Song
2024-06-08  0:32                       ` Yosry Ahmed
2024-06-06 21:36       ` Yosry Ahmed

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='CAJD7tkZkChE_bGJCnf3u0493PZOe1=+Y8S_nq2=j1uP-BtZ9Mg@mail.gmail.com' \
    --to=yosryahmed@google.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chengming.zhou@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=willy@infradead.org \
    /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