From nobody Mon Apr 27 23:54:49 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81DC5C433EF for ; Thu, 9 Jun 2022 05:02:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237707AbiFIFCe (ORCPT ); Thu, 9 Jun 2022 01:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiFIFCd (ORCPT ); Thu, 9 Jun 2022 01:02:33 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B8B21911F for ; Wed, 8 Jun 2022 22:02:31 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LJX3X0KhszgYbh; Thu, 9 Jun 2022 13:00:40 +0800 (CST) Received: from kwepemm600012.china.huawei.com (7.193.23.74) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 9 Jun 2022 13:02:30 +0800 Received: from ubuntu1804.huawei.com (10.67.175.29) by kwepemm600012.china.huawei.com (7.193.23.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 9 Jun 2022 13:02:29 +0800 From: Guan Jing To: , , CC: , , , , , Guan Jing Subject: [PATCH -next] =?UTF-8?q?mm=EF=BC=9Afix=20build=20error=20of=20def?= =?UTF-8?q?ined=20but=20not=20used?= Date: Thu, 9 Jun 2022 13:00:28 +0800 Message-ID: <20220609050028.28645-1-guanjing6@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.175.29] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600012.china.huawei.com (7.193.23.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_HUGETLB_PAGE is not set and CONFIG_FS_DAX=3Dy. Use command "make ARCH=3Darm64 CROSS_COMPILE=3Daarch64-linux-gnu-" to build, will fail: mm/memory-failure.c:568:13: error: =E2=80=98collect_procs_fsdax=E2=80=99 de= fined but not used [-Werror=3Dunused-function] static void collect_procs_fsdax(struct page *page, ^~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [mm/memory-failure.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [mm] Error 2 make: *** Waiting for unfinished jobs.... so extending "#ifdef CONFIG_HUGETLB_PAG" to cover collect_procs_fsdax() would be a simple resolution. Reported-by: Hulk Robot Fixes: 143ac5cd7289 ("mm: introduce mf_dax_kill_procs() for fsdax case") Signed-off-by: Guan Jing --- mm/memory-failure.c | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 545f402c4890..952f117e4584 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -561,34 +561,6 @@ static void collect_procs_file(struct page *page, stru= ct list_head *to_kill, i_mmap_unlock_read(mapping); } =20 -#ifdef CONFIG_FS_DAX -/* - * Collect processes when the error hit a fsdax page. - */ -static void collect_procs_fsdax(struct page *page, - struct address_space *mapping, pgoff_t pgoff, - struct list_head *to_kill) -{ - struct vm_area_struct *vma; - struct task_struct *tsk; - - i_mmap_lock_read(mapping); - read_lock(&tasklist_lock); - for_each_process(tsk) { - struct task_struct *t =3D task_early_kill(tsk, true); - - if (!t) - continue; - vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { - if (vma->vm_mm =3D=3D t->mm) - add_to_kill(t, page, pgoff, vma, to_kill); - } - } - read_unlock(&tasklist_lock); - i_mmap_unlock_read(mapping); -} -#endif /* CONFIG_FS_DAX */ - /* * Collect the processes who have the corrupted page mapped to kill. */ @@ -1540,6 +1512,34 @@ static int try_to_split_thp_page(struct page *page, = const char *msg) } =20 #ifdef CONFIG_HUGETLB_PAGE +#ifdef CONFIG_FS_DAX +/* + * Collect processes when the error hit a fsdax page. + */ +static void collect_procs_fsdax(struct page *page, + struct address_space *mapping, pgoff_t pgoff, + struct list_head *to_kill) +{ + struct vm_area_struct *vma; + struct task_struct *tsk; + + i_mmap_lock_read(mapping); + read_lock(&tasklist_lock); + for_each_process(tsk) { + struct task_struct *t =3D task_early_kill(tsk, true); + + if (!t) + continue; + vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { + if (vma->vm_mm =3D=3D t->mm) + add_to_kill(t, page, pgoff, vma, to_kill); + } + } + read_unlock(&tasklist_lock); + i_mmap_unlock_read(mapping); +} +#endif /* CONFIG_FS_DAX */ + /* * Called from hugetlb code with hugetlb_lock held. * --=20 2.17.1