Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1850472ybh; Fri, 13 Mar 2020 08:29:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvFOfsjJkLgnZYkvaW0qqNE9R1DibgyoM2jbwJn1gbjurimAeMHyjejTVUJTQjXtaudC30v X-Received: by 2002:aca:1015:: with SMTP id 21mr308628oiq.101.1584113355738; Fri, 13 Mar 2020 08:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584113355; cv=none; d=google.com; s=arc-20160816; b=cabmbIVvCVlWZtVI5vXukyfjNa/8xD0cLXDzCIoKw0lGw+ocljMlT3IXK4OVR71TNW jdtNIFvBPJKzCcOe7U4a7bcE8d5Z0knQdENEZlmZF2kK0/1/9sIi/e1t0aHSDro/G/0k d3oJy9c55h/V0Koo1e7y7SEzYh8w6knZ2u5YvY2IiroGhtUbKUk6REFYPTx5AUTwUwNU vKwdYGG6IHHECXSZLAcTWiqTQfSRGtUzXhgYz1Ly2ChFondDxEyffrfd2wRzCaCyNvif 3zzHp0xlrz2ryFJSUfMSjEH1KzT6Y3VgbYmf9RtgdPDUsRxxWEgVsGN9qDdXq9myg6nV tPPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JhUIJfLxmDw2Pu91CEiBsHmiHtKiQT2VqIQ9110wd4A=; b=m5akyWfutYjNbBSwImuQxc64g3BkHiHv47b+RXCwYh7gG3ibwL5y5fkDFHK/vsg6+a zSRi7EUt8EomFYTN930o2Y0W9zbyUiQCyBzwYcOw3tjkWaia61e+dmcUzB4ftIZWI6G+ KlfQpugFtp/YpFlQP6h/N5PPSKu6qr5b+Phi2mkFoi9Dur3VrFNv2nXIfashWh9q3Kzb xRXzw4mSoFA/sCH9wfuvwF2QQMbyXhmWN6Ds1iHwjIjWWXZE4KM30Ph5y9KOa4Rswn8u Iii9cL3EKoMMPVIcWi26sKQfdCcVsHEF3klkKG6rMeOaXRm0AA0N/pcMeFQlOh2doc1N 0z8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=t+u32kyh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a69si4396265oib.90.2020.03.13.08.29.02; Fri, 13 Mar 2020 08:29:15 -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=@google.com header.s=20161025 header.b=t+u32kyh; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726865AbgCMP2g (ORCPT + 99 others); Fri, 13 Mar 2020 11:28:36 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:33638 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726664AbgCMP2g (ORCPT ); Fri, 13 Mar 2020 11:28:36 -0400 Received: by mail-oi1-f195.google.com with SMTP id r7so9792674oij.0 for ; Fri, 13 Mar 2020 08:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=JhUIJfLxmDw2Pu91CEiBsHmiHtKiQT2VqIQ9110wd4A=; b=t+u32kyhLw+7adryUUVInMpucQxHziECi40b/B2TaT2Oh4SIWUyC4ZsgDIMJHnwq55 +VA+YrbrTrv/YeN9eoJ1jsXjNNjmqb8KUK238UoQT2NqWZCcgNB9d0tcx5FXHVJ15krP /D3ts1NUogGV8daixTF1UbUeJqRZXGVyU5XemJKqTYXiuAgkYYGRXTQy2fHJm2CkX+to TIkeZpUfOBYUMhzXKZrYbI3mUiyZ9SKzUKtZXyIJmY6PEUi7ayUlOHymkBjYxWgAKAun x+/TGGr7IZ0/VacU7K1KFV6M2XNIYPX+AABmzYn0uFxXuOGCS8YaJ+0LKQ44u2d4QC7V +RSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=JhUIJfLxmDw2Pu91CEiBsHmiHtKiQT2VqIQ9110wd4A=; b=TGJZvmOihXV3OAEjl0HTXJr7EiyD5RVXHxEFupPg1N33vLtFKnkTgX63MCQZjupDZL vyQHhaimjb6Nevw8+6RFz9Rl58W2H0qTBNagGqfTfWBw3k0NhS1HhPdmIK85FGJo1dah I2BhK6Gtrx9EM0q3jY+GY6ZNXDyq9bRjOo3f1MN8AEkMIOUFsDbbDtzXHJmSO57UzkYQ PBAU3WYtU0MkJeczC3iOX7MBm5gIXpmdQvSORlHT3evB7R6F4DaK1CI9AcTZJoujmftv fNx47VUR3oH/f9nTIwFsdGhJfn7GvE2q7oYA3qArY6NWRBMHrrYfJm9I3gIkjpV8SlK0 94pw== X-Gm-Message-State: ANhLgQ2jFxoGiWszi5Hs9m4JjK61p9REq0kgHPWDCDZduSF8gVh344BX iDfKSvtHcRkOrDKi3tMXOie9hFT51Di/11jwGmf0vA== X-Received: by 2002:aca:4cd8:: with SMTP id z207mr7211572oia.155.1584113314909; Fri, 13 Mar 2020 08:28:34 -0700 (PDT) MIME-Version: 1.0 References: <20200309190359.GA5822@paulmck-ThinkPad-P72> <20200309190420.6100-27-paulmck@kernel.org> <20200312180328.GA4772@paulmck-ThinkPad-P72> <20200312180414.GA8024@paulmck-ThinkPad-P72> In-Reply-To: <20200312180414.GA8024@paulmck-ThinkPad-P72> From: Marco Elver Date: Fri, 13 Mar 2020 16:28:23 +0100 Message-ID: Subject: Re: [PATCH kcsan 27/32] kcsan: Add option to allow watcher interruptions To: "Paul E. McKenney" Cc: LKML , kasan-dev , kernel-team@fb.com, Ingo Molnar , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Qian Cai , Boqun Feng Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Mar 2020 at 19:04, Paul E. McKenney wrote: > > On Thu, Mar 12, 2020 at 11:03:28AM -0700, Paul E. McKenney wrote: > > 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=3D1'. > > > > > > Note that, currently not all safe per-CPU access primitives and patte= rns > > > 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, b= ut > > > 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=3Dy CONFIG_KCSAN=3Dy CONFIG_KCSAN_ASSUME_P= LAIN_WRITES_ATOMIC=3Dn CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY=3Dn CONFIG_KCS= AN_REPORT_ONCE_IN_MS=3D100000 CONFIG_KCSAN_VERBOSE=3Dy CONFIG_KCSAN_INTERRU= PT_WATCHER=3Dy" --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 thr= ead > > is that these are the TREE scenarios are all PREEMPT=3Dy. So are RUDE0= 1, > > 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 commi= t, > > 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? I think I can reproduce it. Let me debug some more, so far I haven't found anything yet. What I do know is that it's related to reporting. Turning kcsan_report into a noop makes the test run to completion. > I should hasten to add that this feature was quite helpful in recent work= ! Good to know. :-) We can probably keep this patch, since the default config doesn't turn this on. But I will try to see what's up with the hangs, and hopefully find a fix. Thanks, -- Marco