From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Christian Koenig <christian.koenig@amd.com>,
Huang Rui <ray.huang@amd.com>,
Matthew Auld <matthew.auld@intel.com>,
Matthew Brost <matthew.brost@intel.com>,
dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Subject: Re: [PATCH v2] drm/ttm: Fix compile error when CONFIG_SHMEM is not set
Date: Wed, 04 Jun 2025 14:51:49 +0200 [thread overview]
Message-ID: <6b3a37712330ec4b17968075f71296717db54046.camel@linux.intel.com> (raw)
In-Reply-To: <20250604085121.324be8c1@gandalf.local.home>
On Wed, 2025-06-04 at 08:51 -0400, Steven Rostedt 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':
> (.text+0x10363bc): undefined reference to `shmem_writeout'
> make[3]: ***
> [/work/build/trace/nobackup/linux.git/scripts/Makefile.vmlinux:91:
> vmlinux.unstripped] Error 1
> make[2]: *** [/work/build/trace/nobackup/linux.git/Makefile:1241:
> vmlinux] Error 2
> make[1]: *** [/work/build/trace/nobackup/linux.git/Makefile:248:
> __sub-make] Error 2
> make[1]: Leaving directory '/work/build/nobackup/tracetest'
> make: *** [Makefile:248: __sub-make] Error 2
>
> This is due to the replacement of writepage and calling
> swap_writeout()
> and shmem_writeout() directly. The issue is that when CONFIG_SHMEM is
> not
> defined, shmem_writeout() is also not defined.
>
> The function ttm_backup_backup_page() called mapping->a_ops-
> >writepage()
> which was then changed to call shmem_writeout() directly.
>
> Even before commit 84798514db50 ("mm: Remove swap_writepage() and
> shmem_writepage()"), it didn't make sense to call anything other than
> shmem_writeout() as the ttm_backup deals only with shmem folios.
>
> Have DRM_TTM config option select SHMEM to guarantee that
> shmem_writeout()
> is available.
>
> Link:
> https://lore.kernel.org/all/20250602170500.48713a2b@gandalf.local.home/
>
> Suggested-by: Hugh Dickins <hughd@google.com>
> Fixes: 84798514db50 ("mm: Remove swap_writepage() and
> shmem_writepage()")
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> Changes since v1:
> https://lore.kernel.org/all/20250602170500.48713a2b@gandalf.local.home/
>
> - Instead of adding a shmem_writeout() stub, just make CONFIG_DRM_TTM
> select CONFIG_SHMEM (Hugh Dickins)
>
> drivers/gpu/drm/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index f094797f3b2b..ded28c71d89c 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -188,6 +188,7 @@ source "drivers/gpu/drm/display/Kconfig"
> config DRM_TTM
> tristate
> depends on DRM && MMU
> + select SHMEM
> help
> GPU memory management subsystem for devices with multiple
> GPU memory types. Will be enabled automatically if a
> device driver
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Thanks,
Thomas
next prev parent reply other threads:[~2025-06-04 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 12:51 Steven Rostedt
2025-06-04 12:51 ` Thomas Hellström [this message]
2025-06-04 16:26 ` Hugh Dickins
2025-06-04 16:38 ` Steven Rostedt
2025-06-04 16:43 ` 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=6b3a37712330ec4b17968075f71296717db54046.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=ray.huang@amd.com \
--cc=rostedt@goodmis.org \
--cc=simona@ffwll.ch \
--cc=torvalds@linux-foundation.org \
--cc=tzimmermann@suse.de \
--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