From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 dcvr.yhbt.net (Postfix) with ESMTPS id 5DD3B1F601 for ; Fri, 2 Dec 2022 18:56:11 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Pq1xaxmY"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 543633858C1F for ; Fri, 2 Dec 2022 18:56:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 543633858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670007370; bh=b0LCFmvhAerxwDwXDUThO2xkZTLPurseAPXD860hCSE=; h=To:Cc:Subject:In-Reply-To:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Pq1xaxmYK/zbtWtq8N7sORT9aYDTxxsJMC5GUfUjmwcB8tQTFgRnD7kViRyZXFbzo gK9QNVtww1+1NKIiixu0FOoJ/lsn70CvXRskqb9rFapmI2ENmLalCkyP9D2o+YnpTo Vp85L+U3hbrnvC6waTob/BPxboTn77XidtoDHcfk= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 9A12F3858C36 for ; Fri, 2 Dec 2022 18:55:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A12F3858C36 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-296-V6MYw3SaPkSr3jeGghPQKw-1; Fri, 02 Dec 2022 13:55:48 -0500 X-MC-Unique: V6MYw3SaPkSr3jeGghPQKw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 13A7185A59D; Fri, 2 Dec 2022 18:55:48 +0000 (UTC) Received: from greed.delorie.com (unknown [10.22.8.183]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0059B1401C39; Fri, 2 Dec 2022 18:55:47 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 2B2ItbD81106706; Fri, 2 Dec 2022 13:55:37 -0500 To: Florian Weimer Cc: Wilco.Dijkstra@arm.com, libc-alpha@sourceware.org Subject: Re: [PATCH] malloc: Use correct C11 atomics for fastbin In-Reply-To: <87sfhytir0.fsf@oldenburg.str.redhat.com> Date: Fri, 02 Dec 2022 13:55:37 -0500 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: DJ Delorie via Libc-alpha Reply-To: DJ Delorie Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" Florian Weimer writes: >> Wilco Dijkstra via Libc-alpha writes: >>> +/* Atomically pop from the fastbin list. The arena lock must be held to >>> + block other threads removing entries, avoiding the ABA issue. */ >> >> If the arena lock must be held anyway, why go through the compare and >> exchange overhead? We know we're the only thread accessing it. > > Other threads are adding entries without the arena lock. Ah. That should be in the comment then.