mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [RFC][PATCH] spinlock_debug: report spinlock lockup from unlock
Date: Mon, 19 Dec 2016 11:20:24 +0100	[thread overview]
Message-ID: <20161219102024.GC3107@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161217161911.4753-1-sergey.senozhatsky@gmail.com>

On Sun, Dec 18, 2016 at 01:19:11AM +0900, Sergey Senozhatsky wrote:
> There is a race window between the point when __spin_lock_debug()
> detects spinlock lockup and the time when CPU that caused the
> lockup receives its backtrace interrupt.
> 
> Before __spin_lock_debug() triggers all_cpu_backtrace() it calls
> spin_dump() to printk() the current state of the lock and CPU
> backtrace. These printk() calls can take some time to print the
> messages to serial console, for instance (we are not talking
> about console_unlock() loop and a flood of messages from other
> CPUs, but just spin_dump() printk() and serial console).
> 
> All those preparation steps can give CPU that caused the lockup
> enough time to run away, so when it receives a backtrace interrupt
> it can look completely innocent.
> 
> The patch extends `struct raw_spinlock' with additional variable
> that stores jiffies of successful do_raw_spin_lock() and checks
> in debug_spin_unlock() whether the spin_lock has been locked for
> too long. So we will have a reliable backtrace from CPU that
> locked up and a reliable backtrace from CPU that caused the
> lockup.

But why? Also, why jiffies, that's a horrible source of time.

  parent reply	other threads:[~2016-12-19 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-17 16:19 Sergey Senozhatsky
2016-12-19  0:11 ` [lkp-developer] [spinlock_debug] bb161feebc: BUG:spinlock_missed_unlock_deadline_on_CPU kernel test robot
2016-12-19 11:55   ` Sergey Senozhatsky
2016-12-19 10:20 ` Peter Zijlstra [this message]
2016-12-19 10:50   ` [RFC][PATCH] spinlock_debug: report spinlock lockup from unlock Sergey Senozhatsky

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=20161219102024.GC3107@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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

Powered by JetHome