Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp546592imm; Wed, 1 Aug 2018 00:55:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpckhOeF+2p1mQEdbIKQ8fpVZva+XMrDw3HoHe2F9ATc+L34Wd3zdroTnCQo5Uddi7BlYwuy X-Received: by 2002:a63:64c2:: with SMTP id y185-v6mr23271596pgb.126.1533110106181; Wed, 01 Aug 2018 00:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533110106; cv=none; d=google.com; s=arc-20160816; b=E1Au0l7sSrbZITQODYCml1Kj0PgveR+lIpc9AfgldO4n1kqEQRpRl0eeFQ8JoRmbZt vLlrYAj2X1JdfZkZuFBL5MULmUnORUpk+QhsliaoxeVDsEfgjLh9jybwnq8hRSE9H810 M33dpu4GDkZ7uTTdmBXRVYkHhFhh2k7oIYFIUoQ+2nlJhL5tbqWLEBKHn0U3yxRYlAQI bl5NtyGVEcUAq+ZdTl432P1yVFQl4/WhbEtIuTF3wUHEjFp1nYeErvRI3nodJ0raiXvs GltF4iN5UbUF9vXpmHMsTzE3S+wnorsKld72Qy0KcMeofBg+iSWfYsr/mC10TOIRulnG i9WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=2C2UJNS6WnwgwTaRtJU/8pBAOObVjcFNdgI/rLA1WLs=; b=WcpBzSWYJFF7OX6MU5U2vCT8P0Gk79hLsXwWzXLeyZP7Uh+PS7YZvu/i9+UKEP7NU7 2E977H8hEAf4TOXZTZDUHi0KmOF+m6wd4BMPnv8uSznasKLVW9aYnkEgaeQiiSr+8Nfd bA2U1yWMslMdAnX9qufQFdIAvvbH85AnGR4PSEQyP2lWyDz6yfraKniDbmfFi/A7GQUl HwAzD2qglWVsnUw1AnhrgvpCQI2YQdAaW3bqSYmah2uK0w/aHFcpGd4wa9+IY6wYsmp+ utnLAM2NpKLOuwftHXFiEbKSt7ulBXoysmVP6VBkoL/062kbzaBpfqIjriDJo2e53sQp RJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EqxMONlR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9-v6si13756119pgq.172.2018.08.01.00.54.51; Wed, 01 Aug 2018 00:55:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EqxMONlR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387657AbeHAJhs (ORCPT + 99 others); Wed, 1 Aug 2018 05:37:48 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37590 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733177AbeHAJhs (ORCPT ); Wed, 1 Aug 2018 05:37:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2C2UJNS6WnwgwTaRtJU/8pBAOObVjcFNdgI/rLA1WLs=; b=EqxMONlRa2V482aibu3BKWs/F GaGmLaaJJDd3p6qRzStZL6s7HX/9nprV5+jWRFl0+Q1f6EheDixFnJDHl/O+DOkYKzMH7UY14mtdY oo5Cd+o36NK1m5QRSVW4JInjGl90mxKbw99KglkjvL5D9Kv1AG7Bs+CXQLlCFGF/Ui64sbdhXWqT1 tlZY+4D8YuQCpXwHySk3Xv4/yB5grUDk8lLZVQA/ydIFADVD1Pvu4mnOWhgA9DtIAKmmqFVQKG1ln RioGSetB9As3gl8WSf5MBl+4GWanUR4+MZ4OhWYJHstHhL9tz8zMKntpD5MQbXhk9KQw5HV/5Kg4m eV720tM6g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fklwe-0002My-6l; Wed, 01 Aug 2018 07:53:20 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B3C992027585B; Wed, 1 Aug 2018 09:53:17 +0200 (CEST) Date: Wed, 1 Aug 2018 09:53:17 +0200 From: Peter Zijlstra To: Vineet Gupta Cc: Al Viro , lkml , arcml Subject: Re: ARC show_regs() triggers preempt debug splat, lockdep Message-ID: <20180801075317.GZ2494@hirez.programming.kicks-ass.net> References: <5c3cfd4d-46d2-d817-a29a-1890d84c1fbb@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c3cfd4d-46d2-d817-a29a-1890d84c1fbb@synopsys.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 02:26:32PM -0700, Vineet Gupta wrote: > Hi Peter, Al, > > Reaching out about a problem I understand, but not quite sure how to fix it. > Its the weird feeling of how was this working all along, if at all. > > With print-fatal-signals enabled, there's CONFIG_DEBUG_PREEMPT splat all over, > even with a simple single threaded segv inducing program (console log below). This > originally came to light with a glibc test suite tst-tls3-malloc which is a > multi-threaded monster. > > ARC show_regs() is a bit more fancy as it tries to print the executable path, > faulting vma name (in case it was a shared lib etc). This involves taking a bunch > of customary locks which seems to be tripping the debug infra. Right, so I think that that is a fairly dodgy thing to do. As shown in your subsequent email, if a pagefault generates a signal we might already be holding the mmap_sem. The thing you could do is maybe use down_read_trylock() there. diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index 783b20354f8b..bb7bde11d2c8 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -92,7 +92,10 @@ static void show_faulting_vma(unsigned long address, char *buf) /* can't use print_vma_addr() yet as it doesn't check for * non-inclusive vma */ - down_read(&active_mm->mmap_sem); + if (!down_read_trylock(&active_mm->mmap_sem)) { + pr_info(" @Trylock failed\n"); + return; + } vma = find_vma(active_mm, address); /* check against the find_vma( ) behaviour which returns the next VMA