Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp161233ybg; Sat, 23 May 2020 10:12:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxscb4maMmm0CJaQ2xeXeDf9eYyNDuJr15BcMyvk0DBREc2NjzcKAmVZKXluDdFM8UdVUN0 X-Received: by 2002:a05:6402:1d2d:: with SMTP id dh13mr7556080edb.169.1590253933393; Sat, 23 May 2020 10:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590253933; cv=none; d=google.com; s=arc-20160816; b=TTAd4LZ4FpHxi5XSscuzTxBaoi6JJ9NoBzVCGk/Qhy/H780cz918v5GBl/sEVghWKB OFiAPmOB5vSeEGK/UMozWkiR7nXYtkCdEeDXdnR8IBLtqyDvVKLE/uXj3KchY/xs3R57 BuxKs8Ivm0bS3bIQ7ZFxXOpu9qbRpCSh+bCz90EeyFktRgHecU2a+J+uJJlVnjdo+MWC Kq9w52MglSfGAtYLzy7kfancy0PeISYFXrRJdGfP2JbaVxR+5x8SwTatRlB3QN26kstr PT252QD+ISHaZXnZQ8LlrBsestIb2vHg8tqNbtnqyGJcy20J4W6PK2QSwXpAgAbDSXvd cSLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=egMx+No4Q7JjvOH6HOQxtmCuDUz9eFhby8mi1jgHo88=; b=tfKp4g76eNwDV48NBkzeoIuX1rnraqyE7Z6fAG4LS5bX4amGw4vD4cvUsgIFQA61lu 3ww9V/QBt/khiTQgsOD9sSKaK5g0vfLYNoV+4+/+LaL5izhUfyjfz02jI64R6KzuClco xmphk4d5pgiBVKYByruG7iUoaOTg9YssU0F75WYStiq8xMJ+55ZQUAvJXU/OJkIHJ91y wHcIrX+bM58fIWQY44nPnY0w2u9gD5wXoxEVS9wV6NR2QI2AqB/EAKZVYh39HqJwDDJa 61CCRSJ2uIMHfVvflRLE60ywKH9upNV/36OLqJiVBKpsTrQB+7lr+cmeu5kl7UOx5lxV QpaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=sSI1R1nG; 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 bu21si6444771edb.485.2020.05.23.10.11.51; Sat, 23 May 2020 10:12:13 -0700 (PDT) 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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=sSI1R1nG; 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 S1728671AbgEWRHh (ORCPT + 99 others); Sat, 23 May 2020 13:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728476AbgEWRHg (ORCPT ); Sat, 23 May 2020 13:07:36 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FCDC061A0E for ; Sat, 23 May 2020 10:07:36 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id l73so2897837pjb.1 for ; Sat, 23 May 2020 10:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=egMx+No4Q7JjvOH6HOQxtmCuDUz9eFhby8mi1jgHo88=; b=sSI1R1nGqQkE67A0UByykv2becr/N/nEMsk1aYYRxUFWzu6viyG4Sps2d6npfiJvKw gbeTDje4JgbfrNVC/VRmwuHmHrgcIyhpSPSiLqQJwzletjfTO3p1JBOTODia1MqvoQ6X XHPqgRc4IpO3EClibxSClAEmy8HFa/JIgNLDyuVUKxamQN/tKzi74Q/uBo6D+Ez5W3qd k2RQ0Qjbkh99iyIEfTadj4Wd0yo02fu1D6V4H0DBvGDqGCfgn4KTwZxPsGKv2aS9c9dO UaYutES/BtQ0/mpgUDp9uHQWGC//alIU2tz6QaJf/LSFVETtjt50CwK8FiLA+vd3XFUT 9T/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=egMx+No4Q7JjvOH6HOQxtmCuDUz9eFhby8mi1jgHo88=; b=TMsx/f9K/DWMTRpNcUQ33V1+HfXQyZeewYG1Dq+XZXTthIFCSb2GF/nM1aqDC+Fx71 IXjiHaKsF82iQJCYWMWL09S9rHqiCdvTK9J16qCvhYEejgNL5FVuSwPXoNVExmhNCRNL a9in1ep1ccr7ASfViwY99cs4If7p6eSP1yDuWorxJSTCTQpUQx42c/vb0xFrYVtTIrQj cwspw6uNqzFJ1mXfMrwyeEI/gt/FdptnJrqG/2OXWILAKcnyRx0YRnVV++Xbv1+ZBMRi Z1e273czRyMc6x/XJFJUmVdWCa/05BiDK9woI+D7Hv4z+89L2dwldamdjAUmivz2fC9h BsgA== X-Gm-Message-State: AOAM532l7SMF+8MeeF+QwF3IQbCd3m+QmOdxYa3OLscTQYewfl3dohn2 IRKC+HW+gLasGxoqdl6zKejnDw== X-Received: by 2002:a17:90a:23e7:: with SMTP id g94mr11931683pje.210.1590253655802; Sat, 23 May 2020 10:07:35 -0700 (PDT) Received: from ?IPv6:2605:e000:100e:8c61:7c7a:121c:c8c2:4d28? ([2605:e000:100e:8c61:7c7a:121c:c8c2:4d28]) by smtp.gmail.com with ESMTPSA id m12sm4823488pjf.44.2020.05.23.10.07.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 May 2020 10:07:35 -0700 (PDT) Subject: Re: [PATCH] linux/blkdev.h: Use ilog2() directly in blksize_bits() To: Kaitao Cheng Cc: 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, songmuchun@bytedance.com References: <20200523155048.29369-1-pilgrimtao@gmail.com> From: Jens Axboe Message-ID: <98a69358-9976-e0e6-9cc6-f9c4676d8f3f@kernel.dk> Date: Sat, 23 May 2020 11:07:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200523155048.29369-1-pilgrimtao@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/23/20 9:50 AM, Kaitao Cheng wrote: > blksize_bits() can be achieved through ilog2(), and ilog2() is > more efficient. I like the simplification, but do you have any results to back up that claim? Is the generated code shorter? Runs faster? -- Jens Axboe