All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, lv.zheng@intel.com,
	stan.kain@gmail.com, waffolz@hotmail.com, josh@joshtriplett.org,
	rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
	jiangshanlai@gmail.com, mingo@kernel.org,
	torvalds@linux-foundation.org, rafael@kernel.org
Subject: Re: [PATCH] rcu: Narrow early boot window of illegal synchronous grace periods
Date: Sat, 14 Jan 2017 11:35:25 +0100	[thread overview]
Message-ID: <20170114103525.i5bob5tjszqdfpvn@pd.tnic> (raw)
In-Reply-To: <20170114080022.GS5238@linux.vnet.ibm.com>

On Sat, Jan 14, 2017 at 12:00:22AM -0800, Paul E. McKenney wrote:
> It now looks like this:
> 
> ------------------------------------------------------------------------
> 
> Note that the code was buggy even before this commit, as it was subject
> to failure on real-time systems that forced all expedited grace periods
> to run as normal grace periods (for example, using the rcu_normal ksysfs
> parameter).  The callchain from the failure case is as follows:
> 
> early_amd_iommu_init()
> |-> acpi_put_table(ivrs_base);
> |-> acpi_tb_put_table(table_desc);
> |-> acpi_tb_invalidate_table(table_desc);
> |-> acpi_tb_release_table(...)
> |-> acpi_os_unmap_memory
> |-> acpi_os_unmap_iomem
> |-> acpi_os_map_cleanup
> |-> synchronize_rcu_expedited
> 
> The kernel showing this callchain was built with CONFIG_PREEMPT_RCU=y,
> which caused the code to try using workqueues before they were
> initialized, which did not go well.
> 
> ------------------------------------------------------------------------
> 
> Does that work?

Yap, thanks.

> Fair point, but this wording appears in almost all of my patches.  ;-)

:-)

> My rationale is that it provides a clear transition from describing the
> problem to introducing the solution.

Fair enough.

> Exactly, but yes, worth a comment.
> 
> The header comment for rcu_scheduler_starting() is now as follows:
> 
> /*
>  * During boot, we forgive RCU lockdep issues.  After this function is
>  * invoked, we start taking RCU lockdep issues seriously.  Note that unlike
>  * Tree RCU, Tiny RCU transitions directly from RCU_SCHEDULER_INACTIVE
>  * to RCU_SCHEDULER_RUNNING, skipping the RCU_SCHEDULER_INIT stage.
>  * The reason for this is that Tiny RCU does not need kthreads, so does
>  * not have to care about the fact that the scheduler is half-initialized
>  * at a certain phase of the boot process.
>  */

Good.

> I believe that this would not buy very much, but if this variable starts
> showing up on profiles, then perhaps a jump label would be appropriate.
> As a separate patch, though!

Yeah, let's keep that opportunity in the bag, just in case.

> Thank you for your review and comments!

Thanks for the fix.

Btw, I'll build one more test kernel for people with your final version here:

https://lkml.kernel.org/r/1484383554-18095-2-git-send-email-paulmck@linux.vnet.ibm.com

backported to 4.9.

I say 4.9 because the reports started then, probably because of

  8b355e3bc140 ("rcu: Drive expedited grace periods from workqueue")

Which means, you probably should tag your fix CC:stable and add

Fixes: 8b355e3bc140 ("rcu: Drive expedited grace periods from workqueue")

to it too.

Hmmm.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2017-01-14 10:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  2:38 [PATCH] rcu: Narrow early boot window of illegal synchronous grace periods Paul E. McKenney
2017-01-13 11:25 ` Borislav Petkov
2017-01-14  8:00   ` Paul E. McKenney
2017-01-14 10:35     ` Borislav Petkov [this message]
2017-01-14 12:27       ` Rafael J. Wysocki
2017-01-14 12:50         ` Borislav Petkov
2017-01-16  1:57           ` Zheng, Lv
2017-01-16  4:56             ` Paul E. McKenney
2017-01-15  5:24       ` Paul E. McKenney
2017-01-15 10:09         ` Borislav Petkov
2017-01-15 20:33           ` Paul E. McKenney
2017-01-13 17:02 ` Borislav Petkov

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=20170114103525.i5bob5tjszqdfpvn@pd.tnic \
    --to=bp@alien8.de \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stan.kain@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=waffolz@hotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.