All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: prarit@redhat.com, riel@redhat.com, mgorman@suse.de,
	peterz@infradead.org, alex.shi@intel.com,
	Igor Mammedov <imammedo@redhat.com>,
	hpa@zytor.com
Subject: deadlock between cpu_stopper & native_flush_tlb_others()->smp_call_function_many()
Date: Mon, 3 Mar 2014 17:43:56 +0100	[thread overview]
Message-ID: <20140303174356.082ec348@nial.usersys.redhat.com> (raw)

It looks like I hit a deadlock between smp_call_function_many() and
cpu_stopper threads.

Where smp_call_function_many() on CPU1 called from
native_flush_tlb_others() waits on call to be complete on
CPU2 while CPU2 waits on state synchronization in
multi_cpu_stop() which can't be completed until stop work
queued on CPU1 is completed, which can't be done since  CPU1
is busy looping in smp_call_function_many().


CPU1                                       CPU2
stop_machine()
 queue stop work on cpu 1&2

native_flush_tlb_others()
   smp_call_function_many()
      ...
---------------------------------------------------------
                                    cpu_stopper_thread()
                                       multi_cpu_stop()
                                          do {
                                             ...
                                             msdata->state == MULTI_STOP_PREPARE
                                             msdata->active_cpus == 0110
                                             msdata->thread_ack == 1
                                          } while (curstate != MULTI_STOP_EXIT)
                                    waiting until CPU1 ACKs state, i.e. thread_ack == 0
---------------------------------------------------------                                    
      ...
      if (wait) {
         for_cpu(0110) {
           csd_lock_wait(csd);
waiting until call on CPU2 is completed

Are there any suggestions on how to fix this nicely?

             reply	other threads:[~2014-03-03 16:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 16:43 Igor Mammedov [this message]
2014-03-03 16:45 ` deadlock between cpu_stopper & native_flush_tlb_others()->smp_call_function_many() Rik van Riel
2014-03-05 16:49   ` Igor Mammedov

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=20140303174356.082ec348@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=alex.shi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=peterz@infradead.org \
    --cc=prarit@redhat.com \
    --cc=riel@redhat.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.