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 3E075C43334 for ; Thu, 9 Jun 2022 05:02:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60F776B0073; Thu, 9 Jun 2022 01:02:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BEA06B0074; Thu, 9 Jun 2022 01:02:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 486BD6B0075; Thu, 9 Jun 2022 01:02:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 320A26B0073 for ; Thu, 9 Jun 2022 01:02:34 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0426835065 for ; Thu, 9 Jun 2022 05:02:33 +0000 (UTC) X-FDA: 79557501828.31.66C7B02 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf31.hostedemail.com (Postfix) with ESMTP id D234520079 for ; Thu, 9 Jun 2022 05:02:32 +0000 (UTC) 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: 8bit 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654750953; a=rsa-sha256; cv=none; b=M2uV3PuSsrbSH6IuK4iGDWnVSX4Aj8wEkTUYGmTxF58PfLtVptM782Tgf2r7DTmAr8Q/Wt gpkhzcum7uK/yv95+EaFgxdcELhpjYUtQPQWuCWYgAfdOMBPe5LcRpMVDqIPTffvQpiyi2 kcH22FfutXbicM1JieTqoXXvwU9DZvs= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=none; spf=pass (imf31.hostedemail.com: domain of guanjing6@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=guanjing6@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654750953; 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: references; bh=KIwRai8uSEp8c2pQ1no9QR3+sFnR8yWJc0+w/zQlTbI=; b=oZFLB2NXrt5m0wP7iT7SDB2CF101dPdPfMbRTNZmCcwDEamgAD/Yzpr8D1Y7Wo/JdWGKlD 5gcKAAcXkPtGYcNMQoj7qxmyddQPwxmumk6ufZs/zgmByt7hiTgWbCVOqfgANEfL6D64JE cLzuBvgJVdqbygi3PdZoMYD6bSTG+00= X-Rspamd-Queue-Id: D234520079 Authentication-Results: imf31.hostedemail.com; dkim=none; spf=pass (imf31.hostedemail.com: domain of guanjing6@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=guanjing6@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: 6g6nodntekx3zw6h8aqf3p5f99muy55u X-HE-Tag: 1654750952-889488 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: If CONFIG_HUGETLB_PAGE is not set and CONFIG_FS_DAX=y. Use command "make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-" to build, will fail: mm/memory-failure.c:568:13: error: ‘collect_procs_fsdax’ defined but not used [-Werror=unused-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, struct list_head *to_kill, i_mmap_unlock_read(mapping); } -#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 = task_early_kill(tsk, true); - - if (!t) - continue; - vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { - if (vma->vm_mm == 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) } #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 = task_early_kill(tsk, true); + + if (!t) + continue; + vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff, pgoff) { + if (vma->vm_mm == 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. * -- 2.17.1