Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1170591pxb; Thu, 4 Mar 2021 05:17:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9VmOiN+aiIeWgFKdCiHV3b57T2ZLW3Y9NP6x/n8o2vOYQgBPyCconjhe/9MVWX0wBQVm1 X-Received: by 2002:aa7:cdcf:: with SMTP id h15mr4281785edw.28.1614863870012; Thu, 04 Mar 2021 05:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614863870; cv=none; d=google.com; s=arc-20160816; b=z2rBFv/butHNEZLbqvIbuWa6zRWeDoYtXA/gy73vLUguyE0XjRow8w763JoIEFSkWg mLNqAn+aRZ3i/0J9FMgMdN8mH9OIXPRXVnGXfjq4ODrElx0rdpJNUd2ahfD0+oD0+Llu rtyLUT/9xMzM9mP97thR2yeBH13dtjVTkjkvuKay+u82EDlN8CKNkuhZwxWNXLMWvSZE BteIQv1HYKrXpNGRDXNqxHyBDy4HVk1DRPVu07ng8EgRQwv5FQc8GnBFcjuxBdqZhqun y2Fb68ZKfCFZzphpKYPeZEMxAPGtYWMANPRK/iu4C7POSLfY8wjyJSwVeLJAQ5aHyO3o 2dSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QkGapjMnJn9HZY59dhus3KP4cZ8f65QJ9j79aM4Jbvg=; b=POhTwN54b3dl8ky9vPXqdRt1blNckdLa6dOUvX1TqSPMqQ2WOh/Qy2IeH0+wbd7jVi qOaQPTzStkS2pit/wz33pzLlHpTKuDSuGazDZ31nioHzVPhfs5hsjfj0gbUASrbfJvjk Bb3OdQDojtkDmK31KPy0e4E14mpg2uyLzUdvlcOYWiQtREEqP5ig7Gz7JQHCMbdn1myT nv4P+ZIaE16pmeNqTgb0H6yA+iFlN82h+PcLMMViMVDJiUN8j8jeRlGMYLuWZ/RKwRAF ZTd2phkC+Hmz48OVPxpF1tEIPfYVIFCKQy83BYiuMWxCjmdc/bKMf6F5RH3Pl+2m8XAO Ge9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=swP7TwMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm7si9629773edb.188.2021.03.04.05.17.26; Thu, 04 Mar 2021 05:17:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=swP7TwMI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354304AbhCDAIA (ORCPT + 99 others); Wed, 3 Mar 2021 19:08:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390142AbhCCWCA (ORCPT ); Wed, 3 Mar 2021 17:02:00 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2663DC0613DA for ; Wed, 3 Mar 2021 14:00:30 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id r24so18850294qtt.8 for ; Wed, 03 Mar 2021 14:00:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QkGapjMnJn9HZY59dhus3KP4cZ8f65QJ9j79aM4Jbvg=; b=swP7TwMIX7+JawIKmb+GSOmqXSNSsa9kIQqihGYUHx4wMX1+vuKoztjFO8Egya9QPQ YRIs6y42qpsWYF/sUNphbRATc8U0xzP/d4Qu82zjYTVhrHkWorZp2p756RC+wCpRdJIF 0dPCPKyLFxQiJf4k7dNz1/OaLUpGVy+VKgBp6FXaZJIbSoTrMTjRTNye77OjfuXE4JL8 vofLfVRlD5pcw2DesGixAW3trZVYNL28YzeH9BJ0o7a0/LQxNNkU3i41/xmZVE+8QNsg IxvwDFAO6+gu13OE1AfJiBN2ag0rRnGgryHJoGhs5PQDcxzROhltvnfdLg6rHaFfjaa+ idmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QkGapjMnJn9HZY59dhus3KP4cZ8f65QJ9j79aM4Jbvg=; b=Z37LpXLWVh1EfSNdoDoZMcR/LsuDbK8wX/jbq2NU71LLrtjHWzWxjm1M1EgRSY4br+ 3zXWx3/G+1bVgoROgDjFjRlN5YEnhOdreezgxalTKsRaYMjR9+9TeFC9UiBcyJsbgOSS rmnRZBvSCz+XYHH/NIcFppyZ0M5YLg7WK8HbVt8VOHaX50nhvLtpTD3JDa8ijnsML9TP GbLUhMS0sHvbP3juRtaGI3UQAOY7FsZVgVS9Rey5M5lvkzUZQircYwnuIP1LFueVpKeI f18gbTHU+SPjKWWzGO1wP2E8OZ42g2ZkjXWLGN5LmZKjhKe/npI0b0HQxP/xEaAe8s5t s5oQ== X-Gm-Message-State: AOAM532vUq+sk+OVJ3MAOIrS6eRvjuoy9eQoXDIJE1tI7QKjNvw5+xWh +90JOz9evmee0gcC3qoTrCqINiOVU9DdYzN0G9oq2g== X-Received: by 2002:ac8:44ca:: with SMTP id b10mr1311799qto.293.1614808828935; Wed, 03 Mar 2021 14:00:28 -0800 (PST) MIME-Version: 1.0 References: <20210226195239.3905966-1-joshdon@google.com> In-Reply-To: From: Josh Don Date: Wed, 3 Mar 2021 14:00:18 -0800 Message-ID: Subject: Re: [PATCH] sched: Optimize __calc_delta. To: Peter Zijlstra Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-kernel , Clement Courbet , Oleg Rombakh , Nick Desaulniers , linux-toolchains@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 3, 2021 at 2:02 AM Peter Zijlstra wrote: > > On Tue, Mar 02, 2021 at 12:57:37PM -0800, Josh Don wrote: > > On gcc, the asm versions of `fls` are about the same speed as the > > builtin. On clang, the versions that use fls (fls,fls64) are more than > > twice as slow as the builtin. This is because the way the `fls` function > > is written, clang puts the value in memory: > > https://godbolt.org/z/EfMbYe. This can be fixed in a separate patch. > > Is this because clang gets the asm constraints wrong? ISTR that > happening before, surely the right thing is to fix clang? https://bugs.llvm.org/show_bug.cgi?id=49406 filed