From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x30.google.com (mail-oa1-x30.google.com [IPv6:2001:4860:4864:20::30]) by sourceware.org (Postfix) with ESMTPS id 81B673858D1E for ; Thu, 1 Sep 2022 13:10:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81B673858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-11f34610d4aso20577971fac.9 for ; Thu, 01 Sep 2022 06:10:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date; bh=DYKm5VyNhN4QgcpMkLixMGjs63iz4bzcy420gJieh+M=; b=qXwWomZKjX0KwK0TvghkQP8IovItZnb7iDi+NJ2P5BJMrgfDtO+dKmCfbNCqrhBxWR eNpXMYJ0Nk/4fOS5s2pCu4WjsZrtC+3sEEV1gdDXi9hkZm4wKcNac4RGZzbp+97XSz51 FIkc+DWr93BIfhTUqfuDcMBhb6tEo9dV0tlv1qL+LVouh0k+Z6wa06xWP0loOWaRCHgy ScqK34QyaDXqewDWzPWhBcY6ejylyyCjOrzWUHtvHXvWjsp2eSfGXXzctGZiFVex3Vpd pwa/rEGvxP7k7lTQTPUCEMO4guYXOQlTYIaRSARptwAxPtDrxqEVzEYAERe6Fysc/8c8 vihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=DYKm5VyNhN4QgcpMkLixMGjs63iz4bzcy420gJieh+M=; b=ZdAaIOM8DdfMNatslF5CAd9iYPmBU0LwIrZBIP+RPcVL9bsL0NlQi8MJDDjPpW7U4e 6z0kGHt47tVkb0l9DcVDjxFycSt4nGm3pyo3Pi+yJG+4/EUncDKkFP+ln9S68D8qasa+ pJ7teFMfFEf8XkGwmHXGugcAjk+rubyTNGrMK0A7S0yQ7VR8JMJj9iCuubzjslTEjkSK gbJcSn1ysSYDeNzn3644flgoO2Vdh5945hdkhiofjRIa+OClWKCMKBIm2rCAvEXDuYvX bN9oqdL/ACKIf2R0lbRQsAXHBcFhd58PnxpTy4zHIOIohdbybru4dR2to+t8msiIdacY GcOw== X-Gm-Message-State: ACgBeo016DG7IYGxPKmnB7AY0LCzdGVeTuXDgMXA5/IFRwYTl57bzN4h cozvTRngA7akRw8VoU49UZd1qjWguMMcWA== X-Google-Smtp-Source: AA6agR6DKuD2W7yCBu3c+9bidiFEUC1B6Lp7Vg6ej+PD+NpENB7la5RD/A/6nopXrmy+0fKXc3ARaA== X-Received: by 2002:a05:6808:2194:b0:344:e71e:39f4 with SMTP id be20-20020a056808219400b00344e71e39f4mr3267059oib.31.1662037825869; Thu, 01 Sep 2022 06:10:25 -0700 (PDT) Received: from [192.168.15.31] ([187.34.212.254]) by smtp.gmail.com with ESMTPSA id r2-20020a056830134200b006370815815asm10231601otq.61.2022.09.01.06.10.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Sep 2022 06:10:25 -0700 (PDT) Message-ID: <59b9367c-08f1-4f38-7273-b5eca48be60e@linaro.org> Date: Thu, 1 Sep 2022 10:09:07 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH] elf: Use C11 like atomics on _dl_mcount Content-Language: en-US To: Wilco Dijkstra Cc: 'GNU C Library' References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 01/09/22 09:21, Wilco Dijkstra wrote: > Hi Adhemerval, > > - newfromidx = catomic_exchange_and_add (&fromidx, 1) + 1; > + newfromidx = atomic_fetch_and_acquire (&fromidx, 1) + 1; > > I don't see how that could possibly work... > > Btw is this trying to split my catomic patch into baby steps? Given these > are simple counters (not locks), you only need atomicity, so relaxed MO > is the obvious equivalent. Right, I was not trying to be clever here and acquire might be a more strict memory order. And I haven't replied yet to you atomic refactor, but I also think changing step by step is indeed better than changing all the atomic altogether. Do you think using relaxed on all atomic is suffice here?