Skip to content

Commit

Permalink
Merge pull request #1024 from joe-lawrence/remove-signal
Browse files Browse the repository at this point in the history
kpatch: remove manual signaling logic
  • Loading branch information
joe-lawrence authored Aug 19, 2019
2 parents a23c82d + 3335abc commit 6f5edcd
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions kpatch/kpatch
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,8 @@ signal_stalled_processes() {
[[ -z "$module" ]] && return

if [[ -e "/sys/kernel/livepatch/$module/signal" ]] ; then
echo "signaling stalled process(es):"
echo 1 > "/sys/kernel/livepatch/$module/signal"
else
for proc_task in /proc/[0-9]*/task/[0-9]*; do
tid=${proc_task#*/task/}
if is_stalled "$module" "$tid" ; then
if [[ "$tid" -eq "$$" ]] ; then
echo "skipping pid $tid $(cat "$proc_task"/comm 2>/dev/null)"
else
echo "signaling pid $tid $(cat "$proc_task"/comm 2>/dev/null)"
kill -SIGSTOP "$tid"
sleep .1
kill -SIGCONT "$tid"
fi
fi
done
fi
}

Expand All @@ -263,7 +250,7 @@ wait_for_patch_transition() {
sleep 1s
done

echo "patch transition has stalled, signaling stalled process(es):"
echo "patch transition has stalled!"
signal_stalled_processes

echo "waiting (up to $POST_SIGNAL_WAIT seconds) for patch transition to complete..."
Expand Down

0 comments on commit 6f5edcd

Please sign in to comment.