]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
perf: Fix task_function_call() error handling
authorKajol Jain <kjain@linux.ibm.com>
Thu, 27 Aug 2020 06:47:32 +0000 (12:17 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:25 +0000 (14:48 +0100)
commit82ea48099655e61decbad7d7c5a47824b52d49b4
treeef5c925739b9e176bc3cb75e2b64faabf3dff600
parentc91226a8a8aa744a7668e7df868ec81a27e91d77
perf: Fix task_function_call() error handling

BugLink: https://bugs.launchpad.net/bugs/1902110
[ Upstream commit 6d6b8b9f4fceab7266ca03d194f60ec72bd4b654 ]

The error handling introduced by commit:

  2ed6edd33a21 ("perf: Add cond_resched() to task_function_call()")

looses any return value from smp_call_function_single() that is not
{0, -EINVAL}. This is a problem because it will return -EXNIO when the
target CPU is offline. Worse, in that case it'll turn into an infinite
loop.

Fixes: 2ed6edd33a21 ("perf: Add cond_resched() to task_function_call()")
Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Barret Rhoden <brho@google.com>
Tested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Link: https://lkml.kernel.org/r/20200827064732.20860-1-kjain@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
kernel/events/core.c