From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03DB1C5AE59 for ; Tue, 3 Jun 2025 17:26:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96CDB6B04CC; Tue, 3 Jun 2025 13:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9445D6B04CE; Tue, 3 Jun 2025 13:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8816B6B04CF; Tue, 3 Jun 2025 13:26:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6A6436B04CC for ; Tue, 3 Jun 2025 13:26:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DEEE3BEAA8 for ; Tue, 3 Jun 2025 17:26:26 +0000 (UTC) X-FDA: 83514768372.25.2C46379 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 27B121C0005 for ; Tue, 3 Jun 2025 17:26:24 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of "SRS0=mph5=YS=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=mph5=YS=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1748971585; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RcFXICdQZMVcnlER5bx2CFLESX02h1zeO7ETZ0U9+GA=; b=ffogyYUkpzPJSW6r2hr1g8V5523s1Tz+QEXfn21uKBmzRr4gcNOCrIWeVeg29L1T9ZZEoE FCITUi4XTgkVzmWssMTbX7EHEheWtaHnSiHGa5J4GT8OjDlSLbWqR/nPNBDHxEAFry5dsL o8BHAvv/tBlcvpNP+Owu2LwQcr2EQKE= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf21.hostedemail.com: domain of "SRS0=mph5=YS=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=mph5=YS=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748971585; a=rsa-sha256; cv=none; b=SZ6nuEs7zu/o0+ktHYPpUV1RZclJxyehbhYVePsPdtSc+twCdxKEY7D8l31bJ5bzd8sKUw jiX0+NNPa4WaAbYLpl/Rjx66cT7SSthOSuyCJi0wj3N+F0MqjcFd29eEgtjVu/PRVb1hlJ VHjMBRjn4OnuRwhmYvE/T8U7tqKAlzU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2E0E45C4B81; Tue, 3 Jun 2025 17:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5343C4CEEE; Tue, 3 Jun 2025 17:26:21 +0000 (UTC) Date: Tue, 3 Jun 2025 13:27:36 -0400 From: Steven Rostedt To: Matthew Wilcox Cc: Hugh Dickins , LKML , linux-mm@kvack.org, Andrew Morton , Linus Torvalds , Christian Koenig , Huang Rui , Matthew Auld , Matthew Brost , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Subject: Re: [PATCH] mm: Fix compile error when CONFIG_SHMEM is not set Message-ID: <20250603132736.554f611d@gandalf.local.home> In-Reply-To: References: <20250602170500.48713a2b@gandalf.local.home> <20250602171458.7ceabb1c@gandalf.local.home> <20250603102959.20c85adb@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 27B121C0005 X-Stat-Signature: 4dbhma7fxh1xrr5e7qmrftmf7o7no3f8 X-Rspam-User: X-HE-Tag: 1748971584-770377 X-HE-Meta: U2FsdGVkX1/Wd68uDaXgV+myDHBCk8VMy4w1nk84mkD2F7yLwqQvkdoEuv8dHbwJFIp8G78nWC+F7NeqHfrRQ4yt7E4hUyeo7VodEhnzGRl1Xm+IJFDK2jb99UUjyX9Ww3iW5MHICuskeEYTwJUqSLgAoGrliJYOJKKbq+8Qt1FbR7Cpx13s5BzzAOLV/7iln8bY+BtWiHRxNRTy4BQYmBXOzPbwBiUaNk4gj1+iKG8y+gHm86the9S98hZh8AC5bWdvuNtWyo/kwGhgM7HxCCNzmRiL2DtZTJ2lxJs2MF5g0sG/Erb5z3bGUlZxj24dSQiFJ70Yxzqg8SZFvtOp2PCO3TpHaoR3X8XFQwhHEUUuUfSVoyhEtlQNkGyqHgJrHo+l4UsbObl4WcpEU69/bhM6CUnl2LBbb3nVfF0qLkABf1cUsO2OI3YbKiBCpD0PoqTqaO1WNfHA2wKgPvHUJDkQf78yKJ2kp0JTrMIbGy+dTD9roagWg+Wz+U/xGsd8ePnwhNAih65ULQNqgxYYfLUwXJWtMCJ4/oqMWH6DBzQ+tN9CSJmhpyp3xfP5xFaTQmc0P89VvjebkojoZ23pxoJrMnouUOqUObA83dU6424okzw/dEaYHnkWPM3aqBv5cXdqY3d6euEIT+lQ4pvRG/oNeHnbfwM7DmbApoKWOxCSLVqNJ2dOvXF0f5N5L2COufAKmSKuTqsb79epygGDFkn+Y09K/IVV2V7X7S1Mdp/pfBXDUPfQ8TVCE7NKTUcaySL4xEdiX7F1BT4bQq0SR+2UBfkxeo81AnKB8Jn+5L4fk4LjZSXOkzgCCU36OsVIS6Y5lfg2dgqIntpnW3nXntJxhGoYzLlCfR3NTb1g1w7Gy8NKKY9Iw420ZtHgkGrao2XYSwL/Kn1RTSRuISfPI51Q1ULNiwjF4OruGArBZE2p8YY51kYObMvjvaWrR303JQsgAYj1YHvype/su4X F6kdigIs almENE3Jt9ecZg2kDlJmMLoYJaZy92X2EECbvW0p1wAPF2RKQBMYGh9UXC45RfP1DcA9pnIf6g1JVllV6y0CCz+iJ+syv2ubiqhPgsHwZKhSdR4wVif7LGS2nCVPLkLOQCYDE3VlOo2MgD8Ve2l4i4dv6QMNLwVUJBGXcVCf2vP3295SvscgXz0Jgj7jTujMtZ/SojRXqcz+DX5L3ncSdedpU7KnzyBb44FrPKoqEDiyUIm6kYkGJBJunoUkuCq7TyPyFmKUgbS5/O7zOjmiS9QWaLC4+tHYpZ1rEupKnPytVJ/9WdXucdPP0+ujp2MgPZvbeDGymOW5oy2SbkHsH/D9W2Jhtnh793orU/I+xbRIRYeoxk/0pB4i+1bJLasmjtbbr X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: [ Adding DRM folks ] On Tue, 3 Jun 2025 17:26:23 +0100 Matthew Wilcox wrote: > On Tue, Jun 03, 2025 at 10:29:59AM -0400, Steven Rostedt wrote: > > On Tue, 3 Jun 2025 01:02:36 -0700 (PDT) > > Hugh Dickins wrote: > > > > > Agreed that ramfs does not use swap, so calling swap_writepage() would > > > be weird. But, thanks for the build fix Steve, but it cannot be right > > > because return 0 says shmem_writeout() successfully sent the page to > > > swap, and that has unlocked the page (or soon will do so). It should > > > return an error (-ENXIO?), but I haven't checked what the callers do with > > > > Yeah, I figured it should return an error, but looking at the code I > > couldn't figure out what the proper error would be. Then I also noticed > > that the other stub functions just returned zero so I did the same. > > > > Perhaps add a WARN_ON_ONCE() if it is called without CONFIG_SHMEM configured? > > Or just make this module depend on SHMEM? I don't think it makes much > sense to use it without being able to swap, and shmem can't swap ... Heh, not exactly sure what to make depend on CONFIG_SHMEM. The function is: ttm_backup_backup_page() Which is defined when CONFIG_DRM_TTM is set, but just doing: diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index f094797f3b2b..ebb948a0142f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -187,7 +187,7 @@ source "drivers/gpu/drm/display/Kconfig" config DRM_TTM tristate - depends on DRM && MMU + depends on DRM && MMU && SHMEM help GPU memory management subsystem for devices with multiple GPU memory types. Will be enabled automatically if a device driver Isn't good enough because "select" can override depends on :-p and DRM_TTM gets selected by: Symbol: DRM_TTM [=y] Type : tristate Defined at drivers/gpu/drm/Kconfig:188 Depends on: HAS_IOMEM [=y] && DRM [=y] && MMU [=y] && SHMEM [=n] Selected by [y]: - DRM_TTM_HELPER [=y] && HAS_IOMEM [=y] && DRM [=y] - DRM_RADEON [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (AGP [=n] || !AGP [=n]) - DRM_VMWGFX [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (X86 [=y] && HYPERVISOR_GUEST [=y] || ARM64) Selected by [n]: - DRM_TTM_KUNIT_TEST [=n] && HAS_IOMEM [=y] && DRM [=y] && KUNIT [=n] && MMU [=y] && (UML || COMPILE_TEST [=n]) - DRM_AMDGPU [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && !UML - DRM_NOUVEAU [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] - DRM_I915 [=n] && HAS_IOMEM [=y] && DRM [=y] && X86 [=y] && PCI [=y] && !PREEMPT_RT [=n] - DRM_XE [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=n] || KUNIT [=n]=y [=y] - DRM_QXL [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && HAS_IOPORT [=y] - DRM_LOONGSON [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (LOONGARCH || MIPS || COMPILE_TEST [=n]) - DRM_HISI_HIBMC [=n] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] - DRM_VBOXVIDEO [=n] && HAS_IOMEM [=y] && DRM [=y] && X86 [=y] && PCI [=y] Should DRM itself depend on SHMEM? -- Steve