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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 705D8C77B75 for ; Tue, 9 May 2023 08:13:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234679AbjEIIN2 (ORCPT ); Tue, 9 May 2023 04:13:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjEIIN0 (ORCPT ); Tue, 9 May 2023 04:13:26 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FDDC19F; Tue, 9 May 2023 01:13:23 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683620001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xVv4rfLO7xw6sqAWJDUtooVryD59aLxpHrjjHESoCv4=; b=UYr2e1+gFJj75hLTU6wulu/To8fs/3NLSTT1O/4A/dFoPk1Mwvn+4on1C/mSGDw9X/b3/G mIrECPfYYeTbNUw3RoQIQUfrX5mnUofAMMxQNDUqI/AFoku3cF86gPwsybPzPHVKburTU2 zIr0TgMHNijQocNFUxjJnyzNJxEtcDTEmpbWlG997sTpM54qRhns7zh+pzonEy1oTjzFW3 14DPxxumcT1F8fbLdgqmUfKwr1kDGuB7WZ/9BKC89wkrCBiBsaJdRO/mqxk7qcZj7+AStQ AZ4wyuPb6bKPM7xPxIBgHHgQsRIzp0+N70d65avjQFf8REYtlxwaUJECG0mXag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683620001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xVv4rfLO7xw6sqAWJDUtooVryD59aLxpHrjjHESoCv4=; b=9wiCNSXeePGKC5dkLze/Mvp1SnJ8hPA6OqZF+Gp+ghyrguRljiC5BokrInr2EL8X9l+0Yk ytnJfUjVGEIWI7CA== To: Peter Zijlstra , bigeasy@linutronix.de Cc: mark.rutland@arm.com, maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, chenhuacai@kernel.org, kernel@xen0n.name, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, pbonzini@redhat.com, wanpengli@tencent.com, vkuznets@redhat.com, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, jgross@suse.com, boris.ostrovsky@oracle.com, daniel.lezcano@linaro.org, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, rafael@kernel.org, peterz@infradead.org, longman@redhat.com, boqun.feng@gmail.com, pmladek@suse.com, senozhatsky@chromium.org, rostedt@goodmis.org, john.ogness@linutronix.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, jstultz@google.com, sboyd@kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [RFC][PATCH 1/9] seqlock/latch: Provide raw_read_seqcount_latch_retry() In-Reply-To: <20230508213147.448097252@infradead.org> References: <20230508211951.901961964@infradead.org> <20230508213147.448097252@infradead.org> Date: Tue, 09 May 2023 10:13:20 +0200 Message-ID: <871qjp3otb.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, May 08 2023 at 23:19, Peter Zijlstra wrote: > The read side of seqcount_latch consists of: > > do { > seq = raw_read_seqcount_latch(&latch->seq); > ... > } while (read_seqcount_latch_retry(&latch->seq, seq)); > > which is asymmetric in the raw_ department, and sure enough, > read_seqcount_latch_retry() includes (explicit) instrumentation where > raw_read_seqcount_latch() does not. > > This inconsistency becomes a problem when trying to use it from > noinstr code. As such, fix it by renaming and re-implementing > raw_read_seqcount_latch_retry() without the instrumentation. > > Specifically the instrumentation in question is kcsan_atomic_next(0) > in do___read_seqcount_retry(). Loosing this annotation is not a > problem because raw_read_seqcount_latch() does not pass through > kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX). > > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner