From: Matthew Wilcox <willy@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] mm: Fix compile error when CONFIG_SHMEM is not set
Date: Mon, 2 Jun 2025 22:46:08 +0100 [thread overview]
Message-ID: <aD4boBrdZXtz_5kL@casper.infradead.org> (raw)
In-Reply-To: <20250602171458.7ceabb1c@gandalf.local.home>
On Mon, Jun 02, 2025 at 05:14:58PM -0400, Steven Rostedt wrote:
> On Mon, 2 Jun 2025 17:05:00 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > From: Steven Rostedt <rostedt@goodmis.org>
> >
> > When CONFIG_SHMEM is not set, the following compiler error occurs:
> >
> > ld: vmlinux.o: in function `ttm_backup_backup_page':
>
> I'm not sure this is the right fix or not.
> > +int shmem_writeout(struct folio *folio, struct writeback_control *wbc)
> > +{
> > + return 0;
>
> Perhaps this should return:
>
> return swap_writeout(folio, wbc);
I don't think so. ttm_backup_backup_page() gets its page from:
to_folio = shmem_read_folio_gfp(mapping, idx, alloc_gfp);
...
ret = shmem_writeout(to_folio, &wbc);
and if you look at the implementation of shmem_read_folio_gfp() does:
#else
/*
* The tiny !SHMEM case uses ramfs without swap
*/
return mapping_read_folio_gfp(mapping, index, gfp);
#endif
so I would say that if anybody is actually using it this way (and 99%
chance they're not), they literally cannot write back the folio. So
I think your initial patch is fine.
next prev parent reply other threads:[~2025-06-02 21:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-02 21:05 [PATCH] mm: Fix compile error when CONFIG_SHMEM is not set Steven Rostedt
2025-06-02 21:14 ` Steven Rostedt
2025-06-02 21:46 ` Matthew Wilcox [this message]
2025-06-03 8:02 ` Hugh Dickins
2025-06-03 14:29 ` Steven Rostedt
2025-06-03 16:26 ` Matthew Wilcox
2025-06-03 17:27 ` Steven Rostedt
2025-06-03 17:54 ` Linus Torvalds
2025-06-03 18:06 ` Steven Rostedt
2025-06-04 7:03 ` Hugh Dickins
2025-06-04 12:04 ` Steven Rostedt
2025-06-04 12:18 ` Thomas Hellström
2025-06-04 12:23 ` Steven Rostedt
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=aD4boBrdZXtz_5kL@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).