Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp785949ybh; Thu, 12 Mar 2020 11:06:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3biiJuMk3uXUVPzMM7DFXkPdsBPQUxclPEcLz2RtQSBKV5FMojO8QjNISQJVHkn0ed9cF X-Received: by 2002:aca:2104:: with SMTP id 4mr3669368oiz.127.1584036370639; Thu, 12 Mar 2020 11:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584036370; cv=none; d=google.com; s=arc-20160816; b=w/kX8kpwFVKh5JKfDdW0ilslkNg8oCSEWWaEqItG/NiwEBKNJS3DTeLgy0LA5cR8/q cwdCurnIzlrroNRa8kTnChWr88ubWiRYWVuZhAN6foVQ9PpAO4qBh5nBapylLsPluusr PfMe1b7ZG7RTwtUVz6HW5XYaBms5rrtfa+fFjQGwST4Mpf8jlTC9TYntGiPGDYDmTZTd VDb8zQ0i11aw3sBbv8e6I1jC7rtKaBqRRIwTef77Fcjfg2WCi6zGH3Ny+xA8EKqjgLne IFIRTHrPos3gXAG6M3+c+MiyMXKA5S3c17t8n9CDFk/t3jTYiVO/if4jWYoclmt/lq+p 8OKA== 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=SrNiB2O+fvN7g09NnS890RCqAZRKkOTWljkaXxNtXQU=; b=F49XPVMwKmFEENcVWC3JEYpVE60zGpK7LYNJemqVg9xrN78PamBTkcmGF7592Dszlm fGuwDZz1gd9tCk4IMMoVLe8QFoR12fxT44LCRuZRq2u/K2HTsFoJHMoZpkZsURqE3cn8 fS5ovFXJntze+5fUxuV+Eu7tAcjoFa+veVYy3ngQDM5m2Twm6by1tJuUBCs436P8uDz4 vfx0aKx/zeKpLDsCj9NHjog9806xLHjBZ0EwhP1Td/aEokDUL3bFrV1iUEnLl3K5DDnM JO3z+smEKVVpGjWi48nUY3X8aqGSk56J9rWtd2/61vzXJZ7UFg0dfOx26lMxhIG0y6kT i1Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fihPR0qN; 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 g206si2938491oib.17.2020.03.12.11.05.51; Thu, 12 Mar 2020 11:06:10 -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=pass header.i=@kernel.org header.s=default header.b=fihPR0qN; 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 S1726620AbgCLSD3 (ORCPT + 99 others); Thu, 12 Mar 2020 14:03:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:49544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgCLSD3 (ORCPT ); Thu, 12 Mar 2020 14:03:29 -0400 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 8DCC620663; Thu, 12 Mar 2020 18:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584036208; bh=w5OJz1765mdFH4/Uo4Yx+dMsFICrfjR1unWrEPeY9ro=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=fihPR0qNPve9gBwdyknFivzRqYTRZmUL1oZTZtBerw1K2z6xhzA1yql3cZ/p2hjwq Kw42S+fHWFkwtHxBUfdhwDEIEvrmU1dvsQewTiZXLsF/YqOhRlrWt+3na1X2bbLaLo 4/kE1+957TaOxMbFLY4w+kJLR3gRJP0O3TkaVh+M= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 5980835226D0; Thu, 12 Mar 2020 11:03:28 -0700 (PDT) Date: Thu, 12 Mar 2020 11:03:28 -0700 From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, kernel-team@fb.com, mingo@kernel.org Cc: elver@google.com, andreyknvl@google.com, glider@google.com, dvyukov@google.com, cai@lca.pw, boqun.feng@gmail.com Subject: Re: [PATCH kcsan 27/32] kcsan: Add option to allow watcher interruptions Message-ID: <20200312180328.GA4772@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200309190359.GA5822@paulmck-ThinkPad-P72> <20200309190420.6100-27-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200309190420.6100-27-paulmck@kernel.org> 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 Mon, Mar 09, 2020 at 12:04:15PM -0700, paulmck@kernel.org wrote: > From: Marco Elver > > Add option to allow interrupts while a watchpoint is set up. This can be > enabled either via CONFIG_KCSAN_INTERRUPT_WATCHER or via the boot > parameter 'kcsan.interrupt_watcher=1'. > > Note that, currently not all safe per-CPU access primitives and patterns > are accounted for, which could result in false positives. For example, > asm-generic/percpu.h uses plain operations, which by default are > instrumented. On interrupts and subsequent accesses to the same > variable, KCSAN would currently report a data race with this option. > > Therefore, this option should currently remain disabled by default, but > may be enabled for specific test scenarios. > > To avoid new warnings, changes all uses of smp_processor_id() to use the > raw version (as already done in kcsan_found_watchpoint()). The exact SMP > processor id is for informational purposes in the report, and > correctness is not affected. > > Signed-off-by: Marco Elver > Signed-off-by: Paul E. McKenney And I get silent hangs that bisect to this patch when running the following rcutorture command, run in the kernel source tree on a 12-hardware-thread laptop: bash tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 12 --duration 10 --kconfig "CONFIG_DEBUG_INFO=y CONFIG_KCSAN=y CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC=n CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=n CONFIG_KCSAN_REPORT_ONCE_IN_MS=100000 CONFIG_KCSAN_VERBOSE=y CONFIG_KCSAN_INTERRUPT_WATCHER=y" --configs TREE03 It works fine on some (but not all) of the other rcutorture test scenarios. It fails on TREE01, TREE02, TREE03, TREE09. The common thread is that these are the TREE scenarios are all PREEMPT=y. So are RUDE01, SRCU-P, TASKS01, and TASKS03, but these scenarios are not hammering on Tree RCU, and thus have far less interrupt activity and the like. Given that it is an interrupt-related feature being added by this commit, this seems like expected (mis)behavior. Can you reproduce this? If not, are there any diagnostics I can add to my testing? Or a diagnostic patch I could apply? Thanx, Paul