Skip to content

hung_task: fix the broken rcu_lock_break() logic

Oleg Nesterov lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1hung_task: fix the broken rcu_lock_break() logickernel/hung_task.c+7 -40 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchFrederic WeisbeckerMandeep Singh BainesPaul E. McKenney
1/1A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/1] hung_task: fix the broken rcu_lock_break() logic
Quoted 9 lines · Oleg Nesterov
Quoted 7 lines · Tetsuo Handa
Quoted 5 lines · Oleg Nesterov
    int main(void)
    {
            vfork();
            pause();
    }
Quoted 6 lines
Quoted 2 lines

^
Wow!

and this reminds me... check_hung_uninterruptible_tasks() is very broken, it can crash the kernel itself. I'll resend my ancient fixes once again today, maybe this resend will be successful ;)

Please apply.

The patch was sent more than a year ago, I preserved the acks I got.

I was also going to add the PF_FREEZER_SKIP check in check_hung_task(), but this was already done: f9fab10bbd768b0e5254e53a4a8477a94bfc4b96. This means I lied, the program above no longer creates the problem for check_hung_uninterruptible_tasks(). But that was not the point for make-it-killable anyway.

I simply can't understand why do we have sysctl_hung_task_check_count, may be someone can explain... OK, we need to do rcu_read_unlock() from time to time even if need_resched() is not set, that is why we have HUNG_TASK_BATCHING. Although perhaps it makes sense to do

	-	if (!--batch_count)
	+	if (!--batch_count || need_resched())
			rcu_lock_break();

but max_count? I guess I missed something obvious.

Oleg.