[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+HNL9RoP48tquGd@casper.infradead.org>
Date: Tue, 7 Feb 2023 04:01:51 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: hughd@...gle.com, akpm@...ux-foundation.org, linux-mm@...ck.org,
p.raghav@...sung.com, dave@...olabs.net, a.manzanares@...sung.com,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 2/2] shmem: add support to ignore swap
On Mon, Feb 06, 2023 at 06:52:59PM -0800, Luis Chamberlain wrote:
> @@ -1334,11 +1336,15 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
> struct shmem_inode_info *info;
> struct address_space *mapping = folio->mapping;
> struct inode *inode = mapping->host;
> + struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
> swp_entry_t swap;
> pgoff_t index;
>
> BUG_ON(!folio_test_locked(folio));
>
> + if (wbc->for_reclaim && unlikely(sbinfo->noswap))
> + return AOP_WRITEPAGE_ACTIVATE;
Not sure this is the best way to handle this. We'll still incur the
oevrhead of tracking shmem pages on the LRU, only to fail to write them
out when the VM thinks we should get rid of them. We'd be better off
not putting them on the LRU in the first place.
Powered by blists - more mailing lists