From patchwork Tue Jun 29 15:35:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1498432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GDpTs6np3z9sRN for ; Wed, 30 Jun 2021 01:36:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1478960823; Tue, 29 Jun 2021 15:36:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qR25D0TaFGRu; Tue, 29 Jun 2021 15:35:59 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5F92A607EA; Tue, 29 Jun 2021 15:35:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 31A01C001A; Tue, 29 Jun 2021 15:35:58 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1DD7CC000E for ; Tue, 29 Jun 2021 15:35:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0A4DF607EA for ; Tue, 29 Jun 2021 15:35:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SJANMs_4LG82 for ; Tue, 29 Jun 2021 15:35:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp3.osuosl.org (Postfix) with ESMTPS id 54FA46077E for ; Tue, 29 Jun 2021 15:35:56 +0000 (UTC) Received: (Authenticated sender: blp@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6ADE36000A; Tue, 29 Jun 2021 15:35:52 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Tue, 29 Jun 2021 08:35:49 -0700 Message-Id: <20210629153549.3313887-1-blp@ovn.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] ovs-rcu: Remove unneeded mutex from struct ovsrcu_perthread. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" It was not really used. Signed-off-by: Ben Pfaff Reported-by: 贺鹏 --- lib/ovs-rcu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c index cde1e925ba94..1866bd308822 100644 --- a/lib/ovs-rcu.c +++ b/lib/ovs-rcu.c @@ -47,7 +47,6 @@ struct ovsrcu_cbset { struct ovsrcu_perthread { struct ovs_list list_node; /* In global list. */ - struct ovs_mutex mutex; uint64_t seqno; struct ovsrcu_cbset *cbset; char name[16]; /* This thread's name. */ @@ -84,7 +83,6 @@ ovsrcu_perthread_get(void) const char *name = get_subprogram_name(); perthread = xmalloc(sizeof *perthread); - ovs_mutex_init(&perthread->mutex); perthread->seqno = seq_read(global_seqno); perthread->cbset = NULL; ovs_strlcpy(perthread->name, name[0] ? name : "main", @@ -406,7 +404,6 @@ ovsrcu_unregister__(struct ovsrcu_perthread *perthread) ovs_list_remove(&perthread->list_node); ovs_mutex_unlock(&ovsrcu_threads_mutex); - ovs_mutex_destroy(&perthread->mutex); free(perthread); seq_change(global_seqno);