LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: Barret Rhoden <brho@google.com>, Jessica Yu <jeyu@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	David Arcari <darcari@redhat.com>
Subject: Re: [PATCH] modules: fix livelock in add_unformed_module()
Date: Wed, 22 May 2019 13:08:56 -0400	[thread overview]
Message-ID: <ba46f7c1-caee-4237-b6c5-7edec0eaaac3@redhat.com> (raw)
In-Reply-To: <d968a588-c43b-cfe1-6358-6c5d99f916a3@google.com>



On 5/13/19 10:37 AM, Barret Rhoden wrote:
> Hi -
> 

Hey Barret, my apologies for not getting back to you earlier.  I got caught up
in something that took me away from this issue.

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

The more I look at this I think you're right.  Let me do some additional testing
with your patch + my original patch.

P.


> Barret

  reply	other threads:[~2019-05-22 17:09 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
2019-05-22 17:08                 ` Prarit Bhargava [this message]
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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=ba46f7c1-caee-4237-b6c5-7edec0eaaac3@redhat.com \
    --to=prarit@redhat.com \
    --cc=brho@google.com \
    --cc=darcari@redhat.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jeyu@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] modules: fix livelock in add_unformed_module()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

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