Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1348895rwe; Sat, 27 Aug 2022 06:16:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR5MdiZhILuwd1JtH3pVTpw2TlOmQXgaY/WqQqhD4HhQX9L7HsREgEZ+cNkQ72Nj2oXzQSGT X-Received: by 2002:a17:902:8ec7:b0:172:ac9c:4757 with SMTP id x7-20020a1709028ec700b00172ac9c4757mr8087313plo.163.1661606214572; Sat, 27 Aug 2022 06:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661606214; cv=none; d=google.com; s=arc-20160816; b=ZqJLZ6LknTq4BJGzhD4oZNyQryHmc/mZ5O4fjakWTY6ZG/It+PbukPkAhAgFgyDkTr pp/Gx/93fOSS0BrK1ugqT/eO9NLDafnIfhrGlha4brlXhqDebHztqJLwEkXqX9xsQ5lT WEkxk/yQ/r23pmoANttZucwMH8hVknmD94y0hhj7rMtRXhdRD+cZgwrqTn+RStmDD7Tp adPIICnMDlNZAKcCXxxs5DeUuY76UeXxJExeYLNEY8YEcGJ3YtlBGzci8FjPJObjbyv4 U05ggjNX3BszFZx1BYgp7hZyRtrsSmNq27BnqVBLewmxGCMrf60z/6Ikhk/8f5LL7b+M O5Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=NgE38d6IBS5FNLZuLaonlxZQOrt3k0jPQscX+CylD6w=; b=Qs9cZ+SQhoGiaWMrhtMhAm/ktvtVk5azfiN8JBKxdBXsl5+e4zNBz0ibCVmVYf57Dl VM9z1CQQ5i71lhb3OHEgyCE6jgg4a3l4VhtCFHP0UmUeneMbVDzRTQ3+bJqvg/QNDFyw f2WKqqwZQ/64rpmJIjW8PkMr/EvwrYSmUJ3ZqYKtg22ZeXUhz6JN/KE8JEN4T35l0hsC QnLhwtzorfPdrYI3zcgE0iRRXyauh2x3v4BtUeleNJPsq5taqjW7MdvF+55EfJWKbEDu EPoIk440Pc2KAKmZ5WB0pQoL+3x02eTffhL1/nvqW80YJc4+842wbAv8m6zVpcKyyRS2 flNA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a635304000000b0041c9c35a062si4337537pgb.276.2022.08.27.06.16.43; Sat, 27 Aug 2022 06:16:54 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbiH0NLE (ORCPT + 99 others); Sat, 27 Aug 2022 09:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiH0NLD (ORCPT ); Sat, 27 Aug 2022 09:11:03 -0400 Received: from out199-4.us.a.mail.aliyun.com (out199-4.us.a.mail.aliyun.com [47.90.199.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1774C61C; Sat, 27 Aug 2022 06:10:56 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R611e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=liusong@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0VNO2NEf_1661605851; Received: from 30.39.65.74(mailfrom:liusong@linux.alibaba.com fp:SMTPD_---0VNO2NEf_1661605851) by smtp.aliyun-inc.com; Sat, 27 Aug 2022 21:10:52 +0800 Message-ID: <84ad96a6-2dcd-2a5d-f526-74484324ee79@linux.alibaba.com> Date: Sat, 27 Aug 2022 21:10:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH] blk-mq: determine in advance whether batch alloc can be performed To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1661477190-86862-1-git-send-email-liusong@linux.alibaba.com> <4fff9af8-90c3-86f9-37c7-75dcd3e95dc0@kernel.dk> From: Liu Song In-Reply-To: <4fff9af8-90c3-86f9-37c7-75dcd3e95dc0@kernel.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 2022/8/26 21:33, Jens Axboe wrote: > On 8/25/22 7:26 PM, Liu Song wrote: >> From: Liu Song >> >> Some conditions for judging whether batch alloc can be performed are >> included in "blk_mq_get_tags", and this function is only used by >> "__blk_mq_alloc_requests_batch". >> >> This patch introduced a helper "can_do_batch_alloc" to prepend the >> judgment condition and avoid unnecessary function calls. > Curious if you saw any differences from this? Or do you just consider > it a cleanup? > Hi This patch aggregates the judgment conditions for whether batch alloc can be used, which can be considered as clean up. If it can be determined at the first judgment that batch alloc cannot be used, the overhead of calling "blk_mq_get_tags" once will be reduced, are some differences. Thanks