From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2f.google.com (mail-oa1-x2f.google.com [IPv6:2001:4860:4864:20::2f]) by sourceware.org (Postfix) with ESMTPS id 1F924385841E for ; Mon, 24 Apr 2023 21:10:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F924385841E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-187b70ab997so27042684fac.0 for ; Mon, 24 Apr 2023 14:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682370609; x=1684962609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hJIOf9DsH6pGLdjU1hdSRcxaZf6Z+e6gbK9bFQwzvvE=; b=kGaNpf82kYxyDBmvwo86YiqN3tKfRJxCR1mkmpSIPDnF/wqQMgkIE/+cKyjILzIqJt Un+86Yw7brxDLnE+dj2fFoo9osB61YGEO5hGUjt8AWYd45DYkFqE6ckoYux8DIwm/IaX 4eYhkn0OKq/KHlNXOzXh2MoNZyDBD3HFe3VbcbnOgGm1+n3Cn0RK5u0k/9vSYoPEPs2I vfyN8l3tLwgoCSpANhL0y8oadn2slXIwib+NJpT0lJo8iCdRXuYf7epLOwkolcmmdtlF MNd0YP6A94OeoPQTgOvGNEmYA4jlJVrCu9nWUrnrUbLxM7Z2+5gSTn8uybzuaafPnFpD cMHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682370609; x=1684962609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hJIOf9DsH6pGLdjU1hdSRcxaZf6Z+e6gbK9bFQwzvvE=; b=GFVQOcnEBNLqzeqE9Zv0GrJVt9koT21WoJY2mISMhccbuPO/C39e6yorEU6lL5dNkv pu3o6mpKwaroAkE8cCO7BG7/wwTnPhFybQ/icChAYDNfY5KhONwEpFIZzoOAHb92gOp2 J2sXjvTpbs5RFYbJiSpsnCjXmKD9/yS2RZN0qxCR7UAxkJBvtJY4dyXEMgv/IFCpVO/i +F3qFp8UxiemOaf4UAy6EK5aFyPdyjHLTSWxTI89ic9fWGn40r9MHsRffFmYI5WDzbaT uaQwdSZNLAxxXTUNGKQjIQxd7HKGidRQgKlldGIYJbhXeLjFuzwkUGzXSvnwBwhKhqPx 3O8w== X-Gm-Message-State: AAQBX9ds13QP1UmQFdENq8dPZteCu0Gl/EKW/IOjel7QLfETIsvh0wPg 1rpfgprv1amN7EapqydD/aqVlCkmHJopGQyOGRnOFnFyLlC1PA== X-Google-Smtp-Source: AKy350b8ZgK4aG7etUiY8jTzBBUtLBEbQynZLWnmp5B8HxkLaDeV8hGkgfRVKb01Aqpl9x/0ZBFjbmntOgUgs8eQ34I= X-Received: by 2002:aca:a9c2:0:b0:38e:32b5:cfba with SMTP id s185-20020acaa9c2000000b0038e32b5cfbamr11405375oie.10.1682370609066; Mon, 24 Apr 2023 14:10:09 -0700 (PDT) MIME-Version: 1.0 References: <20230423215526.346009-1-bugaevc@gmail.com> <20230423215526.346009-3-bugaevc@gmail.com> <20230424204644.omudvkhihy3nzj7m@begin> In-Reply-To: <20230424204644.omudvkhihy3nzj7m@begin> From: Sergey Bugaev Date: Tue, 25 Apr 2023 00:09:58 +0300 Message-ID: Subject: Re: [PATCH 3/4] hurd: Microoptimize mmap () To: Samuel Thibault Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, Apr 24, 2023 at 11:47=E2=80=AFPM Samuel Thibault wrote: > Is it really worth making the code a bit obscure? No, not really. What happened here was I looked at what my mask computation compiled to, to verify it does the right thing on both x86_64 and i686, and then I saw how the error branches are compiled, and next thing you know there are new __glibc_unlikely's in my tree :) What I should rather look into is marking __hurd_fail and friends with __attribute__((cold)); that would take care of all the error branches everywhere automatically without having to mark things up. But I did a quick grep and found nothing using __attribute__((cold)) yet, so I don't know what the right way of using it would be (and maybe it's not being used intentionally?). I'm thinking it should probably go into misc/sys/cdefs.h as __COLD (or __attribute_cold?). Something like this: #if __glibc_has_attribute (cold) #define __COLD __attribute__ ((cold)) #else #define __COLD #endif What do you think? Sergey