Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp510218pxa; Thu, 27 Aug 2020 08:15:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfiebD2tOvi0pnmWN1HwMBaWxXCRriSF2RPcf7FpDZZaTqQYms8R9dbGcTx4qnpbW1nD3+ X-Received: by 2002:a05:6402:3ce:: with SMTP id t14mr17649831edw.313.1598541320111; Thu, 27 Aug 2020 08:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598541320; cv=none; d=google.com; s=arc-20160816; b=i2jfNpvnmbvbhlHgIBpsJtXUWqjYyRa0qGa3q8LpE5J+vWwy+KkOMK1IF0oRR/gLD9 VuEPjrzNQSfc6eDpfCo4I+C4/u0JxKq4cDo2hkk+LvILdFEqEZ3aXi1UBH7hZYYzZNir laFjpmyBpJ7+Qdurg18IOKBeQNjkFIQUScal4Ku6WR9V8DMMDKTCZaqEAA11FzBKMxfO 1dzZkaSorlFa0fAJ0iFPBkOJeSPKBa5ajeevHioL04qs5cFZ03EiibzehDBp1uMKydV5 cLEKNinDwnZTleoff/IVTe7yrNWNFS7Te5mfVDp3WNCR58XsUz8B+6ovrNbemlAxrL12 IlKQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=Fyooa1JKyjIOPOClwLVPEO7fYkpy+R2U62wuI7bOcP4=; b=gcUmyEkOyfplw62JOyU04klNaRvS7KLGpDIQaO/GgW5gRjIztcZhCxsO3vkAMBppTn UvLbF77QNfeq/1v+SPfAEZclh/FtW4Eim0cSG/jiQZTySKX2Qy12RS3nE2feU/m+u4Z6 w+8ewqdQ8mLPF3IVuR6K4bszpqQot/bePalRPTGWNbTHaf7esbiAX33rjUhkToPG6sNP IKjHk1BcoRmyUK1aiofa8ac8aad3a9BpQpC5rn/emkPNOo05EnloPWHeG6Hq5cq+BwxR 3BvBZba4WU9cQud8/tvREKrdwFJJmNqbYYe7SXST8IH1/rplVufML9WMswIyOfezEI3M 43iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=eQf4RpNF; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si1590858eds.212.2020.08.27.08.14.56; Thu, 27 Aug 2020 08:15:20 -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=@linutronix.de header.s=2020 header.b=eQf4RpNF; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbgH0PLo (ORCPT + 99 others); Thu, 27 Aug 2020 11:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728798AbgH0LlA (ORCPT ); Thu, 27 Aug 2020 07:41:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B2DC061264 for ; Thu, 27 Aug 2020 04:40:59 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598528458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fyooa1JKyjIOPOClwLVPEO7fYkpy+R2U62wuI7bOcP4=; b=eQf4RpNFoowsBHBVaGdXvPdmXXhEHsBObl5z2g7GcL3uNm02SOs4g/be2ByGDWXvj0HwiD 1O4V+NugNr6qOnpvDH/SwrMDxLQej6tCrrBBBSiN+CmGru7xQ4mFxex0TweES5r/rGuiUY OKFzz+YkquVNBR3f1/bACHKXr0cBWM6enI1w4wr01os7A2MYHDJkwrYxB2xYQb4AoKuYNf rIs8e4uQN6KT8rOjTMVLhzVstK/gw0Jj3TCZMkaam9SmQVIxlcEL00V8cblVkC7K2sPKkI MH2/wIaaBXROOsLoPVjf6UWZAuleyCYtsOE1FWrvNXplh6RmBAE99r0A7vlCAw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598528458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fyooa1JKyjIOPOClwLVPEO7fYkpy+R2U62wuI7bOcP4=; b=BwqGaAlvjYNChER2GGWfyB5xjGmyht7aVnMopi5voEJ7XYZSl0zLRk9403M/iSPNNA+yG0 BA1MgPtkq4XzlAAQ== To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Sebastian A. Siewior" , LKML , "Ahmed S. Darwish" Subject: [PATCH v1 7/8] rbtree_latch: Use seqcount_latch_t Date: Thu, 27 Aug 2020 13:40:43 +0200 Message-Id: <20200827114044.11173-8-a.darwish@linutronix.de> In-Reply-To: <20200827114044.11173-1-a.darwish@linutronix.de> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200827114044.11173-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Latch sequence counters have unique read and write APIs, and thus seqcount_latch_t was recently introduced at seqlock.h. Use that new data type instead of plain seqcount_t. This adds the necessary type-safety and ensures that only latching-safe seqcount APIs are to be used. Signed-off-by: Ahmed S. Darwish --- include/linux/rbtree_latch.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/rbtree_latch.h b/include/linux/rbtree_latch.h index 7d012faa509a..3d1a9e716b80 100644 --- a/include/linux/rbtree_latch.h +++ b/include/linux/rbtree_latch.h @@ -42,8 +42,8 @@ struct latch_tree_node { }; struct latch_tree_root { - seqcount_t seq; - struct rb_root tree[2]; + seqcount_latch_t seq; + struct rb_root tree[2]; }; /** @@ -206,7 +206,7 @@ latch_tree_find(void *key, struct latch_tree_root *root, do { seq = raw_read_seqcount_latch(&root->seq); node = __lt_find(key, root, seq & 1, ops->comp); - } while (read_seqcount_retry(&root->seq, seq)); + } while (read_seqcount_latch_retry(&root->seq, seq)); return node; } -- 2.28.0