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 79C13C00140 for ; Fri, 29 Jul 2022 01:38:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B15B6B0071; Thu, 28 Jul 2022 21:38:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 838856B0072; Thu, 28 Jul 2022 21:38:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D9DE8E0001; Thu, 28 Jul 2022 21:38:03 -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 5B1846B0071 for ; Thu, 28 Jul 2022 21:38:03 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 229E7C0FB9 for ; Fri, 29 Jul 2022 01:38:03 +0000 (UTC) X-FDA: 79738426446.25.A4FCEFE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 852091C000E for ; Fri, 29 Jul 2022 01:38:02 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB3B761D3F; Fri, 29 Jul 2022 01:38:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE234C433C1; Fri, 29 Jul 2022 01:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1659058681; bh=jtgZViSVTrJWuFA/FbVauguHSM/s1zXeAgY+DlzeQHw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EyN5DPL4n9qE0A0lfvgCabvtNYmWkgDu3prE/prFyNgS+ndOsrEz+3Td3a3aeZSTY 7q7TsKk9HrVQx9RdMVDkIQSwqa0KTWuOpsJ8W7jfT8OkQzdr6xnRl8Ze1MIPc3ZfFB zXpbQO0RPPcw4FRbCEF+logzxtRz46yOI6702u8Q= Date: Thu, 28 Jul 2022 18:37:59 -0700 From: Andrew Morton To: Kefeng Wang Cc: Naoya Horiguchi , Miaohe Lin , , Subject: Re: [PATCH v2] mm: memory-failure: convert to pr_fmt() Message-Id: <20220728183759.6a3eaab13b1b122a5810af58@linux-foundation.org> In-Reply-To: <20220727032511.145506-1-wangkefeng.wang@huawei.com> References: <20220727032511.145506-1-wangkefeng.wang@huawei.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659058682; a=rsa-sha256; cv=none; b=DBjyuz5VJJZ94CNU1kHw74pyEvs/evZj3y+ml01DKzYgWarfzp8lVE0M0Mz4XkgONHoJbt 34o5WJUVXMaDeBa4xcEndIFFgG5qobdGJVgwHoxD5o47RSFTi1mQbcteOaeAjzxXZqawDf IiLml50HlQDCBJHiCuR4SxS2Rw5nKRY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=EyN5DPL4; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659058682; 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:dkim-signature; bh=JmAdHE40yKZLfld49Oyo5kW0cNeEGLa56OFRjkDRNnE=; b=T4b0vQyD0DgeB/rRZvIzUWubMs2dU0RyCaAe8Y5rMoagH4xj9Zw2MjzQWahvdiauwzUnZ7 lzfv5jJAthHBJcaajaAntLHGbalVMPjsIpAc7e8koimHlI1eskJ2Hb389mzLSxFYgeHHEs PGyWNt9QW5NYSlX+oCgV26lHVc0jFjU= X-Rspamd-Queue-Id: 852091C000E X-Rspam-User: X-Stat-Signature: aud8ddcu5qf9d8xq77mzcd9sia58mieu Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=EyN5DPL4; spf=pass (imf21.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam08 X-HE-Tag: 1659058682-490978 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 Wed, 27 Jul 2022 11:25:11 +0800 Kefeng Wang wrote: > Use pr_fmt to prefix all pr_ output, but unpoison_memory() > and soft_offline_page() are used by error injection, which have > own prefixes like "Unpoison:" and "soft offline:", meanwhile, > soft_offline_page() could be used by memory hotremove, so undef > pr_fmt before unpoison_pr_info definition to keep the original > output for them. > > ... > > @@ -2289,6 +2285,7 @@ static int __init memory_failure_init(void) > } > core_initcall(memory_failure_init); > > +#undef pr_fmt > #define unpoison_pr_info(fmt, pfn, rs) \ > ({ \ > if (__ratelimit(rs)) \ This change makes the build fail. In file included from ./include/linux/kernel.h:29, from mm/memory-failure.c:39: mm/memory-failure.c: In function 'unpoison_memory': ./include/linux/printk.h:537:26: error: expected ')' before 'pr_fmt' 537 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ^~~~~~ ./include/linux/printk.h:388:42: note: in definition of macro '__printk_index_emit' 388 | if (__builtin_constant_p(_fmt) && __builtin_constant_p(_level)) { \ | ^~~~ ./include/linux/printk.h:464:26: note: in expansion of macro 'printk_index_wrap' 464 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~ ./include/linux/printk.h:537:9: note: in expansion of macro 'printk' 537 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ^~~~~~ mm/memory-failure.c:2292:17: note: in expansion of macro 'pr_info' 2292 | pr_info(fmt, pfn); \ | ^~~~~~~ mm/memory-failure.c:2326:17: note: in expansion of macro 'unpoison_pr_info' 2326 | unpoison_pr_info("Unpoison: Disabled after HW memory failure %#lx\n", | ^~~~~~~~~~~~~~~~ [1500 lines of the same]