From patchwork Fri May 24 09:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13672902 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 75869C25B79 for ; Fri, 24 May 2024 09:16:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 433EE6B009C; Fri, 24 May 2024 05:16:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 395076B009F; Fri, 24 May 2024 05:16:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20F436B00A0; Fri, 24 May 2024 05:16:35 -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 E91BB6B009C for ; Fri, 24 May 2024 05:16:34 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AF2871C0694 for ; Fri, 24 May 2024 09:16:34 +0000 (UTC) X-FDA: 82152733908.21.A345863 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf13.hostedemail.com (Postfix) with ESMTP id 77F2A20003 for ; Fri, 24 May 2024 09:16:32 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716542192; 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=qoJNvu1RiPUUyDrjtzeI3sYnz0Qolq71EyFL8A9HqE4=; b=WdGHNb7Z1XUAtd6yBgBz9E+ct/rNeVR3+s046rEMfouPMOM+o4O9mmscIZ27Rn5HTKPmlV tQIIZtNceH5kKFq3WSvLX1VCUJpxq9tDWRLEVIuxbRp/v1mqOto9yPLxc+Z/KdwKGVp06u LSeVvtiF40WjG8ScduozjXA163bSotc= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716542192; a=rsa-sha256; cv=none; b=BT/9yYcegU6IZccuUnczFeAKLd9JX5GliuezsVrc8CHCuV5U27SmLUFKqWlYseRGbQOouE 3vBd3LjMSCQqQOQksIPNGM9vZlUb0WVaL6hg2eonaCSUxyM7yxIhlD5rPL4TCa5EVovIo3 rWVQFF+L8WcC8ZUIZ8bTdIZH1yRtXxA= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VlzpQ3LHqzsR5g; Fri, 24 May 2024 17:12:46 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 0AB32180A9C; Fri, 24 May 2024 17:16:30 +0800 (CST) Received: from huawei.com (10.173.135.154) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 24 May 2024 17:16:29 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Fri, 24 May 2024 17:13:05 +0800 Message-ID: <20240524091310.1430048-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com> References: <20240524091310.1430048-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.135.154] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Queue-Id: 77F2A20003 X-Stat-Signature: ojffpewigdciqmuung4ox1ir5pz7w9i5 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1716542192-383189 X-HE-Meta: U2FsdGVkX1+Sp2P70Iw44gkJjYMgevQC4yf8mDYGr20URWDMjIM7KJZUtBYuKHIDfhClKzRRRYnEflPrEQPMdJc37hRqtoFsCFgjdgPFfr1N80dE17m7Qma/vTep6Pfuvlkxv+gLcWvUN0nPA1o1PBxnWFpUMIVJACOSwwTU12+HGxXZPvuyT3j3s/Pj2f0rM2HzORWw+Hdh71Vg/5CPqD0kAuhw15bOtKFEGmCoQ36dR0TpekzNSPLZ+g5cALMBMgxZqrMGjFU9xZxD7+gvoTXlcNjAB+hfbuh3XMlKxOs+6ITofsoMQx7H6XeeK7DM3Ii79McJXa3iBz52FTe48HsDYIucoyO4JHgiPs9D8VZyN+yuQWa2hERdbncV1/h6bYS7jmDjBUqL+hcRj6fgK4D/1Yzq0MpIQeMhQMjyWaAsl+SQbB8QxMSBlkP5jYvQj/RdV6hdfehWlCtkiSA48RhOPaNJ/BzDwYFa19y2xvfTW8jIkAmdoq4v0Z2z2JeHjukbR5+OxfIma9R1GahkqI700ZyJe+ffkucRFVwBOxT2pNbNxPaOj7nqf3AQ08LWzaC1o552j6k5k5u3huE2zlr0+i1FSvMGLZwvLD41FXqnpzpY25T0f3IJ6spUggiiI7JmwCX4C0N3yOYoMr2QQPt0YlklzLcLZ4bLHuVrY2zD9HdgW3VmhPgYP22JAtOymo0+2TPmH3TTjO2qxj8lhv3r5vehfDmdVAYvakf5MFvdG9xm+bX/WT6kYRqx4Q5tx9w2bzLezExHhKewUKPgY6klVCbEU/p9XuHVBhtA1dJdqRrgrhXSLJtLaeY0Q8xUowgM6qJLUDrddnpFKb6u4Fij2q/ndTESVGPatsgWEKm2fb/NgecbSebmDBqNFxIBjRihLheshd7iIHWneOlJAO11WGa+krduV78Dsm47xfuNQnYLwg0XpSDMURivZkNLPeYJIsWk73FrSl2PWUz 3iK/9wT/ FZwLPi5g4bEH/mRtxM91LsNonS1vOAPGbK0KADCYQXcy6tUAvCNmy8VexguAL3FpmsgQWO0jgvNg+YM5NjBnAAf3+EpJFXqUzX/pSFbssdumnru8b8hcwVSFUZsA4b0AQShNYsBgKemgVZP1T3iuK5MpbdfFmlD463Is49IH/MayYMXIrQmiMNnJkDF4NQH0opoG0FaA50YYtQzhDtmocK8FceGQzIXKdw78k00m0O8tN2aDgH5Pgna15D4UcwJp+BcZVLG7/IgYQtXVdmApyjTIIt8FLc/Z672PN2pfsrhwt/Jk= 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: Use helper macro task_pid_nr() to get the pid of a task. No functional change intended. Signed-off-by: Miaohe Lin --- mm/memory-failure.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 2c3ecbfc2134..19d338e83e43 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -338,7 +338,7 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) int ret = 0; pr_err("%#lx: Sending SIGBUS to %s:%d due to hardware memory corruption\n", - pfn, t->comm, t->pid); + pfn, t->comm, task_pid_nr(t)); if ((flags & MF_ACTION_REQUIRED) && (t == current)) ret = force_sig_mceerr(BUS_MCEERR_AR, @@ -356,7 +356,7 @@ static int kill_proc(struct to_kill *tk, unsigned long pfn, int flags) addr_lsb, t); if (ret < 0) pr_info("Error sending signal to %s:%d: %d\n", - t->comm, t->pid, ret); + t->comm, task_pid_nr(t), ret); return ret; } @@ -518,7 +518,7 @@ static void kill_procs(struct list_head *to_kill, int forcekill, if (forcekill) { if (tk->addr == -EFAULT) { pr_err("%#lx: forcibly killing %s:%d because of failure to unmap corrupted page\n", - pfn, tk->tsk->comm, tk->tsk->pid); + pfn, tk->tsk->comm, task_pid_nr(tk->tsk)); do_send_sig_info(SIGKILL, SEND_SIG_PRIV, tk->tsk, PIDTYPE_PID); } @@ -531,7 +531,7 @@ static void kill_procs(struct list_head *to_kill, int forcekill, */ else if (kill_proc(tk, pfn, flags) < 0) pr_err("%#lx: Cannot send advisory machine check signal to %s:%d\n", - pfn, tk->tsk->comm, tk->tsk->pid); + pfn, tk->tsk->comm, task_pid_nr(tk->tsk)); } list_del(&tk->nd); put_task_struct(tk->tsk);