From: Oleg Nesterov <oleg@redhat.com>
To: Roman Peniaev <r.peniaev@gmail.com>
Cc: Ming Lei <ming.lei@canonical.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading
Date: Thu, 18 Sep 2014 19:28:12 +0200 [thread overview]
Message-ID: <20140918172812.GA340@redhat.com> (raw)
In-Reply-To: <CACZ9PQV0uQ+0Nzn10tCxyVo0_8qRFexh0iQLQErAkFc1T2WGHA@mail.gmail.com>
On 09/18, Roman Peniaev wrote:
>
> If my final understanding is right (please, correct me if I am still wrong),
> following reordering can happen, but we are fine with it:
>
> wake_up_rootfs wait_event
>
> LOCK
> check the list, but empty
> set CONDITION <<< reordered
> UNLOCK
Yes,
> LOCK
> add to the list
> rmb <<< now we
> see CONDITION
Yes, but note that "now we see CONDITION" is true right after LOCK,
not sure what does this "rmb" in your pseudo mean. If you meant mb()
implied by set_current_state(), please see the comment above
prepare_to_wait().
> UNLOCK
>
> check CONDITION <<< it is
> set, we are woken up
Yes. In short, we rely on wait_queue_head_t->lock. Once a CPU takes
this lock, it should see all changes done by another CPU before it
released the same lock.
Oleg.
next prev parent reply other threads:[~2014-09-18 17:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 14:45 [PATCH 1/1] init: fix race between rootfs mount and firmware loading Roman Pen
2014-09-15 16:39 ` Oleg Nesterov
2014-09-17 13:18 ` Roman Peniaev
2014-09-17 13:28 ` [v2 PATCH " Roman Pen
2014-09-17 17:46 ` Oleg Nesterov
2014-09-18 13:31 ` Roman Peniaev
2014-09-18 17:28 ` Oleg Nesterov [this message]
2014-09-18 13:33 ` [v3 " Roman Pen
2014-09-18 17:41 ` Oleg Nesterov
2014-09-19 12:41 ` Roman Peniaev
2014-09-19 18:03 ` Oleg Nesterov
2014-09-19 12:44 ` [v4 " Roman Pen
2014-09-19 19:45 ` Oleg Nesterov
2014-09-20 13:20 ` Roman Peniaev
2014-09-19 21:42 ` Greg Kroah-Hartman
2014-09-20 13:18 ` Roman Peniaev
2014-09-20 14:42 ` Greg Kroah-Hartman
2014-09-20 15:12 ` Roman Peniaev
2014-09-17 17:59 ` [PATCH " Oleg Nesterov
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=20140918172812.GA340@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=r.peniaev@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).