]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/memory-failure: use helper macro task_pid_nr()
authorMiaohe Lin <linmiaohe@huawei.com>
Wed, 12 Jun 2024 07:18:30 +0000 (15:18 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:11 +0000 (19:30 -0700)
Use helper macro task_pid_nr() to get the pid of a task.  No functional
change intended.

Link: https://lkml.kernel.org/r/20240612071835.157004-9-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index ee6ec63534b730878f7f8d17f5b9c7c8714e2e3c..bd3ab367ba2ff738483dc3c15863633df3c56e1e 100644 (file)
@@ -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);