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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 92994C433DF for ; Mon, 1 Jun 2020 07:22:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D0D9206C3 for ; Mon, 1 Jun 2020 07:22:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qy+GRsFw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbgFAHWO (ORCPT ); Mon, 1 Jun 2020 03:22:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725935AbgFAHWN (ORCPT ); Mon, 1 Jun 2020 03:22:13 -0400 Received: from mail-vs1-xe42.google.com (mail-vs1-xe42.google.com [IPv6:2607:f8b0:4864:20::e42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A38A0C061A0E; Mon, 1 Jun 2020 00:22:13 -0700 (PDT) Received: by mail-vs1-xe42.google.com with SMTP id o2so2163836vsr.0; Mon, 01 Jun 2020 00:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=Qy+GRsFwP59gROSPpwcSk+d4BmBdCEdjxVcnG89ETwVbaChC3CZGqNCjYA5q3zZEXV ftJjSX22++JyxqShjPrcs60ExBRV9rkg0po2DVvCYUGUQ+/Lln9ssEhgcKVqibq5h1QD 3GcB+VR5pmjymE7fc4kCi6UuBXGedcxGeKYY0JahfpNnaRtzua+jlXVyuPKz5eq95nyx FH5rsmTOlXiADyitE7Yo9XplyqzAHQ1AspJB0cypzPPGDXANPkzbpULgcPelQMQlpYkn q2rtZDeeH2pm1YHT1QiK+n+u+A7jM83OUkEtSD+uInIdVHUsPiVFys6kxdjnMNKzkX37 ++ig== 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=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=ek40dg9u6PY9p5yDFRjTOxpa6vDqCZFAN+FfzvCrm0BqPTd8VLD5yuw0tshuQgRzXL Z9Zws+lkEhm7OSHbOH1YyDg5gyzfmRRPOQ2d7Ijqb1fVekg6cdgo49j2aic5hGA+62zV YQOyIBm/HEPfJnbvnjCptoCEkZovXN7hWirJ9cwG5kJGOXeafaIhXuJy7dttDnThPQIJ OroiIQta9PqAexB/3Tsu1215a63tRdEdyInhO8GikbPLxN7hONQkHtTqXWOgkk9Ww1KW BCvvayr0MDm8B0lQpy20gRC7IDoUYEh6nFEqhvPxkH1aUcBOqaimPE2XStSxibQ3r2Y1 Dekw== X-Gm-Message-State: AOAM532eokaXmWqinM7c1K+1NwdseA2DRieP8YIj9LuyocXpOsMz8XyP Bmsx0ia+CepbDFkTqEKhKPn0mz5O04BjZnP1gxc= X-Google-Smtp-Source: ABdhPJzIA1FGKrVz+9UgvnCvE4qHbM8WwKnt0yzT0Ej9MwEf3XXL3bZ9GG5bYf4/kar44nR6s2ZBVVKbKsVOWbpBIWw= X-Received: by 2002:a05:6102:a17:: with SMTP id t23mr9115865vsa.62.1590996132886; Mon, 01 Jun 2020 00:22:12 -0700 (PDT) MIME-Version: 1.0 References: <20200529141100.37519-1-pilgrimtao@gmail.com> In-Reply-To: From: Tao pilgrim Date: Mon, 1 Jun 2020 15:22:01 +0800 Message-ID: Subject: Re: [PATCH v2] blkdev: Replace blksize_bits() with ilog2() To: Jens Axboe Cc: hch@lst.de, sth@linux.ibm.com, viro@zeniv.linux.org.uk, clm@fb.com, jaegeuk@kernel.org, hch@infradead.org, Mark Fasheh , dhowells@redhat.com, balbi@kernel.org, damien.lemoal@wdc.com, bvanassche@acm.org, ming.lei@redhat.com, martin.petersen@oracle.com, satyat@google.com, chaitanya.kulkarni@wdc.com, houtao1@huawei.com, asml.silence@gmail.com, ajay.joshi@wdc.com, linux-kernel@vger.kernel.org, Muchun Song , hoeppner@linux.ibm.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, linux-s390@vger.kernel.org, sagi@grimberg.me, linux-nvme@lists.infradead.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Josef Bacik , dsterba@suse.com, linux-btrfs@vger.kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, ocfs2-devel@oss.oracle.com, deepa.kernel@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Fri, May 29, 2020 at 10:13 PM Jens Axboe wrote: > > On 5/29/20 8:11 AM, Kaitao Cheng wrote: > > There is a function named ilog2() exist which can replace blksize. > > The generated code will be shorter and more efficient on some > > architecture, such as arm64. And ilog2() can be optimized according > > to different architecture. > > When you posted this last time, I said: > > "I like the simplification, but do you have any results to back up > that claim? Is the generated code shorter? Runs faster?" > Hi Jens Axboe: I did a test on ARM64. unsigned int ckt_blksize(int size) { return blksize_bits(size); } unsigned int ckt_ilog2(int size) { return ilog2(size); } When I compiled it into assembly code, I got the following result, 0000000000000088 : 88: 2a0003e8 mov w8, w0 8c: 321d03e0 orr w0, wzr, #0x8 90: 11000400 add w0, w0, #0x1 94: 7108051f cmp w8, #0x201 98: 53017d08 lsr w8, w8, #1 9c: 54ffffa8 b.hi 90 a0: d65f03c0 ret a4: d503201f nop 00000000000000a8 : a8: 320013e8 orr w8, wzr, #0x1f ac: 5ac01009 clz w9, w0 b0: 4b090108 sub w8, w8, w9 b4: 7100001f cmp w0, #0x0 b8: 5a9f1100 csinv w0, w8, wzr, ne bc: d65f03c0 ret The generated code of ilog2 is shorter , and runs faster > which you handily ignored, yet sending out a new version. I'm not > going to apply this without justification, your commit message is > handwavy at best. > Do I need to write the test content into commit message? -- Yours, Kaitao Cheng 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=-0.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0D903C433DF for ; Mon, 1 Jun 2020 15:03:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB95C2065C for ; Mon, 1 Jun 2020 15:03:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SkmoNIhb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qy+GRsFw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB95C2065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+feRdzvXh4SkdNTrdOknkSgksR76eZnQFdtBgoAyuyI=; b=SkmoNIhbu2aaul /YlmBb2d2xoxcrNq6fMQxOqUy/wXRPqFCCWkqJCq06wj7A04B1Bx3jQW30mHVxkraloO1ouEu9PKy BszKZG9c2yQpOJi9E3rJ4rDM9iqxqGLxdryPUbQgme0ZMFsCNz7ZmrJjZyWwBsZNWC3ynd2KTaUoP mh7dum+kbfguvn5aXNkOTAzf8tMmm3o18BavUqZWoP2hNU4ayRZKoqfeUZikY8IjY9UYmBg9vjJdU NIOqYrHC/LS177bASB23j18d0AcUS8NLKV68cCqYI8+e4Cuc9ks0U6+BafAotvzfcGCGcuruhuT+x EcAXnNWdCjVvoZk5kgiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jflxo-0003g9-92; Mon, 01 Jun 2020 15:02:56 +0000 Received: from mail-vs1-xe41.google.com ([2607:f8b0:4864:20::e41]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jfem4-0007wJ-UO for linux-nvme@lists.infradead.org; Mon, 01 Jun 2020 07:22:22 +0000 Received: by mail-vs1-xe41.google.com with SMTP id r10so5029971vsa.12 for ; Mon, 01 Jun 2020 00:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=Qy+GRsFwP59gROSPpwcSk+d4BmBdCEdjxVcnG89ETwVbaChC3CZGqNCjYA5q3zZEXV ftJjSX22++JyxqShjPrcs60ExBRV9rkg0po2DVvCYUGUQ+/Lln9ssEhgcKVqibq5h1QD 3GcB+VR5pmjymE7fc4kCi6UuBXGedcxGeKYY0JahfpNnaRtzua+jlXVyuPKz5eq95nyx FH5rsmTOlXiADyitE7Yo9XplyqzAHQ1AspJB0cypzPPGDXANPkzbpULgcPelQMQlpYkn q2rtZDeeH2pm1YHT1QiK+n+u+A7jM83OUkEtSD+uInIdVHUsPiVFys6kxdjnMNKzkX37 ++ig== 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=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=XJplLTcImmnhKOZTeWfWV1HDrnIUce212UcjSom3D+zUCQsWlTmNlNhNFcOGMbkGYu o/8U77pO7P5xSSRggtI9og2TZsLLrlJ623vbuaKo2r98EOdbIHqdMqQR2XL+nx8/jjeX BdbUIXDetodMw0CxtWNid6UtZy3AAJo3ExKjDajHKbLvVoojtu6JV9YgasCvYhXj8lbi +IAud27Sm7UcuX5DiNm5mdUbyxas/WVMu5WG60fYdAu4zRsv44daTvhrrpTmYypUELYD PZtqaWNKfjrRdzAFdIr+bNkLQUtUZGecsHFA1TDrCn/XkuWECF6gACVAP7gmcmBT/hHs AETg== X-Gm-Message-State: AOAM533ih7ZQPcRfbZZVwwJLjLgUqxQqG6xP+X6oVH9H2aINSVRB0xq4 fh9YZC4F+1gbLpQRWr1E4VeWwth7JE5YFRUDcpI= X-Google-Smtp-Source: ABdhPJzIA1FGKrVz+9UgvnCvE4qHbM8WwKnt0yzT0Ej9MwEf3XXL3bZ9GG5bYf4/kar44nR6s2ZBVVKbKsVOWbpBIWw= X-Received: by 2002:a05:6102:a17:: with SMTP id t23mr9115865vsa.62.1590996132886; Mon, 01 Jun 2020 00:22:12 -0700 (PDT) MIME-Version: 1.0 References: <20200529141100.37519-1-pilgrimtao@gmail.com> In-Reply-To: From: Tao pilgrim Date: Mon, 1 Jun 2020 15:22:01 +0800 Message-ID: Subject: Re: [PATCH v2] blkdev: Replace blksize_bits() with ilog2() To: Jens Axboe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200601_002220_980435_AAFD1761 X-CRM114-Status: GOOD ( 13.49 ) X-Mailman-Approved-At: Mon, 01 Jun 2020 08:02:54 -0700 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hoeppner@linux.ibm.com, heiko.carstens@de.ibm.com, linux-nvme@lists.infradead.org, dhowells@redhat.com, clm@fb.com, deepa.kernel@gmail.com, houtao1@huawei.com, hch@lst.de, linux-s390@vger.kernel.org, bvanassche@acm.org, darrick.wong@oracle.com, Mark Fasheh , satyat@google.com, hch@infradead.org, borntraeger@de.ibm.com, gor@linux.ibm.com, ajay.joshi@wdc.com, chaitanya.kulkarni@wdc.com, chao@kernel.org, Josef Bacik , ming.lei@redhat.com, viro@zeniv.linux.org.uk, Muchun Song , dsterba@suse.com, jaegeuk@kernel.org, jlbec@evilplan.org, sagi@grimberg.me, balbi@kernel.org, damien.lemoal@wdc.com, martin.petersen@oracle.com, joseph.qi@linux.alibaba.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, asml.silence@gmail.com, linux-btrfs@vger.kernel.org, sth@linux.ibm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Fri, May 29, 2020 at 10:13 PM Jens Axboe wrote: > > On 5/29/20 8:11 AM, Kaitao Cheng wrote: > > There is a function named ilog2() exist which can replace blksize. > > The generated code will be shorter and more efficient on some > > architecture, such as arm64. And ilog2() can be optimized according > > to different architecture. > > When you posted this last time, I said: > > "I like the simplification, but do you have any results to back up > that claim? Is the generated code shorter? Runs faster?" > Hi Jens Axboe: I did a test on ARM64. unsigned int ckt_blksize(int size) { return blksize_bits(size); } unsigned int ckt_ilog2(int size) { return ilog2(size); } When I compiled it into assembly code, I got the following result, 0000000000000088 : 88: 2a0003e8 mov w8, w0 8c: 321d03e0 orr w0, wzr, #0x8 90: 11000400 add w0, w0, #0x1 94: 7108051f cmp w8, #0x201 98: 53017d08 lsr w8, w8, #1 9c: 54ffffa8 b.hi 90 a0: d65f03c0 ret a4: d503201f nop 00000000000000a8 : a8: 320013e8 orr w8, wzr, #0x1f ac: 5ac01009 clz w9, w0 b0: 4b090108 sub w8, w8, w9 b4: 7100001f cmp w0, #0x0 b8: 5a9f1100 csinv w0, w8, wzr, ne bc: d65f03c0 ret The generated code of ilog2 is shorter , and runs faster > which you handily ignored, yet sending out a new version. I'm not > going to apply this without justification, your commit message is > handwavy at best. > Do I need to write the test content into commit message? -- Yours, Kaitao Cheng _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tao pilgrim Date: Mon, 1 Jun 2020 15:22:01 +0800 Subject: [Ocfs2-devel] [PATCH v2] blkdev: Replace blksize_bits() with ilog2() In-Reply-To: References: <20200529141100.37519-1-pilgrimtao@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jens Axboe Cc: hch@lst.de, sth@linux.ibm.com, viro@zeniv.linux.org.uk, clm@fb.com, jaegeuk@kernel.org, hch@infradead.org, Mark Fasheh , dhowells@redhat.com, balbi@kernel.org, damien.lemoal@wdc.com, bvanassche@acm.org, ming.lei@redhat.com, martin.petersen@oracle.com, satyat@google.com, chaitanya.kulkarni@wdc.com, houtao1@huawei.com, asml.silence@gmail.com, ajay.joshi@wdc.com, linux-kernel@vger.kernel.org, Muchun Song , hoeppner@linux.ibm.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, linux-s390@vger.kernel.org, sagi@grimberg.me, linux-nvme@lists.infradead.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Josef Bacik , dsterba@suse.com, linux-btrfs@vger.kernel.org, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, darrick.wong@oracle.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, ocfs2-devel@oss.oracle.com, deepa.kernel@gmail.com On Fri, May 29, 2020 at 10:13 PM Jens Axboe wrote: > > On 5/29/20 8:11 AM, Kaitao Cheng wrote: > > There is a function named ilog2() exist which can replace blksize. > > The generated code will be shorter and more efficient on some > > architecture, such as arm64. And ilog2() can be optimized according > > to different architecture. > > When you posted this last time, I said: > > "I like the simplification, but do you have any results to back up > that claim? Is the generated code shorter? Runs faster?" > Hi Jens Axboe: I did a test on ARM64. unsigned int ckt_blksize(int size) { return blksize_bits(size); } unsigned int ckt_ilog2(int size) { return ilog2(size); } When I compiled it into assembly code, I got the following result, 0000000000000088 : 88: 2a0003e8 mov w8, w0 8c: 321d03e0 orr w0, wzr, #0x8 90: 11000400 add w0, w0, #0x1 94: 7108051f cmp w8, #0x201 98: 53017d08 lsr w8, w8, #1 9c: 54ffffa8 b.hi 90 a0: d65f03c0 ret a4: d503201f nop 00000000000000a8 : a8: 320013e8 orr w8, wzr, #0x1f ac: 5ac01009 clz w9, w0 b0: 4b090108 sub w8, w8, w9 b4: 7100001f cmp w0, #0x0 b8: 5a9f1100 csinv w0, w8, wzr, ne bc: d65f03c0 ret The generated code of ilog2 is shorter , and runs faster > which you handily ignored, yet sending out a new version. I'm not > going to apply this without justification, your commit message is > handwavy at best. > Do I need to write the test content into commit message? -- Yours, Kaitao Cheng 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=-0.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 A638DC433E0 for ; Mon, 1 Jun 2020 07:22:22 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7707E206C3 for ; Mon, 1 Jun 2020 07:22:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="hzVD3bgJ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="Rcc6HS3J"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qy+GRsFw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7707E206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jfem5-00030A-P5; Mon, 01 Jun 2020 07:22:21 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfem4-0002zy-0G for linux-f2fs-devel@lists.sourceforge.net; Mon, 01 Jun 2020 07:22:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=hzVD3bgJ/huz5H3IpyrLNd6Nnl QijTHd/AQBbC/plSlkhZJd86wvW+K2MPBdM12/cvReR7WQApvHimCPU6xPCtG7Od5PxkJhwOyVcCv vm+tpV5aqwHrL1F9X2kLo/+C7gigpFprBoaJCM4uccXZoevprtlRegvVv2NiJ6HCZO6o=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=Rcc6HS3J5otyeI6cCpdB85MqKL iZy4Jb0yBvjWGNwteuXFkMX4LMuOf8Brqgsin5QOszhecRyOG0LKkDtURo8iufUG9fYGzR2DqVywI GAWk5LHXwwWP/IuUOzUJsSTEqPDNczX3Ef8tHlQr/l6N6RWl1OD8racm+GTJhpMH81hk=; Received: from mail-vs1-f65.google.com ([209.85.217.65]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1jfem2-003DVL-Kv for linux-f2fs-devel@lists.sourceforge.net; Mon, 01 Jun 2020 07:22:19 +0000 Received: by mail-vs1-f65.google.com with SMTP id u7so5059196vsp.7 for ; Mon, 01 Jun 2020 00:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=Qy+GRsFwP59gROSPpwcSk+d4BmBdCEdjxVcnG89ETwVbaChC3CZGqNCjYA5q3zZEXV ftJjSX22++JyxqShjPrcs60ExBRV9rkg0po2DVvCYUGUQ+/Lln9ssEhgcKVqibq5h1QD 3GcB+VR5pmjymE7fc4kCi6UuBXGedcxGeKYY0JahfpNnaRtzua+jlXVyuPKz5eq95nyx FH5rsmTOlXiADyitE7Yo9XplyqzAHQ1AspJB0cypzPPGDXANPkzbpULgcPelQMQlpYkn q2rtZDeeH2pm1YHT1QiK+n+u+A7jM83OUkEtSD+uInIdVHUsPiVFys6kxdjnMNKzkX37 ++ig== 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=LIgRN0QDBu4gnSn3TisqfMx5xMC/fpgZPP0eL7TYZo4=; b=cbaPvrg1FbcjTJpEeQxxKL5muJHrhd1g17Gc1EN9HS2r2oc2KltxHn345I+I63DTxj 8MvdCdJvcrIurePtikdvSy6PMh5Bje65SLFjXS91smwBFTVrqr36kquDXGVALiocrS1v jMBBqUqCAJNdVX7Msq5AuZu/LmngsIKYG3Fvv0NGruODRvL3O0wzL3zeqfS4FIUnHAQJ KargO/+ur8SzNz4T+jFJwGz5UHYycIyCd3A8g1V4Xvsx+/pircTvUbDJhdQ4TYK61zma 4yeMzpZFvyORY8DhjDY43heNkRjU1SaDXR63TUunSImFrP1gi0UexfB0fETap0rtoF1C q2Zw== X-Gm-Message-State: AOAM530jPuMSveRTkzr+PitotpyiouUeTz350PaNEcdDKvVNV0FC0Mfb /rvYz5Z0/u6dGUR5yN05MmRbiYaR+CdXUlZYkCY= X-Google-Smtp-Source: ABdhPJzIA1FGKrVz+9UgvnCvE4qHbM8WwKnt0yzT0Ej9MwEf3XXL3bZ9GG5bYf4/kar44nR6s2ZBVVKbKsVOWbpBIWw= X-Received: by 2002:a05:6102:a17:: with SMTP id t23mr9115865vsa.62.1590996132886; Mon, 01 Jun 2020 00:22:12 -0700 (PDT) MIME-Version: 1.0 References: <20200529141100.37519-1-pilgrimtao@gmail.com> In-Reply-To: From: Tao pilgrim Date: Mon, 1 Jun 2020 15:22:01 +0800 Message-ID: To: Jens Axboe X-Headers-End: 1jfem2-003DVL-Kv Subject: Re: [f2fs-dev] [PATCH v2] blkdev: Replace blksize_bits() with ilog2() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hoeppner@linux.ibm.com, heiko.carstens@de.ibm.com, linux-nvme@lists.infradead.org, dhowells@redhat.com, clm@fb.com, deepa.kernel@gmail.com, houtao1@huawei.com, hch@lst.de, linux-s390@vger.kernel.org, bvanassche@acm.org, darrick.wong@oracle.com, Mark Fasheh , satyat@google.com, hch@infradead.org, borntraeger@de.ibm.com, gor@linux.ibm.com, chaitanya.kulkarni@wdc.com, Josef Bacik , ming.lei@redhat.com, viro@zeniv.linux.org.uk, Muchun Song , dsterba@suse.com, jaegeuk@kernel.org, jlbec@evilplan.org, sagi@grimberg.me, balbi@kernel.org, damien.lemoal@wdc.com, martin.petersen@oracle.com, joseph.qi@linux.alibaba.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, asml.silence@gmail.com, linux-btrfs@vger.kernel.org, sth@linux.ibm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, May 29, 2020 at 10:13 PM Jens Axboe wrote: > > On 5/29/20 8:11 AM, Kaitao Cheng wrote: > > There is a function named ilog2() exist which can replace blksize. > > The generated code will be shorter and more efficient on some > > architecture, such as arm64. And ilog2() can be optimized according > > to different architecture. > > When you posted this last time, I said: > > "I like the simplification, but do you have any results to back up > that claim? Is the generated code shorter? Runs faster?" > Hi Jens Axboe: I did a test on ARM64. unsigned int ckt_blksize(int size) { return blksize_bits(size); } unsigned int ckt_ilog2(int size) { return ilog2(size); } When I compiled it into assembly code, I got the following result, 0000000000000088 : 88: 2a0003e8 mov w8, w0 8c: 321d03e0 orr w0, wzr, #0x8 90: 11000400 add w0, w0, #0x1 94: 7108051f cmp w8, #0x201 98: 53017d08 lsr w8, w8, #1 9c: 54ffffa8 b.hi 90 a0: d65f03c0 ret a4: d503201f nop 00000000000000a8 : a8: 320013e8 orr w8, wzr, #0x1f ac: 5ac01009 clz w9, w0 b0: 4b090108 sub w8, w8, w9 b4: 7100001f cmp w0, #0x0 b8: 5a9f1100 csinv w0, w8, wzr, ne bc: d65f03c0 ret The generated code of ilog2 is shorter , and runs faster > which you handily ignored, yet sending out a new version. I'm not > going to apply this without justification, your commit message is > handwavy at best. > Do I need to write the test content into commit message? -- Yours, Kaitao Cheng _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel