From patchwork Wed Jun 12 07:18:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 13694540 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 C8823C27C53 for ; Wed, 12 Jun 2024 07:23:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 302786B0176; Wed, 12 Jun 2024 03:22:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E51B06B0179; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B449D6B0171; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1AF9D6B0177 for ; Wed, 12 Jun 2024 03:22:58 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9CA75C11AA for ; Wed, 12 Jun 2024 07:22:57 +0000 (UTC) X-FDA: 82221394794.07.8DC1C88 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf09.hostedemail.com (Postfix) with ESMTP id 68AFE14000C for ; Wed, 12 Jun 2024 07:22:55 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 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=1718176975; 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=SIwq/rG4ODoyJgdTmwJvBbiQWYDyX7Yl/OurV7A99WM=; b=uhmpEpZ6KuhFm1wQqYtXRygmGUW3Lw28vU1oSGnb3sJG1CIxOC7XoXKyHOHoGbCv82QDZ5 8wTuJ59LKfGPkPyYvIe3kMjj23T+7GKyYiKoCpyq7E3bj4gSErMezkKdtRAllDK29AJ70I RqVpeqJ39Mbl42BOwtsobpSA6qTGtIM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718176975; a=rsa-sha256; cv=none; b=YuT8B9PgDs143ehrqJJj1XzyhTvUWLWNnyUI8ZsjgPIbzTo5Q9ClvDJVhi/LpNhCvw5yYg 0jq+xcPUFt9mrWnURVneIxCA/0IYflXct1tghrfvmQQ2wj/kibYMLBahN4l0DW+Abil2pm etSouWSok5fUzfTYDxoilZAOekYd2VA= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VzcMN65pyzmb4P; Wed, 12 Jun 2024 15:18:08 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id 7399D180AAB; Wed, 12 Jun 2024 15:22:52 +0800 (CST) Received: from huawei.com (10.173.127.72) 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; Wed, 12 Jun 2024 15:22:22 +0800 From: Miaohe Lin To: , , CC: , , , , Subject: [PATCH v3 08/13] mm/memory-failure: use helper macro task_pid_nr() Date: Wed, 12 Jun 2024 15:18:30 +0800 Message-ID: <20240612071835.157004-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240612071835.157004-1-linmiaohe@huawei.com> References: <20240612071835.157004-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.173.127.72] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-Rspamd-Server: rspam03 X-Stat-Signature: 1mc8aydybz8gp7yt7odch5w6cj6am39n X-Rspamd-Queue-Id: 68AFE14000C X-Rspam-User: X-HE-Tag: 1718176975-697815 X-HE-Meta: U2FsdGVkX1+gZd8b/WyJgXxkQzn+GfFQe46J959NxVnTNdY8W9THwAVaZ8r62DDmfYmUwNamQSdWfnDpLp+GeHCJs+CYUBkfYFGdh7s77Ahdt1iCUGDLkVEyzIFUBzQfNNZNHrZDKARkD8urcz390CTpYbtybXwqSNTGJO+3UzaYOY3yySlUQzpVVsjRS6XH2AxVysVUn+mIpoCa9ExG/X1SqsIIhXTY5oHZBz5B1kgn8nf4OceqHe+rY0zSY0UtQDsF6Pmlu3S3iHaOZcejd5nTsO3/fKVs5r1aAhLbXbFIUbrcoErHie55v7iYPPAufSunbh5ZCOzjJVY+Vh0HhARj0U8mpEzdB83y5sQFltNZSDiEFrg3nLzd4EtEigHYbn3AGhPOlYSF4TjLrU1e2cXaPANL1y6B48GfZcfRJbTDv9Snk7a+GrGpN5DQYUpF9aRzOvSTWisFGHe73F5pGnhDu2HORdtIPBb6Dpg8OVB0uAYcOHD9xz9wqNND0Urn9+20mX+yYyy4ldxgfgKGhoRBaX6F/UXTfMUpdikl5Ll4tmcWqEnBuQmR+BXUSnVovrPo2pg9EUhoY6yZXT8SAu/t2K5FE1pV90/l0CSX7p/8YtAuGLM0rpOnyaDFEg/w+jC0tKzpwmovn/q2RcpGe+z6/+2bpftdw7qEfTXOMxFQa9OvcwpYEgJLQxvgyhYDBwniAnh1mRQdcYf8rpejixb6ZasZDQ6YuEiyx8NUZy51HPrHBTwcjPbEPshbejUrlp/uzYtp7+fHAzXt9fEOqcr/9ZvULJ9rI2AdHzak1H2D8IUY6cBuofO0W7/jM5O5ifT2jzu03YnKlrdOpiNssG+WGm0MiwnMB5g7jn6zyXZ0RCIB4EPxqh2aHn/2lr9fF830cohJtaG0zSZBK3cm3ZbuAApJ8MopGcJvvZruXbloZlegskHDa6+OeCr91Jn3pqNRT5C7C+IQFlyv1Xa RHD3/7YA zC+6vueI4Stc/OL2cebt6HFRiPkT2fZdZGyr2xd/ej1mfXN8Fmpz9cQW4anKyl6zNOfAiQidGXR+Ktie2EPn10EsierobvyGa3cCLGmgEeu78IIGcqTc0nkv1LxvJuhc6UAwZ2DWBHHJAdVBfe4QgL2QxeH9H3DKITZUFPoZC9I04aU+EKAqD28BA2aGF2X6O5qxBYR95gY3iI2wZV6CZSPyYVpfpyhIM4LFHwGyTptcgp25/UcrWbn8KG6q+NiP+GiTRulvrQCX4im3kJNmjic7ZLwTWqbwbS9Ikjd7u0+A5Lbo= 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 ee6ec63534b7..bd3ab367ba2f 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);