Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5584535ybl; Tue, 14 Jan 2020 11:23:44 -0800 (PST) X-Google-Smtp-Source: APXvYqy0K0nKmNnW+6wy167ivtYTnZCE2fRghIrjXCtrw8Kaviwei8Tdt7kuUWxihynAoFmTLsRN X-Received: by 2002:a9d:24ea:: with SMTP id z97mr18407131ota.345.1579029823767; Tue, 14 Jan 2020 11:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579029823; cv=none; d=google.com; s=arc-20160816; b=fOOWLNQwJ9xWSnp6TN2yA+8/wWsekZbH0ywpaLnbUsSkcL73IonxqdDQJhDIgPK8L+ NvBDAiDXdyDVOwlxlcUBLjU9DAM8m6RYUk63IuUNN+1ScWuHK85O0ZBeNE65gMmSvA4x Y6wB2z1nBYFRSIXw/CUd9Swdk8fQOn3OnA5DgBQ4kW4UmNwPOMM95baCkmJ5v4eVqpkJ bocUNoYrBG1sKrMg3pVsw5mdgUlgEARrtkcp26tOJ1BlnJmksaYJfK56ef15yOHv3UhS MmQ9IwP80OVPmf944Yk1o8uMdG0k0xT9e+om37TC4ed13MIF5HK8OtMT91rMdv+swQnn LiEg== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=uIwYTxNVWerAZwbeNa6ISjoYovb1/y6c7j41i7QPOkg=; b=iEWPc7AL/88/avs+nqPPnDgytfi8XTpQGhyI8Jf+vjhYONWz4GbepwL9xRFIygjsDn J8mh1zaKxTVpuXE/NcB/yTOwp4TNkvVyR3+R5uZBWX5aET1ZHp2SOdYLrNWz7qx4jYAN AW9BQsrKi1vYXS6An54o5Dz3nKTm4SPKa7zf/UWprspNz7OosdQZkkvgbVfqRc6x5nlL 5fOSMb2u9YUmDMhItXS62lL+4TxY120AgrDVkxS12E+eSmZJi0WDCEpC0JKZvs/ueeh9 h7G/3puA+KymvhLJJEKeNIr4DB6vLMRIDkespujh0OCQZZeJfSm/+Wh+BZDlPbrGrX9H SAYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=117MId6F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z194si8160956oia.50.2020.01.14.11.23.32; Tue, 14 Jan 2020 11:23:43 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=117MId6F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728905AbgANTWa (ORCPT + 99 others); Tue, 14 Jan 2020 14:22:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:46278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727102AbgANTWW (ORCPT ); Tue, 14 Jan 2020 14:22:22 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9888124658; Tue, 14 Jan 2020 19:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579029740; bh=mKLOd2xmuYtb73s/4dD84EKQ2MMEkc1ge3ZF5InQbH8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=117MId6Fz76RZor5q9TDLOOoMgry1k3C0QHZUjZIdh92Cr0Y66vkwVY4G+FR6cfpv BIBczBS/bbgKByRPmw3XmuYD/Ayq9MiHEziGem3GpZoV1tAE9hrhlFPzNXPZF0Ldve dtbxedSQL5fov2WMA872xeXZ/jl8mPcSM/6v5OrA= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 3FB583522798; Tue, 14 Jan 2020 11:22:20 -0800 (PST) Date: Tue, 14 Jan 2020 11:22:20 -0800 From: "Paul E. McKenney" To: Qian Cai Cc: Marco Elver , LKMM Maintainers -- Akira Yokosawa , Alan Stern , Alexander Potapenko , Andrea Parri , Andrey Konovalov , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Boqun Feng , Borislav Petkov , Daniel Axtens , Daniel Lustig , Dave Hansen , David Howells , Dmitry Vyukov , "H. Peter Anvin" , Ingo Molnar , Jade Alglave , Joel Fernandes , Jonathan Corbet , Josh Poimboeuf , Luc Maranget , Mark Rutland , Nicholas Piggin , Peter Zijlstra , Thomas Gleixner , Will Deacon , Eric Dumazet , kasan-dev , linux-arch , "open list:DOCUMENTATION" , linux-efi@vger.kernel.org, Linux Kbuild mailing list , LKML , Linux Memory Management List , the arch/x86 maintainers Subject: Re: [PATCH v4 01/10] kcsan: Add Kernel Concurrency Sanitizer infrastructure Message-ID: <20200114192220.GS2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <53F6B915-AC53-41BB-BF32-33732515B3A0@lca.pw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53F6B915-AC53-41BB-BF32-33732515B3A0@lca.pw> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 06:08:29AM -0500, Qian Cai wrote: > > > > On Jan 6, 2020, at 7:47 AM, Marco Elver wrote: > > > > Thanks, I'll look into KCSAN + lockdep compatibility. It's probably > > missing some KCSAN_SANITIZE := n in some Makefile. > > Can I have a update on fixing this? It looks like more of a problem that kcsan_setup_watchpoint() will disable IRQs and then dive into the page allocator where it would complain because it might sleep. > > BTW, I saw Paul sent a pull request for 5.6 but it is ugly to have everybody could trigger a deadlock (sleep function called in atomic context) like this during boot once this hits the mainline not to mention about only recently it is possible to test this feature (thanks to warning ratelimit) with the existing debugging options because it was unable to boot due to the brokenness with debug_pagealloc as mentioned in this thread, so this does sounds like it needs more soak time for the mainline to me. Just so I understand... Does this problem happen even in CONFIG_KCSAN=n kernels? I have been running extensive CONFIG_KSCAN=y rcutorture tests for quite awhile now, so even if this only happens for CONFIG_KSCAN=y, it is not like it affects everyone. Yes, it should be fixed, and Marco does have a patch on the way. Thanx, Paul > 0000000000000400 > [ 13.416814][ T1] Call Trace: > [ 13.416814][ T1] lock_is_held_type+0x66/0x160 > [ 13.416814][ T1] ___might_sleep+0xc1/0x1d0 > [ 13.416814][ T1] __might_sleep+0x5b/0xa0 > [ 13.416814][ T1] slab_pre_alloc_hook+0x7b/0xa0 > [ 13.416814][ T1] __kmalloc_node+0x60/0x300 > [ 13.416814 T1] ? alloc_cpumask_var_node+0x44/0x70 > [ 13.416814][ T1] ? topology_phys_to_logical_die+0x7e/0x180 > [ 13.416814][ T1] alloc_cpumask_var_node+0x44/0x70 > [ 13.416814][ T1] zalloc_cpumask_var+0x2a/0x40 > [ 13.416814][ T1] native_smp_prepare_cpus+0x246/0x425 > [ 13.416814][ T1] kernel_init_freeable+0x1b8/0x496 > [ 13.416814][ T1] ? rest_init+0x381/0x381 > [ 13.416814][ T1] kernel_init+0x18/0x17f > [ 13.416814][ T1] ? rest_init+0x381/0x381 > [ 13.416814][ T1] ret_from_fork+0x3a/0x50 > [ 13.416814][ T1] irq event stamp: 910 > [ 13.416814][ T1] hardirqs last enabled at (909): [] _raw_write_unlock_irqrestore+0x53/0x57 > [ 13.416814][ T1] hardirqs last disabled at (910): [] kcsan_setup_watchpoint+0x96/0x460 > [ 13.416814][ T1] softirqs last enabled at (0): [] copy_process+0x11fa/0x34f0 > [ 13.416814][ T1] softirqs last disabled at (0): [<0000000000000000>] 0x0 > [ 13.416814][ T1] ---[ end trace 7d1df66da055aa92 ]--- > [ 13.416814][ T1] possible reason: unannotated irqs-on. > [ 13.416814][ent stamp: 910 > [ 13.416814][ T1] hardirqs last enabled at (909): [] _raw_write_unlock_irqrestore+0x53/0x57 > [ 13.416814][ T1] hardirqs last disabled at (910): [] kcsan_setup_watchpoint+0x96/0x460 > [ 13.416814][ T1] softirqs last enabled at (0): [] copy_process+0x11fa/0x34f0 > [ 13.416814][ T1] softirqs last disabled at (0): [<0000000000000000>] 0x0