Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2827C61DA4 for ; Mon, 6 Feb 2023 06:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbjBFGiZ (ORCPT ); Mon, 6 Feb 2023 01:38:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbjBFGiY (ORCPT ); Mon, 6 Feb 2023 01:38:24 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF6B18B14 for ; Sun, 5 Feb 2023 22:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=8Mzakosfx6sJtocpA0XyVM7axDuJvrpgq0eLDjBnhwQ=; b=avttX+nuTZQ4mLiwCdkJGqFbBP U8TmfdR0rntKq/iFD9GAK6/xhvC8FXEIWCqxFD98dJ6WYdVZ9H55s5b9yera7B9z55TlMcRLYgZ/o XA1nlJ7E7OQDzECSoEDpa/XzUPS72nTzCKE9jJjSdLeWBken2QZWuxPXUkV93a6KiPA4NQ+T07iaW +3QR97W2t7sJibUqURW1gu5ECNxEL+f678nwAPL646yk0n7cB+NBUFHXi61fqLwASIquym77021Db 82lapkoiBd4gS7YOz/9+RGs2WzdviIztvu53gYjNB584ocLIC56il5mmRnnyxRF9Qh2vsJAjuGAms XLzjRPaQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pOv8v-007TbV-2W; Mon, 06 Feb 2023 06:38:21 +0000 Date: Sun, 5 Feb 2023 22:38:21 -0800 From: Christoph Hellwig To: Qu Wenruo Cc: linux-btrfs@vger.kernel.org Subject: Re: [PATCH 0/2] btrfs: reduce div64 calls for __btrfs_map_block() and its variants Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Sun, Feb 05, 2023 at 04:53:40PM +0800, Qu Wenruo wrote: > Div64 is much slower than 32 bit division, and only get improved in > the most recent CPUs, that's why we have dedicated div64* helpers. I think that's a little too simple. All 64-bit CPUs can do 64-bit divisions of course. 32-bit CPUs usually can't do it inside a single instruction, and the helpers exist to avoid the libgcc calls. That should not stand against an cleanups and optimizations of course.