From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <tony.luck@intel.com>, <bp@alien8.de>
Cc: <nao.horiguchi@gmail.com>, <linmiaohe@huawei.com>,
<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
<linux-edac@vger.kernel.org>
Subject: [PATCH 08/13] mm/memory-failure: use helper macro task_pid_nr()
Date: Fri, 24 May 2024 17:13:05 +0800 [thread overview]
Message-ID: <20240524091310.1430048-9-linmiaohe@huawei.com> (raw)
In-Reply-To: <20240524091310.1430048-1-linmiaohe@huawei.com>
Use helper macro task_pid_nr() to get the pid of a task. No functional
change intended.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
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);
--
2.33.0
next prev parent reply other threads:[~2024-05-24 9:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 9:12 [PATCH 00/13] Some cleanups for memory-failure Miaohe Lin
2024-05-24 9:12 ` [PATCH 01/13] mm/memory-failure: simplify put_ref_page() Miaohe Lin
2024-05-24 9:12 ` [PATCH 02/13] mm/memory-failure: remove MF_MSG_SLAB Miaohe Lin
2024-05-24 9:13 ` [PATCH 03/13] mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM Miaohe Lin
2024-05-24 9:13 ` [PATCH 04/13] mm/memory-failure: save a page_folio() call Miaohe Lin
2024-05-24 15:06 ` David Hildenbrand
2024-05-25 1:34 ` Miaohe Lin
2024-05-24 9:13 ` [PATCH 05/13] mm/memory-failure: remove unneeded empty string Miaohe Lin
2024-05-24 9:13 ` [PATCH 06/13] mm/memory-failure: remove confusing initialization to count Miaohe Lin
2024-05-24 9:13 ` [PATCH 07/13] mm/memory-failure: remove unneeded hwpoison_filter() variant Miaohe Lin
2024-05-24 15:38 ` kernel test robot
2024-05-24 15:59 ` kernel test robot
2024-05-25 1:52 ` Miaohe Lin
2024-05-24 9:13 ` Miaohe Lin [this message]
2024-05-24 9:13 ` [PATCH 09/13] mm/memory-failure: remove obsolete comment in unpoison_memory() Miaohe Lin
2024-05-24 15:06 ` David Hildenbrand
2024-05-24 9:13 ` [PATCH 10/13] mm/memory-failure: move some function declarations into internal.h Miaohe Lin
2024-05-25 2:39 ` kernel test robot
2024-05-25 6:39 ` Miaohe Lin
2024-05-24 9:13 ` [PATCH 11/13] mm/memory-failure: fix comment of get_hwpoison_page() Miaohe Lin
2024-05-24 9:13 ` [PATCH 12/13] mm/memory-failure: remove obsolete comment in kill_proc() Miaohe Lin
2024-05-24 9:13 ` [PATCH 13/13] mm/memory-failure: correct comment in me_swapcache_dirty Miaohe Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240524091310.1430048-9-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nao.horiguchi@gmail.com \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox