Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38375253rwd; Wed, 12 Jul 2023 06:58:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlHUVI/byPT4wn/FIXD7XQl1cXL0F3zgIcm/mj45y4bt7SQB8it7VNxWMjmgRoeALE4Ak371 X-Received: by 2002:a05:6a20:7d84:b0:11d:8a8f:655d with SMTP id v4-20020a056a207d8400b0011d8a8f655dmr26449001pzj.4.1689170314018; Wed, 12 Jul 2023 06:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689170314; cv=none; d=google.com; s=arc-20160816; b=kRKMhgFW26AYozghBOInu3TiBxogbRm1r/Q1E09E5mjdtc8eAfQjzxO/FJyzMSaPXy TWxt5ZngpeYZ+iOy/EIdYQr6lB0GYyHhbS1hCA1zTFfgGQz9oinEm0Cbfysco7QNs3jf VSOMfG5FozT837wY4ngWxcOOI1md5ELOMXtydRtFw1d86TagFy1KUxNke9Vf1Qh5ENmZ HFzLryy6flJ8ccLMHWzMOFgp9JBjKhUSM/Zlf9UNPshq64Sy2VjKTOmYy4/b1qBsfPBF l92dKnOXAt+oadm9rdSVuFRxB42ZpM0P73uj/L5S7Dm1Tpg9aRRrv80DnY8v98xSfWu2 GMYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YdW3jXa75uZifOOTp5ZtJFJJaNTXIh3AfAYdiE+BpGY=; fh=D7mso9dqnWxGvL/1Wu8jaVaeWGx6/+f7LZ8RUgmWFaE=; b=TKb+zSljpIgREx/XUgXbduUilzc8tfGB0lU66/gnsuIXa7bvDnDeaiGmLOOvDB0enb g4kUIwaDUo29HF1xZp7ndPxotTSVSWgepfUSGRzHQ0fLXOJ2a0ufdS/uj6XJKuipNwGF 9UlibZ8z9EC19FbSoTtyy4mOF3vkHm8bsuBWvhL2B3jQ6pTwmkBVLBUoeaFw7iUkF2el sCZ7igP/0yoNGf7uYES5VJJIoQ3WokXb3VdYzn3y/U9Q8c7qGW6JVidu6OQJhuk2uGFJ YG4fCu7wJo5K6ORAGnABOHDTE2YKDBcovByybkqj9V+PT/cTop5j87kKYOvYEgIYvcrg 7Spg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Cmp0XKQW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t1-20020a6549c1000000b0054ff0e193fesi3261661pgs.225.2023.07.12.06.58.19; Wed, 12 Jul 2023 06:58:33 -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=@redhat.com header.s=mimecast20190719 header.b=Cmp0XKQW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231792AbjGLNRT (ORCPT + 99 others); Wed, 12 Jul 2023 09:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233232AbjGLNRR (ORCPT ); Wed, 12 Jul 2023 09:17:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528A81999 for ; Wed, 12 Jul 2023 06:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689167786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YdW3jXa75uZifOOTp5ZtJFJJaNTXIh3AfAYdiE+BpGY=; b=Cmp0XKQWfdBj4LO4I+4SASPp+SXG+fO5FcLxEOfHjUjDCbyWo7qlDxGgECo5SltOAfVtV0 IcSs6bBl1QE/VBP2S2RIXBf/liHJGW7AojELmO81Q1+m884c86BYUxVkmiqhfyUiJPf9r5 EZfwT8Ic9kmx241eOYaE3N0ZLUvh+Xk= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-6xGLn3mlMKuJeIXdR53l4w-1; Wed, 12 Jul 2023 09:16:25 -0400 X-MC-Unique: 6xGLn3mlMKuJeIXdR53l4w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E9C23C0C491; Wed, 12 Jul 2023 13:16:24 +0000 (UTC) Received: from ovpn-8-25.pek2.redhat.com (ovpn-8-25.pek2.redhat.com [10.72.8.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F33FC4087C73; Wed, 12 Jul 2023 12:38:00 +0000 (UTC) Date: Wed, 12 Jul 2023 21:16:11 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , linux-nvme@lists.infradead.org, "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-block@vger.kernel.org, Wen Xiong , Keith Busch , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] blk-mq: add blk_mq_max_nr_hw_queues() Message-ID: References: <20230712125455.1986455-1-ming.lei@redhat.com> <20230712125455.1986455-2-ming.lei@redhat.com> <20230712130017.GA12417@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230712130017.GA12417@lst.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Wed, Jul 12, 2023 at 03:00:17PM +0200, Christoph Hellwig wrote: > On Wed, Jul 12, 2023 at 08:54:48PM +0800, Ming Lei wrote: > > +/* Max nr_hw_queues for each hw queue type */ > > +unsigned int blk_mq_max_nr_hw_queues(void) > > +{ > > + if (is_kdump_kernel()) > > + return 1; > > + return nr_cpu_ids; > > Again, these is_kdump_kernel hacks don't make any sense. The amount > of maximum available CPU needs to come through a proper API, and we > need to use it, not add hacks like this. > > The only thing that makes sense here is to find the last CPU > in cpu_possible_mask, and for kdump kernels to ensure that number > is 1 or whatever low value they want. It doesn't matter how many cpus are available, given at least one cpu is online. The problem is that blk_mq_alloc_tag_set() forces to set nr_hw_queues as 1 for kdump kernel, that is why blk_mq_max_nr_hw_queues() has to return 1 for kdump kernel. We have to tell driver that blk-mq only supports 1 queue for kdump kernel. Or: Thomas, can we disable managed irq for kdump kernel and switch to non-managed irq? Then we can avoid driver's change. I'd suggest this way if it is possible. Thanks, Ming