From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78648A04FF; Thu, 31 Mar 2022 13:44:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09FD4428E2; Thu, 31 Mar 2022 13:44:47 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150044.outbound.protection.outlook.com [40.107.15.44]) by mails.dpdk.org (Postfix) with ESMTP id 63D30410FA for ; Thu, 31 Mar 2022 13:44:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XSANkEr5U5DSrBjQuMup+ALaJLbWb3lHv1I3Wv/SWPY=; b=06323lRXQqXLkfdu2rKM8FIXRd+U8WLuXDTgcqM4bbwf4s6qntvP58yI6dbwWeZCM1CHPhJU4vZ8TPnJ9Kippk7piUyvFdTqYhYNEKqEx0rv+DpbHodBbRrhxYqf7WM0Jx2dhag7AWxpJH6iHXrpRES+zloFAbFcDX2ASCToFl4= Received: from AS9PR0301CA0023.eurprd03.prod.outlook.com (2603:10a6:20b:468::28) by PR3PR08MB5866.eurprd08.prod.outlook.com (2603:10a6:102:85::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.16; Thu, 31 Mar 2022 11:44:28 +0000 Received: from VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:468:cafe::4b) by AS9PR0301CA0023.outlook.office365.com (2603:10a6:20b:468::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.22 via Frontend Transport; Thu, 31 Mar 2022 11:44:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT055.mail.protection.outlook.com (10.152.19.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.19 via Frontend Transport; Thu, 31 Mar 2022 11:44:27 +0000 Received: ("Tessian outbound ab7864ef57f2:v118"); Thu, 31 Mar 2022 11:44:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d71c402c65414edd X-CR-MTA-TID: 64aa7808 Received: from 3e831008473f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 693AB690-8976-403C-AF40-3768546B3C4A.1; Thu, 31 Mar 2022 11:44:26 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3e831008473f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 31 Mar 2022 11:44:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZyCPclSQ436RkuX4nEdlpUX0ajHRjkebHv84MFVPDIahq7fCqnOpSH1TWv8JxSqk8kbpK7C+F+jg6I7ETH/m/Soj5+pLNbre653kWrXtMkWkZ2YAKTvpABpY0X7uHUnPu+ZIwAyIfjCCP6JwfK0ipEWpvw5f/BipoA90M87eYof2p3Oz+pkahb6/WqnKeIGvBRMamOuzrR3SwvXp9nC8gikGwF+HP/iI/mC32O6LM3PM3aZHq4C5pL5bNC/03/ObvO8/WP9oDXvNSrmEYnw6fbf8gnldDbkITaJrE+G/5NlRmtCp1J7yJ+a5GRA0ojrHeV7VC0CImAUm4mQNxj+zrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XSANkEr5U5DSrBjQuMup+ALaJLbWb3lHv1I3Wv/SWPY=; b=N/mXXVZFl8VbTESYOonbptafdtcFunN7G3yWYSjcZ9ToHlx41Z2whdoMMfkARbF/qELubAAZxFWcn2hiwCiO66bbvZt/JXERsQD4QhWy99FglgEW4geRH0iKtNZY93sHASUU+v75q2WBSqmgW/1L9yKkcypGqXgNDg2iUsXNzdyFmABUIcEm9RKGtueuhBJZQ3GbwM8sGp+C7eX0nX0Qm+Aq3PxzU141azy8/XPkY9d2ls3UbW1L+h/hXr4UcvEFL9jJ35ibPgwHl+d5R+lcnYHuqrTVCRGnLi19avFROtNvfy0Sg8rCa+awoYDz9MIqr33gX3muERCTx0r47rmtiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XSANkEr5U5DSrBjQuMup+ALaJLbWb3lHv1I3Wv/SWPY=; b=06323lRXQqXLkfdu2rKM8FIXRd+U8WLuXDTgcqM4bbwf4s6qntvP58yI6dbwWeZCM1CHPhJU4vZ8TPnJ9Kippk7piUyvFdTqYhYNEKqEx0rv+DpbHodBbRrhxYqf7WM0Jx2dhag7AWxpJH6iHXrpRES+zloFAbFcDX2ASCToFl4= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM8PR08MB6498.eurprd08.prod.outlook.com (2603:10a6:20b:364::11) by AM0PR08MB3684.eurprd08.prod.outlook.com (2603:10a6:208:106::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.19; Thu, 31 Mar 2022 11:44:13 +0000 Received: from AM8PR08MB6498.eurprd08.prod.outlook.com ([fe80::ec4f:1ad:e332:9f39]) by AM8PR08MB6498.eurprd08.prod.outlook.com ([fe80::ec4f:1ad:e332:9f39%5]) with mapi id 15.20.5123.019; Thu, 31 Mar 2022 11:44:12 +0000 Message-ID: Date: Thu, 31 Mar 2022 13:44:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2] eal: add seqlock Content-Language: en-US To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , dev@dpdk.org Cc: Thomas Monjalon , David Marchand , Onar Olsen , Honnappa.Nagarahalli@arm.com, nd@arm.com, konstantin.ananyev@intel.com, stephen@networkplumber.org References: <98CBD80474FA8B44BF855DF32C47DC35D86F84@smartserver.smartshare.dk> <20220330142602.108061-1-mattias.ronnblom@ericsson.com> <3888e595-de18-3cf0-707b-309b153c2b02@ericsson.com> <37d60d0f-9911-7692-cdb6-62cd5da540ac@arm.com> <98CBD80474FA8B44BF855DF32C47DC35D86F8D@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D86F8E@smartserver.smartshare.dk> From: Ola Liljedahl In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D86F8E@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0077.namprd04.prod.outlook.com (2603:10b6:806:121::22) To AM8PR08MB6498.eurprd08.prod.outlook.com (2603:10a6:20b:364::11) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b7f9668d-bdbe-47be-f70a-08da130bcfe4 X-MS-TrafficTypeDiagnostic: AM0PR08MB3684:EE_|VE1EUR03FT055:EE_|PR3PR08MB5866:EE_ X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9Sa9nw0wN1MSuiqT4tyBiEvceUA0muTkvTcINA8m52bV1piv8LbwSkGn1//2wXiaAn+S9zbeiV/BnWqVCydIRuH3UqDAfdNhUalhQB+saozetjhvAqOIgWs4QAGEqLfA1b41/bj399g9Y+kdyAyYxXzEw67E2pJgz9gpI+Z4dfz9yzWM6XyxuC7w2hdCEdWLO5pAFcs2i6eY2rmC/1n+k11fAuLS+l5kLv3N4CEIYW0XRn/JS8I3c00jLZrbrfUTRsV0m/u4VovcRsrxgjBJOM3noEWKOAbLaPZMfyimMb0p4MWOAti/vBpsQ+ubSchz2pqwJQggmQZhSgW3xw0YRDaGFZvs74m4b9wTYNHMq0esu9p4pJd8OBnWwAva6GByCzBW9C0ePXu3sXqC/W7sBR7ruEN9rjeAvh+BdABIb1v6SCNP1asaXMINYK0gmU7pcLGBxBiaYIA7CnI5dTfg1lLMJxcrTRARZKZaAxOMDGMUzM0w3dEhMlTKtstQBzrZ9YVEgQg9VN8KTGhPbTmLtXzqF2aNskXgbrLeBCugewL0S61ldFLnyR7gGXmcvzV2e12+zys5b5mtKlU0u6IM2fFkb1VvDYG4ClVn1nxmjv/CC70DFYEyusCTfDtcf2oCXLc/tx9lp/85xWx2NmXDIzjUAcKsAPnDvTJKQVahcZeUHlTPInITEWCD14pvJGKG5uOdKSPEfr1RHkg2NdJveXYEsmmiL2lE/gzOnJgEV+g= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR08MB6498.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(83380400001)(26005)(6506007)(2906002)(6512007)(186003)(31696002)(86362001)(38100700002)(2616005)(8936002)(44832011)(54906003)(66946007)(36756003)(508600001)(5660300002)(4744005)(31686004)(4326008)(66556008)(66476007)(8676002)(6486002)(316002)(6666004)(110136005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3684 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 71c5d2c4-0d79-44a1-541e-08da130bc639 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C9uH81XgKxRCdxMDCkeUm7hvXIe0EgqPexi4H+fcqjsrnpvn+QDVdL4wMH6vjlA6whXnsRmtH3H9nczP+VY7hXFVS6onVSKTNByHI1K0POl6wJg6j1nqu9xLepNTrQq52E2wUYQhdtCdL9MuRfusS9QJ7HdUyKufumTgXlnbothXfGje+f0LkMR5wvK+gY21Ldhq3O0tk8hz/KkWG2L5v6LPn7qDEFu9ziNVxH8La7cU04SxSwk/bZbaxqo2a25nWn7t5FlLo5kj3WVLCK8qnczS8GvWUaWOea/HLU8hiARInOXNM1hJBkmMBRD5H6aEPaLH7UyRsWSY48uxq0HXNz6Gmv9IKBp6dIVW/AAkpldlpHbVMNjKKM2X1O7BjgsiRh+lfvucfmDlR+P+hUdMH4oPri2V6TyMvrC7zYXTFrVBNiw1QGhY/fSueNNi6KDdeQgJYcH22I9JWGKyFmVBVP31HBQBOJR8Fjr7Dk71E3nPxTbFRG8I7U4f/Pdt2sCVnuW05gGTnVzg95WJ3rEpgJ4ae0jKyCCdQa29nPUSDYy2heau7kJWMRRb1DBaFgIf38gzPn+Oo4kkStJRMjbRfpplblOYXyD5c6QN03uv5UjKgwpf2vG+/YN9JJFqZW31z2z2G+5ZPG/3Oxi5XTQJMvr2Rw4emrgQAOSYdUKIf66JQCGcYp83PfC1GcmZlXfxtdAet1GJidFL3lIaeZc88A== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(31686004)(70586007)(8676002)(70206006)(4326008)(316002)(83380400001)(8936002)(110136005)(508600001)(5660300002)(44832011)(54906003)(40460700003)(4744005)(6486002)(356005)(6506007)(6666004)(6512007)(2616005)(82310400004)(36860700001)(2906002)(47076005)(81166007)(36756003)(107886003)(26005)(186003)(336012)(31696002)(86362001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2022 11:44:27.8770 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7f9668d-bdbe-47be-f70a-08da130bcfe4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5866 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org >>> I think lock()/unlock() should be avoided in the read operation >>> names, because no lock is taken during read. I like the critical region >>> begin()/end() names. >> I was following the naming convention of rte_rwlock. Isn't the seqlock >> just a more scalable implementation of a reader/writer lock? > > I see your point. However, no lock is taken, so using lock()/unlock() is somewhat misleading. Conceptually, a reader lock is acquired and should be released. Now there wouldn't be any negative effects of skipping the unlock operation but then you wouldn't know if the data was properly read so you would have to ignore any read data as well. Why even call rte_seqlock_read_lock() in such a situation? In the only meaningful case, the lock is acquired, the protected data is read and the lock is released. The only difference compared to a more vanilla lock implementation is that the release operation may fail and the operation must restart. - Ola