From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BA1BC33CB8 for ; Tue, 14 Jan 2020 19:22:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E171024672 for ; Tue, 14 Jan 2020 19:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579029759; bh=mKLOd2xmuYtb73s/4dD84EKQ2MMEkc1ge3ZF5InQbH8=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:List-ID: From; b=KaGV/zY4h6+P5Us2R9HL1QppbOVsa/f5eSJb9DXJv/GxFa04b4qnEnInTkJ7R/ON+ vk5HrN1r1z1N/hsey/4czJFogyZv54oYtdtUm2fOXdbNTwr1YWPVSCbIDAbzBsilnf nQt82M5NynBROl22tvzSkunp7dbH4A4T3O0JSLBQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728865AbgANTWW (ORCPT ); Tue, 14 Jan 2020 14:22:22 -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-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@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