From patchwork Thu Feb 15 14:46:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13558531 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 0A5F3C48BF0 for ; Thu, 15 Feb 2024 14:46:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AEE48D0001; Thu, 15 Feb 2024 09:46:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 610968D0017; Thu, 15 Feb 2024 09:46:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AFAE8D0001; Thu, 15 Feb 2024 09:46:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 22C888D0014 for ; Thu, 15 Feb 2024 09:46:42 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BF851A28F7 for ; Thu, 15 Feb 2024 14:46:41 +0000 (UTC) X-FDA: 81794314602.21.0C9C81F Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf01.hostedemail.com (Postfix) with ESMTP id 5086C40009 for ; Thu, 15 Feb 2024 14:46:40 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=MNMKriyf; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf01.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708008400; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sXyQnh4V6vljCr0eBKJhzrPs1ta3SCTR3hmityCHwGw=; b=h41tGWwTzDAGeKqN07bQdXD4AkykC5RUXp8mH2qJ4uFWGzOabjOJV6ZeYxXeGGkSFxidWW dPbqNei1ovJwkRrbz72trnxA1WpNOFHQ9uZpJgNUAxV1PgE343CvGavIYpU0YW3Ilvic52 KdjA6nH4Y6wgwELGrOg4evGHyZ4UrtA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=MNMKriyf; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf01.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708008400; a=rsa-sha256; cv=none; b=bN9UZR1vbaYDxVwo6BFDy0C42/r2Amh77kdyVnMIRFJUHeuQmq6CHrRhu7DXKtdG+2tcMq ghzrtDXagW7IXFlCGh+4uN2HnmTmbbX9g9OL9NeFRszTdjFCR1MAUyvF63BL+e39948v0M f4WjrPwaG3cNJ7rPsL8D+Di2uybt3/c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1708008399; bh=f6KZPJbWgKyyz0b6bsXitRwjRbgNq1j+uFNk2EI6GFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNMKriyfcEhRm3Te0E403P2pXoUgE6mM/5Pp6kXzsoZglAnPXNbbPg16ZVmSau0ur reW5SfChm8Z0470OkoRns543xWrIs3en3Il/nnNDyiWEhHDMLbnNNjcxq4LgSOxrhI mXTAeAf44m6ePTpHEwbZ8zApxSVmjU4mK6q5ngf9/4TWEVjKo8Lxm0jXC7BWIceNWZ sAKMnrvZ1jrWUgaJsMpZ7Ju8+Y91gxRxapWNLNNW2Nhr9seT1OfvYZvlM1tdd+VYUB tn+cV4j3qI2QqFdOah9ub9xIKOK1W79zDjPl5rd69ShO+twx+08NeOjS5tHOGjbcEK nuqG3RHuBrRXQ== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TbHvM1tL3zZS4; Thu, 15 Feb 2024 09:46:39 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@lists.linux.dev, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, kernel test robot , Christoph Hellwig Subject: [PATCH v6 1/9] dax: add empty static inline for CONFIG_DAX=n Date: Thu, 15 Feb 2024 09:46:25 -0500 Message-Id: <20240215144633.96437-2-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215144633.96437-1-mathieu.desnoyers@efficios.com> References: <20240215144633.96437-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: swcd8bhrcwgjd91pz9zggou3tz4ygngf X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5086C40009 X-HE-Tag: 1708008400-235356 X-HE-Meta: U2FsdGVkX19B5dPkfdBxKbgWf/PYfRGO9ZRit1/pQYZpZe7Y739afK/5Dkdyc6HUMNXBX6I2N5GZCZ4IFRDIzVDLc3ElHEzftRrxUwIIIOXL44rw7wNguG6Fz5Y+6NM+TIyRgIqVmD8lKgKSuOhkl25ZtGXxHRe6FufqQDDFbcCMgnUH3QLOmXsd9slxWYyNM4VoMOipT5LPBKvT/nErpw8zMgApl5NMNhTEtyAwvUw5BNOnZiYtTY52X2VdpBIYrJvt+xveUAd7z8qPwvMqoVqLw5hbrWqs2I5Vk3queuLyXZOic+wefgSf3NLYIcRtuWHIhTb4J6Sxw2xX4eyssV/MBzKTjzSttEG/GASGcJo+GWxac3kfp6J7Pw1CFK5cDr6PJSe7ivwq4CkO/axNMDcQYHeS3hgkFRg4JjYDReX/5d9yiZCKn5rIU18dYAhQbQ53FJiEimecPTZViaxFv7NJcCYoChtUMU13OER8HQ9F9LPxcg521N8EMR0/UVw3tDymZt5U7evt2ty4dRWT9IzQoel6RjzmFda+L0g6q7zvOshm31RnKQEfXGazWutwTHYnBu1a2vb4ssROKwdXrRJmu7Oz20UnA/aLkFAVQStO60JFw48jjzXv935G5wQMQmDF3GLf/6HxQ3y+Izp9aOoGecFLLIuMmKkemSLWzTQOu7EcxCk3aC9lzAMmyYct6O3f8j8tWWymtvIRykzNaLTZU+FRwISM+P1Q28i2uxf8otX8L7Dsg1BhGzOU0yOBtXz/vxemleHGLUjDt83l7eC2NSKXEC2bDkGj41bJEk8Da9qKDnZ7DpUwQwJJsScfL4etvpXlFHpvROb1rdT0PGhEa4nQX97KL4/NyQ5Hgc8yJ4tl82ErhZbYuSZX5Ea4LkdtEf3J5NmVZ6otSPihpfTJEHE56/drbz70Kg43k/lOM0Wsr9Xf8j2BfmWT8DAM7Sl8dNaA22Ev8MFzDmE b1ipsH4d RhW1xyT03wTjjKKU= 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: When building a kernel with CONFIG_DAX=n, all uses of set_dax_nocache() and set_dax_nomc() need to be either within regions of code or compile units which are explicitly not compiled, or they need to rely on compiler optimizations to eliminate calls to those undefined symbols. It appears that at least the openrisc and loongarch architectures don't end up eliminating those undefined symbols even if they are provably within code which is eliminated due to conditional branches depending on constants. Implement empty static inline functions for set_dax_nocache() and set_dax_nomc() in CONFIG_DAX=n to ensure those undefined references are removed. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402140037.wGfA1kqX-lkp@intel.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402131351.a0FZOgEG-lkp@intel.com/ Fixes: 7ac5360cd4d0 ("dax: remove the copy_from_iter and copy_to_iter methods") Signed-off-by: Mathieu Desnoyers Cc: Christoph Hellwig Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-arch@vger.kernel.org Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-xfs@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvdimm@lists.linux.dev --- include/linux/dax.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/dax.h b/include/linux/dax.h index b463502b16e1..e3ffe7c7f01d 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -63,6 +63,8 @@ void kill_dax(struct dax_device *dax_dev); void dax_write_cache(struct dax_device *dax_dev, bool wc); bool dax_write_cache_enabled(struct dax_device *dax_dev); bool dax_synchronous(struct dax_device *dax_dev); +void set_dax_nocache(struct dax_device *dax_dev); +void set_dax_nomc(struct dax_device *dax_dev); void set_dax_synchronous(struct dax_device *dax_dev); size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i); @@ -109,6 +111,12 @@ static inline bool dax_synchronous(struct dax_device *dax_dev) { return true; } +static inline void set_dax_nocache(struct dax_device *dax_dev) +{ +} +static inline void set_dax_nomc(struct dax_device *dax_dev) +{ +} static inline void set_dax_synchronous(struct dax_device *dax_dev) { } @@ -124,9 +132,6 @@ static inline size_t dax_recovery_write(struct dax_device *dax_dev, } #endif -void set_dax_nocache(struct dax_device *dax_dev); -void set_dax_nomc(struct dax_device *dax_dev); - struct writeback_control; #if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX) int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);