linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: aik@ozlabs.ru, shreyas@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org, anton@samba.org,
	tglx@linutronix.de, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH V4] tick/hotplug: Handover time related duties before cpu offline
Date: Tue, 17 Feb 2015 12:58:04 +1100	[thread overview]
Message-ID: <1424138284.1808.5.camel@ellerman.id.au> (raw)
In-Reply-To: <20150131041342.17103.30020.stgit@preeti.in.ibm.com>

On Sat, 2015-01-31 at 09:44 +0530, Preeti U Murthy wrote:
> These duties include do_timer to update jiffies and broadcast wakeups on those
> platforms which do not have an external device to handle wakeup of cpus from deep
> idle states. The handover of these duties is not robust against a cpu offline
> operation today.
> 
> The do_timer duty is handed over in the CPU_DYING phase today to one of the online
> cpus. This relies on the fact that *all* cpus participate in stop_machine phase.
> But if this design is to change in the future, i.e. if all cpus are not
> required to participate in stop_machine, the freshly nominated do_timer cpu
> could be idle at the time of handover. In that case, unless its interrupted,
> it will not wakeup to update jiffies and timekeeping will hang.
> 
> With regard to broadcast wakeups, today if the cpu handling broadcast of wakeups
> goes offline, the job of broadcasting is handed over to another cpu in the CPU_DEAD
> phase. The CPU_DEAD notifiers are run only after the offline cpu sets its state as
> CPU_DEAD. Meanwhile, the kthread doing the offline is scheduled out while waiting for
> this transition by queuing a timer. This is fatal because if the cpu on which
> this kthread was running has no other work queued on it, it can re-enter deep
> idle state, since it sees that a broadcast cpu still exists. However the broadcast
> wakeup will never come since the cpu which was handling it is offline, and the cpu
> on which the kthread doing the hotplug operation was running never wakes up to see
> this because its in deep idle state.
> 
> Fix these issues by handing over the do_timer and broadcast wakeup duties just before
> the offline cpu kills itself, to the cpu performing the hotplug operation. Since the
> cpu performing the hotplug operation is up and running, it becomes aware of the handover
> of do_timer duty and queues the broadcast timer upon itself so as to seamlessly
> continue both these operations.
> 
> It fixes the bug reported here:
> http://linuxppc.10917.n7.nabble.com/offlining-cpus-breakage-td88619.html
> 
> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
> ---
> Changes from V3: https://lkml.org/lkml/2015/1/20/236
> 1. Move handover of broadcast duty away from CPU_DYING phase to just before
> the cpu kills itself.
> 2. Club the handover of timekeeping duty along with broadcast duty to make
> timekeeping robust against hotplug.

Hi Preeti,

This bug is still causing breakage for people on Power8 machines.

Are we just waiting for Thomas to take the patch?

cheers

  reply	other threads:[~2015-02-17  1:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31  4:14 [PATCH V4] tick/hotplug: Handover time related duties before cpu offline Preeti U Murthy
2015-02-17  1:58 ` Michael Ellerman [this message]
2015-02-17  4:08   ` Preeti U Murthy
2015-02-17  4:55     ` Michael Ellerman

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=1424138284.1808.5.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=aik@ozlabs.ru \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=shreyas@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /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).