Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1035504pxb; Thu, 4 Mar 2021 01:16:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjk0QYhjHhidL3htQlijjnjHXZu+uixiZ2ffKQxttKRFH448JZckNV2vzi6MCgh9lgZli5 X-Received: by 2002:a17:906:7389:: with SMTP id f9mr3076631ejl.423.1614849408432; Thu, 04 Mar 2021 01:16:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614849408; cv=none; d=google.com; s=arc-20160816; b=vZrDSp3uJxbEI+fWH2x0N86POByyd/WSI+2SxrHfePpFQYfjrMRMy2RWzpZGiX8IU8 2FLCSUfUVNiCmwF23db+JO3svNeeLKeF/0/adjwEBOCO9MCyja6zb9d9breMxXSFyWFj UI5e98dFUv9vBBvfc/7gSavuCvP0eAkjNrbj5vMgKaZZtdyr8eNP1YQbyTURlK3UVNe8 YIps19mVAfSijUZAUeumguYl70wcnJinq5V4vPcw2SB/8jWksCZiGROPO4l68u05G+GU wFvI+YkQm8Hp/EwX66Ns47+F6aJ9WAaZLn9qhP8+vhZxhp4XDHpWMJG67ho5piOrGfL3 +lVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=joX1wjP2CQMPMJzXxyY2kC5PGk/3iLoHVpVOa4ta6dI=; b=BbakppvPiCzeAYFVekSVi595y1agBnKWeJxsrdsdX72zL8Z00ItUV1z5TNK4ImPeLo COdSKyUJhq5FXOgDYW6VapeYgF+njPxzpptj+jaiy2bs76KrbuxlEa5E+n35ysS6eQ2Q q8TOSNQPEUKy4F3XZY2M0DvA3IBYT43TSgXHWujbuxubRIzOFAejQiNoSi9BYWY6dahT BJ1oCws8cIxHESRae/3yjQfmTgPs9oq5vfolApprFQQkjM7CmPXDgDTTaMx+vPEBT3bV WS6eO2HJvaXBrWlBpW4NS7im08tTFcMbtM7Jrxaw3oKwq8v68YHSlemHOA8xZHELN6Sz lYfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=OIMW59WH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l7si1374543ejk.27.2021.03.04.01.16.26; Thu, 04 Mar 2021 01:16:48 -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=@infradead.org header.s=casper.20170209 header.b=OIMW59WH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383476AbhCCObh (ORCPT + 99 others); Wed, 3 Mar 2021 09:31:37 -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?