Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1252728

Re: [PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a zapped ticked spinlock

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a zapped ticked spinlock
Date Wed, 21 Oct 2015 13:20:02 +0200
Message-ID <qlZB0-1iT-13@gated-at.bofh.it> (permalink)
References <qlXIS-70g-11@gated-at.bofh.it>
X-Original-To Petr Mladek <pmladek@suse.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2012-12-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 26
Organization linux.* mail to news gateway
X-Original-Cc Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, Andrew Morton <akpm@linux-foundation.org>, Jiri Kosina <jkosina@suse.com>, x86@kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Wed, 21 Oct 2015 13:11:20 +0200
X-Original-Message-ID <20151021111120.GK17308@twins.programming.kicks-ass.net>
X-Original-References <1445419089-4350-1-git-send-email-pmladek@suse.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1252728

Show key headers only | View raw


On Wed, Oct 21, 2015 at 11:18:09AM +0200, Petr Mladek wrote:
> There are few situations when we reinitialize (zap) ticket spinlocks. It
> typically happens when the system is going down after an error and we
> want to avoid deadlock in some important services. For example,
> zap_locks() in printk.c and ioapic_zap_locks().

So there's a few problems here. On x86 the code you patch is dead code,
x86 no longer uses ticket locks. Other archs might still.

And I entirely detest adding instructions to any lock path, be it the
utmost fast path or not, for something that will _never_ happen (on a
healthy system).

I would still very much recommend getting rid of the need for
zap_locks() in the first place.

What I did back when is punt on the whole printk buffer madness and dump
things to early_printk() without any locking.

I think that as long as the printk buffer has locks you have to accept
to loose some data when really bad stuff goes down.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a zapped ticked spinlock Petr Mladek <pmladek@suse.com> - 2015-10-21 11:20 +0200
  Re: [PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a  zapped ticked spinlock Peter Zijlstra <peterz@infradead.org> - 2015-10-21 13:20 +0200
    Re: [PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a  zapped ticked spinlock Petr Mladek <pmladek@suse.com> - 2015-10-22 11:40 +0200
      Re: [PATCH] x86/spinlocks: Avoid a deadlock when someone unlock a  zapped ticked spinlock Peter Zijlstra <peterz@infradead.org> - 2015-10-22 12:20 +0200

csiph-web