Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp507072ybg; Fri, 18 Oct 2019 03:14:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaieKAKIk5wa54qMJdHzVzQ0rsuFDu6e/QsD0hLHn4izeo4C7h/rNVCKMQESTQgdBBShGk X-Received: by 2002:a17:906:3385:: with SMTP id v5mr7775733eja.154.1571393644418; Fri, 18 Oct 2019 03:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571393644; cv=none; d=google.com; s=arc-20160816; b=y9U9IH9f8otkofI0Ya0j30f+I1J9ndjbQgjJQkZGzxd6r8nv0TsaAuQELaF/s24Nbb AxscLw7OHpxcWsScOSWismc5Yr6m7f0TvfPsFghLzns5uzBJXiG436Gw4GPv84UaGzER zmJJrTjCG6tvs8rTJxayzOuwgqD22aLBKm4tfhT5GA3aN9Bv6WvN1bZvZvfxX7HRzgNG 7VkGm6AhAmD0zjt1pnzCZroG5AeHN5b3gxkJdqyvhQGVK0F9/vIa/U7h3WzQYoJEHNRm ORGkq05bBu2Rr+2xvoqGszxy35tzSEBPKZlYo4Sgr9r4iWaHav9SsBlf7YacCKoukWQ4 P/Qg== 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; bh=CB9qLsgKsb2C8+4Pa5xdxWx+A9UkvlFXKVU3Kno+WKQ=; b=V+9Dvn/ujntZnyrSkUFTCo9J+id461sNZQw/La5DIXz1zG8Yyc2O3ePfyfFnmJ/BcO FIgH0ERa3Td6F2VyRpyvWYfDdLotO4l9QTh2ZcXyniBQqfry419nbUgw9I+KiuDr518S j9Vqs3LJNk1xgf8rWg1ck7gWiUQjZjH/GPMsADl4s8ViqdeDqU3TglHDTLWTFKMgz7DL /UFOp42MZarlMs1SWyXiStU6XwBQgZxe+F2DT47guW2e8h56Hs8zbh9ZXlgQi5dOqt5q EKTpq62H20yT74IStv9qa4co6lM6a28HnhtDVwGemaDDk0dWdMRKbvIo8h0UC0NC2rZQ NN7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ROM9pgBt; 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 gz11si3153516ejb.341.2019.10.18.03.13.41; Fri, 18 Oct 2019 03:14:04 -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=bombadil.20170209 header.b=ROM9pgBt; 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 S2404838AbfJQHr6 (ORCPT + 99 others); Thu, 17 Oct 2019 03:47:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52268 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387930AbfJQHr6 (ORCPT ); Thu, 17 Oct 2019 03:47:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=CB9qLsgKsb2C8+4Pa5xdxWx+A9UkvlFXKVU3Kno+WKQ=; b=ROM9pgBtdot+ZohnyfyN8rdcZ OnZ56n50MaSVgCFWyn/mfioM0Z/iPxkd+ok0AGd9nDuhgSiNNa8MyhbNtGWojGKV8O1AZPltF1rJh CZ74niaLUFK+aGgq15s4Ghuto3JTCVqhumynY8qZl88AdgJds45NcyFxwCeAJX92mZkCO1jFju0wv DskF/8TNBHofVES1ofHgClvFvy+aCvWTgQ/dtXeGROi6+719bFGOLxlJdwsbuW6Vwo5p4EojIDtlR Nq7w3d0cuSzC0vSjbfIFXPzynwwk9ig1TpN8gDSovFeOESzxG8ucveivrVVnw3Inxvn3bvlTiYPn5 JaT7idCPQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iL0VR-0008Vj-Jw; Thu, 17 Oct 2019 07:47:33 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CFD2530018A; Thu, 17 Oct 2019 09:46:34 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1CA14203BFA9E; Thu, 17 Oct 2019 09:47:30 +0200 (CEST) Date: Thu, 17 Oct 2019 09:47:30 +0200 From: Peter Zijlstra To: Marco Elver Cc: 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@linux.intel.com, David Howells , Dmitry Vyukov , "H. Peter Anvin" , Ingo Molnar , Jade Alglave , Joel Fernandes , Jonathan Corbet , Josh Poimboeuf , Luc Maranget , Mark Rutland , Nicholas Piggin , "Paul E. McKenney" , Thomas Gleixner , Will Deacon , 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 1/8] kcsan: Add Kernel Concurrency Sanitizer infrastructure Message-ID: <20191017074730.GW2328@hirez.programming.kicks-ass.net> References: <20191016083959.186860-1-elver@google.com> <20191016083959.186860-2-elver@google.com> <20191016184346.GT2328@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 16, 2019 at 09:34:05PM +0200, Marco Elver wrote: > On Wed, 16 Oct 2019 at 20:44, Peter Zijlstra wrote: > > > + /* > > > + * Disable interrupts & preemptions, to ignore races due to accesses in > > > + * threads running on the same CPU. > > > + */ > > > + local_irq_save(irq_flags); > > > + preempt_disable(); > > > > Is there a point to that preempt_disable() here? > > We want to avoid being preempted while the watchpoint is set up; > otherwise, we would report data-races for CPU-local data, which is > incorrect. Disabling IRQs already very much disables preemption. There is absolutely no point in doing preempt_disable() when the whole section already runs with IRQs disabled.