Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp937776imn; Tue, 26 Jul 2022 13:36:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sknYIobvor3SR3VemcWiBFzektVudTl/zJUzeFN5guMEpY0kPDQ6W0SxEsVVTmWf5L/XCc X-Received: by 2002:a17:907:9485:b0:72f:97d9:9799 with SMTP id dm5-20020a170907948500b0072f97d99799mr15464872ejc.328.1658867775895; Tue, 26 Jul 2022 13:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658867775; cv=none; d=google.com; s=arc-20160816; b=LplU3iC8cq2s3eqn7NmazkKzidD+Hs6F4+THk1FoIq2xmiECCFfUMaG2TAddC6zhLQ 6/+BL/SBcy2tD2d+u7Ic0hr9olkHWi2kUlDpmBJR/rtDppSzhZNBFQaXmKpUXG4t0yON /DZQWQsaJmyPaLhQ4w/L7p3T5LI9VhL8sX/z8Q9GFRRa49HK9NW1WEjkNktTbj/wgUjz EQ7Dz6qGJ6R72ui2lzi6cbd8h+PXUDRiOc7aNr7pD6sPMD6rvWdmO+hnKhnFLUndatPw rkbOIETZeKe8+pLj0pc6u8UlHgQ2GnmkhDd2/F80gXCO4gto7yt2t6TpLoIlIRbDtdDP 8c4g== 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=4CN7dQvXWwaJGy07n6QHMuaIcTWf0n/HGar+msGxrYk=; b=FShaNEzv694pa81t3fnQwZCzX0ZTVy/AShFyoZ72qkZSs6RLkdOL92PzeYQwjso1EL Vadvv56lGjIWRFRelWyoNlZWn8kzUxoMJBXp+BXTNxpGoqDAVVWjQc0y9/ed7Q5DAYmJ eAONtQPNyDY1+weFXEGiT+VPJ7juk/oWoBw1tepc56Z1e7+6BoC9Vx4oG0X1cL2Frjud 1qrYMFH7+TItlcKjHdledMGp2T3YNZV3EGK6ffRqrxwBBeQxEDzCshlZ0kFmbVWm5ib2 1nxetiCIrhObRZXoo93fw2OsPyau8LbeWCGLATz2GBvOzQz4B6b9EFfJ0HM8U0/mRkqR wPlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=FGJZe+Zw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv18-20020a17090760d200b0072f5fa16193si18566772ejc.254.2022.07.26.13.35.51; Tue, 26 Jul 2022 13:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=FGJZe+Zw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239904AbiGZUUp (ORCPT + 99 others); Tue, 26 Jul 2022 16:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239838AbiGZUUn (ORCPT ); Tue, 26 Jul 2022 16:20:43 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B30727B1C for ; Tue, 26 Jul 2022 13:20:42 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id fy29so28021141ejc.12 for ; Tue, 26 Jul 2022 13:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4CN7dQvXWwaJGy07n6QHMuaIcTWf0n/HGar+msGxrYk=; b=FGJZe+ZwP3lgA0wU4CgENEV4uAjTArTRwFrNXA7DgfkgNXGLMfVrAiFenpM+aZxYi3 oCzqZUMRn0IH1rFc2iDgLG+UKKXNBuUxdaPOqpCCmVa594FKN8Q6xS3xQ5n1poatxD3g x1xRQ4sgvnKIpYMJNA1ZY6TFctKZX6hDMIklw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4CN7dQvXWwaJGy07n6QHMuaIcTWf0n/HGar+msGxrYk=; b=2bxDFnligYhkWxsFkTH5KzgdXIE5CofBo0PEd8k5N5wsrlRAI/+d0+5SKJwj8C7l33 HMRi6MPsK+WXOH1nnCL8e0n+uHyQyo2LEY+6P5wHjsGV7qZ3jF96UTmp/HIHipc+sR1E X24M2sC4qV9DO+Z4WkWaAJkF+z+RMO+Hc9D8CBGZBOR54+2sGT3yhA+5+WGZ/DlnP/jQ S8EG8ytfs01+95ZBZbMe7KGStE1wjFc7OcxmqE/sCS5fGaD/Kp3WtuqVeKiaRQ2ao/8e uoowxM+2Z4UTV4s60AsSxYBxqzcSuuK2D1sXbKrYRlFRLwJXBAwBo52gs9EA9qQAnWxF fhFQ== X-Gm-Message-State: AJIora8iFQ3cbuUseU4HweLvzL68VRHwkcHrVDAFzOIKa4dvCVrNRNbr i+fNFuYb6UrJWq1krhJLzDoVLtjAMqM7LAwt X-Received: by 2002:a17:906:58d1:b0:72e:e049:cf00 with SMTP id e17-20020a17090658d100b0072ee049cf00mr14862884ejs.361.1658866840285; Tue, 26 Jul 2022 13:20:40 -0700 (PDT) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com. [209.85.221.41]) by smtp.gmail.com with ESMTPSA id y10-20020a056402358a00b0043a8f5ad272sm9189027edc.49.2022.07.26.13.20.39 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Jul 2022 13:20:39 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id v13so13846293wru.12 for ; Tue, 26 Jul 2022 13:20:39 -0700 (PDT) X-Received: by 2002:a05:6000:1a88:b0:21d:aa97:cb16 with SMTP id f8-20020a0560001a8800b0021daa97cb16mr12127299wry.97.1658866839283; Tue, 26 Jul 2022 13:20:39 -0700 (PDT) MIME-Version: 1.0 References: <20220725161141.GA1306881@roeck-us.net> In-Reply-To: From: Linus Torvalds Date: Tue, 26 Jul 2022 13:20:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux 5.19-rc8 To: "Russell King (Oracle)" Cc: Yury Norov , Dennis Zhou , Guenter Roeck , Catalin Marinas , Linux Kernel Mailing List , Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 26, 2022 at 12:44 PM Russell King (Oracle) wrote: > > Overall, I would say it's pretty similar (some generic perform > marginally better, some native perform marginally better) with the > exception of find_first_bit() being much better with the generic > implementation, but find_next_zero_bit() being noticably worse. The generic _find_first_bit() code is actually sane and simple. It loops over words until it finds a non-zero one, and then does trivial calculations on that last word. That explains why the generic code does so much better than your byte-wise asm. In contrast, the generic _find_next_bit() I find almost offensively silly - which in turn explains why your byte-wide asm does better. I think the generic _find_next_bit() should actually do what the m68k find_next_bit code does: handle the first special word itself, and then just call find_first_bit() on the rest of it. And it should *not* try to handle the dynamic "bswap and/or bit sense invert" thing at all. That should be just four different (trivial) cases for the first word. Linus