LKML Archive on
help / color / mirror / Atom feed
From: Barret Rhoden <>
To: Prarit Bhargava <>, Jessica Yu <>
	Heiko Carstens <>,
	David Arcari <>
Subject: Re: [PATCH] modules: fix livelock in add_unformed_module()
Date: Mon, 13 May 2019 10:37:03 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi -

On 5/13/19 7:23 AM, Prarit Bhargava wrote:
> 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().
> 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 

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().


  reply	other threads:[~2019-05-13 14:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 22:22 [PATCH v3] kernel/module: Reschedule while waiting for modules to finish loading Prarit Bhargava
2019-05-01  7:49 ` Jessica Yu
2019-05-01 21:26 ` Prarit Bhargava
2019-05-02  9:48   ` Jessica Yu
2019-05-02 12:41     ` Prarit Bhargava
2019-05-02 17:46       ` Prarit Bhargava
2019-05-10 18:40         ` Barret Rhoden
2019-05-10 18:42           ` [PATCH] modules: fix livelock in add_unformed_module() Barret Rhoden
2019-05-13 11:23             ` Prarit Bhargava
2019-05-13 14:37               ` Barret Rhoden [this message]
2019-05-22 17:08                 ` Prarit Bhargava
2019-05-28 14:30                   ` Prarit Bhargava
2019-05-28 14:47                     ` Jessica Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] modules: fix livelock in add_unformed_module()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).