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 34D38C433EF for ; Thu, 9 Jun 2022 07:39:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D7736B007D; Thu, 9 Jun 2022 03:39:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 584E66B007E; Thu, 9 Jun 2022 03:39:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4744A6B0080; Thu, 9 Jun 2022 03:39:06 -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 3780C6B007D for ; Thu, 9 Jun 2022 03:39:06 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0158E20664 for ; Thu, 9 Jun 2022 07:39:05 +0000 (UTC) X-FDA: 79557896292.09.196199E Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf13.hostedemail.com (Postfix) with ESMTP id C3BCF2006B for ; Thu, 9 Jun 2022 07:39:04 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LJbX51KV6z1K9GW; Thu, 9 Jun 2022 15:37:09 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) 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 15:38:58 +0800 Subject: =?UTF-8?Q?Re=3a_=5bPATCH_-next=5d_mm=ef=bc=9afix_build_error_of_def?= =?UTF-8?Q?ined_but_not_used?= To: Guan Jing CC: "akpm@linux-foundation.org" , "djwong@kernel.org" , "dan.j.williams@intel.com" , "ruansy.fnst@fujitsu.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= References: <20220609050028.28645-1-guanjing6@huawei.com> <20220609052420.GA1452839@hori.linux.bs1.fc.nec.co.jp> From: Miaohe Lin Message-ID: <5ae24232-91c0-99f5-48cc-beea1a16e426@huawei.com> Date: Thu, 9 Jun 2022 15:38:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220609052420.GA1452839@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654760345; a=rsa-sha256; cv=none; b=y2ZTrkkU0YUR4gOc5imDg1qEDV0USR+/Y1UtzJhKsRSRVha1sGOjpJtOuv0OJV6PNZa3z5 ts8zXjgmVnO98YJ51+4kYSNVX2mcLSHnitOK1CWuywToZK36jcsH8eObSk1RpE25JLvBL7 NUhmljSzIX0i4ZVj3CQ40sMS0imytOE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@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=1654760345; 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=MuHWIKSF5MiomMTIjTgygDa8jpNujHNZ61WGXGHhOT0=; b=yllLVlVNiDCTag29D5XD39eNmB2esIuHCA2bwbgS9JnvAN01Le5UmgdJRnwJMFCYVHzM6F 8cDwyAboEgQhDy5mNUAG3sOx4ovRVOWJH8QrGO+LVqxNjGvj8U5WOSujNqddzJC6not3rH GWwpX6YkZNF8Lm5q1JSIp8LMrBARAQU= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: C3BCF2006B X-Stat-Signature: q47o8aoa9qnh1s6yjrmsi96u3dbz46da X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1654760344-916420 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: On 2022/6/9 13:24, HORIGUCHI NAOYA(堀口 直也) wrote: > On Thu, Jun 09, 2022 at 01:00:28PM +0800, Guan Jing wrote: >> 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. > > Thank you for reporting. I think that collect_procs_fsdax() seems to not > depend on hugetlb, so probably mf_dax_kill_procs() should be defined outside > "#ifdef CONFIG_HUGETLB_PAGE"? I tend to agree with Naoya. CONFIG_FS_DAX should not depend on CONFIG_HUGETLB_PAGE. There are some functions, e.g. mf_generic_kill_procs, are under the CONFIG_HUGETLB_PAGE unnecessarily. Those should be cleaned up altogether. Thanks! > > Thanks, > Naoya Horiguchi > >> >> 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