From patchwork Thu Jun 6 06:32:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13687861 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 B0688C25B75 for ; Thu, 6 Jun 2024 06:36:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4FC86B00A0; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 932816B00A5; Thu, 6 Jun 2024 02:36:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FAA26B00A0; Thu, 6 Jun 2024 02:36:32 -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 B3CFB6B00A4 for ; Thu, 6 Jun 2024 02:36:31 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 68ACF812AD for ; Thu, 6 Jun 2024 06:36:31 +0000 (UTC) X-FDA: 82199504982.17.DF461A2 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf21.hostedemail.com (Postfix) with ESMTP id 46C091C0008 for ; Thu, 6 Jun 2024 06:36:28 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 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=1717655789; 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=soZo1En9PzWQ22PcQTpjA68XblULjTXmSbLLAd3BP2w=; b=Yd8AgwwesOPNbCyScCjZbvTBekLidgFentisYVUpTuszTo7tGhuBmXbsZnbX9NPuEA8t3c yS9V+JCmS49fvSHcf0nJhSC0zsb/i4DLQy1FFcF6Xhxbhr0tRboeGuhb1JWWsd2jsghO61 J8aGgxoPhhnS2VQZziKwzK8VVQKBnTY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none; spf=pass (imf21.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717655789; a=rsa-sha256; cv=none; b=yt8wNorRxZxxctt1Oz+Ph9rnjaVlS+TulNHxk64LkgyroQIw/2/lRtXkEEu+Ea3Z+qpW3M aciPoVY9TD0R/Kv9INorW/QB2BAz/QgnQuESnVGT/bbGohiiGol6vLdM7O2JY47kegr/WR 59t+yvHgDazhwPp2W5xKBN7OPx9eFS4= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VvvdS74xmzwRlg; Thu, 6 Jun 2024 14:32:28 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id B4A05141177; Thu, 6 Jun 2024 14:36:26 +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; Thu, 6 Jun 2024 14:36:26 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v2 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Thu, 6 Jun 2024 14:32:42 +0800 Message-ID: <20240606063247.712575-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240606063247.712575-1-linmiaohe@huawei.com> References: <20240606063247.712575-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-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 46C091C0008 X-Stat-Signature: osot3n36u8on5c9xojri6kr5usbcniz4 X-HE-Tag: 1717655788-333935 X-HE-Meta: U2FsdGVkX1+leUjdL1Su5T8TIvOlCL34Bf9bwVRUXmgFMMNRQjypWVKic1s5OzHadAINPLm4Q0CARviSNWLoBVbKXGZ2twqdVTOHLSp6n5FEZX9+aRVjQEONa7Xfq2qU3znrhMesXQFI6S04PhSw72CLGy4c9oAVY3EV/EDajj80z/TFrHTAyMQZp5nsbe6UR3Ih+juEowWk3D+jl+MfEzm7i7K7rouM/ehxbVU+11cftaeZh5XgBcqA8g4bwSs5CGEZ1sSkVbXKQpUenPrIAIwga2chTpONrBAsogbfLy900UMl3j2DZAm5NZcWSbx/KlkrtcRZcpOl9Ch7g4kZWOuhMApYW8DJAa+9gVJB+RzaJBXNkUcwLRP456gubWziPB9x1K8+K0ZVztl9suShNPoP2qNk92VU4uzo2uer7rah5og41NY0FtfYLw10u3UfYiM6iaY2UgJSKMBvQjNvw4H84J3xMb6VERNEILsqr0cNwBQT9nocHIn/cLLHyitRpfxd0eNZOObfFl7QluTMzFcZv4mGsJ9AYAze1lr0KDFivm+5avuRa+kLUObB71puP90FqA2iXqEd8IiD758OYnOOz+PrYa8IZexyFz+X7YpuiB86xRNvidg8PT+sBDxWGGWEJE1t6Z0HH/iDbmuZe0RufTRravuv8hNq/5HufIU9byHPBNB65QgLacRBd9ixW5hP5jsUAmnUTdIiP9pigJww1PfjYjrT4rCK8DAmkCM/WD9kQeN3YnllLRVk4ntYPv4Pj2Ub6cnpFBRHo/SnIzaBac419fJzCCeB+dJ0nOew4nDDY9W4RilppmVAisR3tOroP6HIIm2Cqt88Y+Gqs+9SbwRzATF3jTXsqAp1yeY+lwDUg4Zs98Gn21ftaQn3CaBpj+VSRAZVRjFvP7/9sNAnfBI929YuxTEkJwRnTvVkP/8rbuy9PiOKfIdQswIgvD0O3Xt1QCXyD6SrUQL l/zY7AvW I3zzAK0oJ1N3uQjFSn06l0jVKHrekdKQT/W6kTI90rpbWFpTwmUjdbt8RhdBr7T/FtHG4P/u0Vf43k8AgBcA7P/MZU0YRIquLDCyeZNRiq8m/w1mYbc1w/yC2iBdVVBCdusfDwbw5xgXyuRt83IW3sLxylQKuYYj5HwSj5im60PnQPhys+NXiUkWJz9C7DzqBfPaQs+pADQWYwSbM+fybKzFL/ltWwv2wvcleRpuF7DmDm5oVXsO/fw4FROb9/xFqT+XzJTjyERVuUBdT6FdK2Uw/wdbzpFB3xSiWbNqc2n2ukS0= 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 6e26b8b975e5..81a544df8381 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -343,7 +343,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, @@ -361,7 +361,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; } @@ -523,7 +523,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); } @@ -536,7 +536,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);