From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE81FC43331 for ; Wed, 3 Mar 2021 14:33:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6C4364EE4 for ; Wed, 3 Mar 2021 14:33:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383486AbhCCObk (ORCPT ); Wed, 3 Mar 2021 09:31:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1842980AbhCCKXS (ORCPT ); Wed, 3 Mar 2021 05:23:18 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DF82C08ECB9; Wed, 3 Mar 2021 02:02:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=joX1wjP2CQMPMJzXxyY2kC5PGk/3iLoHVpVOa4ta6dI=; b=OIMW59WHZMU5hqAhrqRewu3zoW umMHO3nHJ3aRZKhoUpG0zleSF38/zF8a9Z/IP9fGoBW/RynTvn/Vd4vpJ+gkLsNgIHCdPeEjc1qI+ IL56dJqp0Z4g3NsIHkNVUVl1H2idraDTAN/wDEH4/HDaRonvU6oMlugG6iuNhltzmzTVwg6YhAOuT pGCGAEgFuTYhKuhUGcbgyME0Gh0zzOZjAaOptZxpzFDZGm2kj7RRgVpB65lB0oV+Vr8ICe98HJjzQ +FyOyO2EJ3ODOY4pnUgHNe1WH3NUxQ+YGShbWBkQ7dkOvSUGJwYo59Q4f1gdXw13rlyMBST5PKwUu GMdT3prg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lHOKs-0027A0-68; Wed, 03 Mar 2021 10:02:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8A5583017B7; Wed, 3 Mar 2021 11:02:29 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6C80F20CC061A; Wed, 3 Mar 2021 11:02:29 +0100 (CET) Date: Wed, 3 Mar 2021 11:02:29 +0100 From: Peter Zijlstra To: Josh Don 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 Subject: Re: [PATCH] sched: Optimize __calc_delta. Message-ID: References: <20210226195239.3905966-1-joshdon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?