From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbeARPP2 (ORCPT ); Thu, 18 Jan 2018 10:15:28 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:49062 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbeARPP1 (ORCPT ); Thu, 18 Jan 2018 10:15:27 -0500 Date: Thu, 18 Jan 2018 16:15:12 +0100 (CET) From: Thomas Gleixner To: Peter Zijlstra cc: Yang Shi , longman@redhat.com, LKML Subject: Re: [PATCH 2/2 v3] lib: debugobjects: touch watchdog to avoid softlockup when !CONFIG_PREEMPT In-Reply-To: <20180118150505.GD2249@hirez.programming.kicks-ass.net> Message-ID: References: <1515023802-54196-1-git-send-email-yang.s@alibaba-inc.com> <1515023802-54196-2-git-send-email-yang.s@alibaba-inc.com> <20180118150505.GD2249@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Jan 2018, Peter Zijlstra wrote: > On Thu, Jan 18, 2018 at 10:02:25AM +0100, Thomas Gleixner wrote: > > > > 2) We can do a cond_resched() if not in atomic context and interrupts are > > > > enabled. > > > > > > I did try this before I went with touching softlockup watchdog approach. The > > > problem is in_atomic() can't tell if it is in atomic context on non-preempt > > > kernel. For preempt kernel, it is easy. > > > > Peter, can we do anything about that? > > Not really :/ Take for instance a spinlock on !PREEMPT, only the lock > variable is touched, preempt_count isn't. So we cannot know. Fair enough.