Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3979615pxb; Tue, 25 Jan 2022 00:32:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHRlfrBcG6Jkg1RRSLh9MEpgN5jmirAZkn/wmV9QeUrUMg9nAm+hTkXdHBAOablgMOvUmt X-Received: by 2002:aa7:dc53:: with SMTP id g19mr19661234edu.294.1643099540973; Tue, 25 Jan 2022 00:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099540; cv=none; d=google.com; s=arc-20160816; b=QUa6Pc3Z2zxRqO7j0P81Sy3Z0KXUp9Qb1gsvTXalUKBoYwJeFRV88MsIBhRJsmJ8SS AfbZtM7MnfO8RIzxQ8ey0ZVNHeDT1qzPSpHFPcXMCA75ZOT3OMdoYDh+WQtoDhKgC3fN tcMcpyMxytMM4yDGJLVUZ1MeZOuh2/Gi5JGCCesSxA9d/R/IN29EqFndH5dU2biW3gqk 7t2WCJR5KbzKfbBetSkfq5FM4vdKvi/HAVFLmffeGvCnDHQ+vAnzIAVu6p0+kPZtgVE9 /+O6wgMJxdxRD69AL7FhaWEDTwqroqyeJvkhIN25Ey/AZjmD/Duy+VenAeBWr4C499J/ WdZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P/w6QuWVkqM16wgZbL6p09yvSBCaBEJHBsVJRGWIFqs=; b=ojSpjrHXwBynMjgO2zhDSNVqjJ7HZZF+CZW8+Wjb4VhmP9BHHKCG6cumMqv5k3mSML 8f9JTHAN2hpl/SakxtcJ+FjDjYCaolgNfPh8DKV5QSLrh/jKnVhK4I2mRuXPZREoldS5 gfEWXhN2aLDPInnvTwNeawJDnzK/BWPD1rIllxR8OZ09433ILmTPAYdETijh2eWPKKT7 WsCQDmkrJOpQnxoIElHddZh3J5Syt+N2E7i57AujH0AmBvdaPzgtLpyFX3iFq9AEl0rc GzdWIxEquVPOjsucH7/WN7r0t1KwHGd9KRfH2rshjFHubOjSlqXpZELBarhiXZWvufgu BT7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KhfW+kHj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i30si6244202eda.530.2022.01.25.00.31.56; Tue, 25 Jan 2022 00:32:20 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=KhfW+kHj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1314080AbiAYCuR (ORCPT + 99 others); Mon, 24 Jan 2022 21:50:17 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:55618 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1445472AbiAXVDj (ORCPT ); Mon, 24 Jan 2022 16:03:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8B15CB80FA1; Mon, 24 Jan 2022 21:03:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8783C340E5; Mon, 24 Jan 2022 21:03:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058214; bh=e8+VAjX8qdBaRBg1pWk9PK9HVYFtA0VS7vIlBkabhfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KhfW+kHjdFpuF/zi0ADUttYl+LfXG6vr/FI3ojooYLL86Qo3NtSgaKfEUPZ92zkjv 26MwtuHTEMoJ4c8oNye4kHLC19gfrJixXQrV1VhyxR+domTUsGmSIl6dR5blAf8evx WU02XTgimqK0wlHSYlptsp6Ti6TLIhim2/9yD9vM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shinichiro Kawasaki , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 5.16 0216/1039] null_blk: allow zero poll queues Date: Mon, 24 Jan 2022 19:33:25 +0100 Message-Id: <20220124184132.601140815@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei [ Upstream commit 2bfdbe8b7ebd17b5331071071a910fbabc64b436 ] There isn't any reason to not allow zero poll queues from user viewpoint. Also sometimes we need to compare io poll between poll mode and irq mode, so not allowing poll queues is bad. Fixes: 15dfc662ef31 ("null_blk: Fix handling of submit_queues and poll_queues attributes") Cc: Shin'ichiro Kawasaki Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203023935.3424042-1-ming.lei@redhat.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/null_blk/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 323af5c9c8026..fc1317060db54 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -340,9 +340,9 @@ static int nullb_update_nr_hw_queues(struct nullb_device *dev, return 0; /* - * Make sure at least one queue exists for each of submit and poll. + * Make sure at least one submit queue exists. */ - if (!submit_queues || !poll_queues) + if (!submit_queues) return -EINVAL; /* @@ -1918,8 +1918,6 @@ static int null_validate_conf(struct nullb_device *dev) if (dev->poll_queues > g_poll_queues) dev->poll_queues = g_poll_queues; - else if (dev->poll_queues == 0) - dev->poll_queues = 1; dev->prev_poll_queues = dev->poll_queues; dev->queue_mode = min_t(unsigned int, dev->queue_mode, NULL_Q_MQ); -- 2.34.1