lkml.org 
[lkml]   [2019]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] modules: fix livelock in add_unformed_module()
From
Date
Hi -

On 5/13/19 7:23 AM, Prarit Bhargava wrote:
[snip]
> A module is loaded once for each cpu.

Does one CPU succeed in loading the module, and the others fail with EEXIST?

> My follow-up patch changes from wait_event_interruptible() to
> wait_event_interruptible_timeout() so the CPUs are no longer sleeping and can
> make progress on other tasks, which changes the return values from
> wait_event_interruptible().
>
> https://marc.info/?l=linux-kernel&m=155724085927589&w=2
>
> I believe this also takes your concern into account?

That patch might work for me, but I think it papers over the bug where
the check on old->state that you make before sleeping (was COMING ||
UNFORMED, now !LIVE) doesn't match the check to wake up in
finished_loading().

The reason the issue might not show up in practice is that your patch
basically polls, so the condition checks in finished_loading() are only
a quicker exit.

If you squash my patch into yours, I think it will cover that case.
Though if polling is the right answer here, it also raises the question
of whether or not we even need finished_loading().

Barret

\
 
 \ /
  Last update: 2019-05-13 16:38    [W:0.169 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site