linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: hughd@google.com, akpm@linux-foundation.org, linux-mm@kvack.org,
	p.raghav@samsung.com, dave@stgolabs.net,
	a.manzanares@samsung.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC 2/2] shmem: add support to ignore swap
Date: Tue, 7 Feb 2023 04:01:51 +0000	[thread overview]
Message-ID: <Y+HNL9RoP48tquGd@casper.infradead.org> (raw)
In-Reply-To: <20230207025259.2522793-3-mcgrof@kernel.org>

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.


  reply	other threads:[~2023-02-07  4:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  2:52 [RFC 0/2] tmpfs: add the option to disable swap Luis Chamberlain
2023-02-07  2:52 ` [RFC 1/2] shmem: set shmem_writepage() variables early Luis Chamberlain
2023-02-07  3:52   ` Matthew Wilcox
2023-02-08 16:08     ` Luis Chamberlain
2023-02-07  2:52 ` [RFC 2/2] shmem: add support to ignore swap Luis Chamberlain
2023-02-07  4:01   ` Matthew Wilcox [this message]
2023-02-08 16:01     ` Luis Chamberlain
2023-02-08 17:45       ` Matthew Wilcox
2023-02-08 20:33         ` Yosry Ahmed
2023-02-23  0:53           ` Luis Chamberlain
2023-02-23  1:04             ` Yosry Ahmed
2023-02-23  1:35               ` Luis Chamberlain

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=Y+HNL9RoP48tquGd@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=a.manzanares@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.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