From patchwork Mon Aug 26 23:00:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Tu X-Patchwork-Id: 1153498 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L0tP+nSI"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46HSDK0f3gz9s00 for ; Tue, 27 Aug 2019 09:01:20 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 3FE59EA7; Mon, 26 Aug 2019 23:01:18 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id F0921EA2 for ; Mon, 26 Aug 2019 23:01:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id ABD9189B for ; Mon, 26 Aug 2019 23:01:16 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id w2so12772313pfi.3 for ; Mon, 26 Aug 2019 16:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=SaegBALqjX8jZfsMPUYiaRxWiHFGMmt/frSoI1OVXWM=; b=L0tP+nSIQqYqgGepQioPpP0/7RmKYW68b+HcY//JB2K8QC+UgSOo6uVTtwDXd//z4W KMN+newton0pjXkWKmRkE0LqyqWet11uzP/o+zivAJ5glc4tOXJ+LhMwAHbSiPGqtEPx AlMXAzirWZYclDD6iVXAJLZaK3FIa59xzrTC/M6w4NQjwwsRqbRZvp+kWIcluz9nZ2vw NMBDfaIDxZL8gceaMn9oGh/G69oOtEezjlGw+Rju0Z1KVyUuayqoF92XdpLjP5bL83o2 sMvRiN4OEhxk+WQRejZiZ+HsAnDSzLFJxXObRgkNqtvjYZCjDOE1WsyP1lGdwj6mlX6Q JEXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=SaegBALqjX8jZfsMPUYiaRxWiHFGMmt/frSoI1OVXWM=; b=F/b6OafPGZ4m13wGX0897ubWgkW71ZJQZE+6T7jeLxREL/baVh7JjgY08YT8OTzB9a fIbpAVs2s4/nuVVFQ/cX9/HvqY2r2gLTAwEPSXBt89fUDSt08cHAJ/PfjUDperarAHom U+olh4Ya6yTJA7VhYyitZqS+ze2rZFYcsZROraOSrly+8Lhy8cFcIJipLHSZT6T14Yxl Wrf3cCQszCbjR+gzci0KNSv8gauarOeBgtCKxHn5Z086V2qRRAcdZn9LN6ssg5ScuPyw nc0X1Lt1qSc/2GedLxYW8WIMoxcAL21lrZx32+sgipVB7Kfy+eSbXPPFZXEjsi+x2bDZ M0UA== X-Gm-Message-State: APjAAAWUtr6NglHQ46qt6+Vh4aMvP7CFaj7jbUIv64gDiu9EvGJXuiKZ F9Psm5XNYNsQtxr/uL7ReunMFIiu5v8= X-Google-Smtp-Source: APXvYqzD9Wctc8FPPoMP3onOqB9GP0rRXEh7qjJbFueTxBW8G8Ehj+6vwxUiQdop2DdYo6cim89ZMQ== X-Received: by 2002:aa7:9907:: with SMTP id z7mr22019303pff.13.1566860475993; Mon, 26 Aug 2019 16:01:15 -0700 (PDT) Received: from sc9-mailhost3.vmware.com ([66.170.99.95]) by smtp.gmail.com with ESMTPSA id b24sm12453398pgw.66.2019.08.26.16.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Aug 2019 16:01:15 -0700 (PDT) From: William Tu To: dev@openvswitch.org Date: Mon, 26 Aug 2019 16:00:31 -0700 Message-Id: <1566860431-12795-1-git-send-email-u9012063@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 1/2] ovs-thread: Make struct spin lock cache aligned. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Make the spin lock struct 64-byte aligned to avoid false sharing issue. Signed-off-by: William Tu --- include/openvswitch/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openvswitch/thread.h b/include/openvswitch/thread.h index acc822904847..5053cb3091c3 100644 --- a/include/openvswitch/thread.h +++ b/include/openvswitch/thread.h @@ -34,7 +34,7 @@ struct OVS_LOCKABLE ovs_mutex { }; #ifdef HAVE_PTHREAD_SPIN_LOCK -struct OVS_LOCKABLE ovs_spin { +OVS_ALIGNED_STRUCT(64, OVS_LOCKABLE ovs_spin) { pthread_spinlock_t lock; const char *where; /* NULL if and only if uninitialized. */ };