Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933967AbcJUMwS (ORCPT ); Fri, 21 Oct 2016 08:52:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:56879 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933726AbcJUMu5 (ORCPT ); Fri, 21 Oct 2016 08:50:57 -0400 From: Petr Mladek To: Jason Wessel Cc: Daniel Thompson , Peter Zijlstra , Andrew Morton , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 0/2] kdb: Fix locking in vkdb_printf() Date: Fri, 21 Oct 2016 14:50:33 +0200 Message-Id: <1477054235-1624-1-git-send-email-pmladek@suse.com> X-Mailer: git-send-email 1.8.5.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 936 Lines: 25 I have been asked whether it is safe to call vkdb_printf() from vprintk_nmi() in NMI context. It seems that it is not safe. Well, is not a big deal. But I have noticed suspicious patterns when looking at the vkdb_printf() locking code and prepared two patches that should avoid some possible races. Please, note that I am not familiar with the kdb implementation. I hope that I have got the requested behavior right. I did some basic testing and did not found any problem. But I am sure that I did not test all usecases. Petr Mladek (2): kdb: Properly synchronize vkdb_printf() calls with other CPUs kdb: Call vkdb_printf() from vprintk_default() only when wanted include/linux/kdb.h | 1 + kernel/debug/kdb/kdb_io.c | 41 +++++++++++++++++------------------------ kernel/debug/kdb/kdb_private.h | 1 - kernel/printk/printk.c | 4 +++- 4 files changed, 21 insertions(+), 26 deletions(-) -- 1.8.5.6