Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4273818pxj; Wed, 12 May 2021 01:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziLb3ZFGSq3MaXicg9ljYZMm0kMe+Nrj96Dkj915kmlUG3MsdPnL+5XPTQru6Vry6v9vFB X-Received: by 2002:a92:d086:: with SMTP id h6mr2591595ilh.273.1620809159635; Wed, 12 May 2021 01:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620809159; cv=none; d=google.com; s=arc-20160816; b=PHnehpFdSeFmCCQCkUgZwResv0SlBonhPA8JBOKWVhi3nw8EJJ2HB0Z5sZHKwvKYpr wvBGmY1/uBFGft0oOcAXLfrX7L3nz5pQgpciKVd9kRVnHiu6KwWOrkvPG7rbKjf7Xsw0 riHsHjdMcczD4uZJV7US3gUKKpKR3HvOTiUkfrJ8uQeUydPiMNRWl1P9vTM2sztahVV0 s1qghPXZ8BukzICaHWQN0q9smKxhmqR0udj8cc5AcAb7N8juaelBO69/vMVL+mf9LBlp rbmdYx8aVXE2V29Vlsp1APMY5f/4BrxPif0+xYVT9DJ/pSTM6MYyVrdPefiWk8jhjic/ V8QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6myQBMYr+lV/pUSbf6VMLnG+VJOyuR3gQfNwK3mhNjA=; b=Wr9MzNBHTpxUV/oyBrb2uUoKMWNEyQpLVybhNs57jbxQW9+pQp57yorlrv69ot/Nwa A6GbVygsuvbVxkpCnu8qEjCzRBSS2s0tD1gX7UMQAjDIrpnSuCBQg6s/DKqWagl2mbYx SRpygoJjqSIW4JzF8aYZ7mgYNnfEbVcG5NJvUiEkP4Ri+UJqes0d+Gl4Um7wG0fJYO6P rUQl3otamQ6cYXtB639/Dz2F4DEmQwCygYQ1n+z3zaSWxsRaMLz1zPZna0TRJkQGmQYa joGN+yjciADoHJlgqM4VOaqJAOp5yXOqn45sNmMXrA1yJEOcPH7DhV0mLsnoEOgJvFi2 6aLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="ABuHr/AK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si18469044ill.156.2021.05.12.01.45.47; Wed, 12 May 2021 01:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="ABuHr/AK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbhELIqK (ORCPT + 99 others); Wed, 12 May 2021 04:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbhELIqJ (ORCPT ); Wed, 12 May 2021 04:46:09 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7573C061574 for ; Wed, 12 May 2021 01:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=6myQBMYr+lV/pUSbf6VMLnG+VJOyuR3gQfNwK3mhNjA=; b=ABuHr/AK5DK/jQkP5+fbPmE04W t/npqePoFzVnpCLW6DC0hTDVvuIj8g4VKAnrTyy/yIY7AbD/0YDk5BLqtTj7QmzuqERLcK7WGmGZa QF1MRsHL/x7+1/4u7AHhPSUrlfnUy/2BlLQGpwuhXBv3ebyDWAxhSPxzw2b6/bfHkmbn48u5vS7s8 Du+YGnwwiL58KSqUj30TZ00uFuUYdIPaoDa2/KA/0NCXdHwTM5Bqji0MrCWiWqEmrt2/XMW1OJyli XRgyzs7hOEhvCxvltBXcyDGB2xDdidFizuT+/oX1pp5pGEdJtxYEGiNnkm03kGwXFssSmLkHBVSgc xybavnhg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lgkUA-002LvO-W1; Wed, 12 May 2021 08:44:55 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1DBE7300242; Wed, 12 May 2021 10:44:53 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BFD0020829FA3; Wed, 12 May 2021 10:44:53 +0200 (CEST) Date: Wed, 12 May 2021 10:44:53 +0200 From: Peter Zijlstra To: Davidlohr Bueso Cc: a.darwish@linutronix.de, bigeasy@linutronix.de, tglx@linutronix.de, shung-hsi.yu@suse.com, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH v2] seqlock,lockdep: Only check for preemption_disabled in non-rt Message-ID: References: <20210507233951.78950-1-dave@stgolabs.net> <20210507234713.86097-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210507234713.86097-1-dave@stgolabs.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2021 at 04:47:13PM -0700, Davidlohr Bueso wrote: > This silences the writer hitting this nonsensical warning on PREEMPT_RT. > > Reported-by: Shung-Hsi Yu > Signed-off-by: Davidlohr Bueso > --- > > v2: Resending because I had left out some small comments I had meant to add. > > include/linux/seqlock.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h > index f61e34fbaaea..2ce3e1efc9a9 100644 > --- a/include/linux/seqlock.h > +++ b/include/linux/seqlock.h > @@ -268,7 +268,9 @@ static inline bool __seqprop_preemptible(const seqcount_t *s) > > static inline void __seqprop_assert(const seqcount_t *s) > { > +#ifndef CONFIG_PREEMPT_RT > lockdep_assert_preemption_disabled(); > +#endif > } > > #define __SEQ_RT IS_ENABLED(CONFIG_PREEMPT_RT) > @@ -529,6 +531,8 @@ static inline void do_write_seqcount_begin_nested(seqcount_t *s, int subclass) > * only if the seqcount write serialization lock is associated, and > * preemptible. If readers can be invoked from hardirq or softirq > * context, interrupts or bottom halves must be respectively disabled. > + * The PREEMPT_RT case relies on the reader serializing via LOCK+UNLOCK, > + * so the context is preemptible. > */ I'm confused, and the Changelog is useless. The code you actually changed is for seqcount_t, which doesn't have an associated LOCK. If there is a lock, the code should be changed to use the appropriate seqcount_LOCKNAME_t and the assertion will change into the one found in __seqprop_##lockname##_assert(), namely: lockdep_assert_held(lockmember) But as is, seqcount_t usage relies on being non-preemptible, even for PREEMPT_RT, and this is a good thing. Please describe the site that goes boom and explain things..