Re: [PATCH 1/5] null_blk: remove the bio based I/O path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 15, 2024 at 08:16:19AM +0900, Damien Le Moal wrote:
> On 2/15/24 02:25, Keith Busch wrote:
> > On Wed, Feb 14, 2024 at 10:54:57AM +0100, Christoph Hellwig wrote:
> >> @@ -2036,11 +1813,15 @@ static int null_validate_conf(struct nullb_device *dev)
> >>  		pr_err("legacy IO path is no longer available\n");
> >>  		return -EINVAL;
> >>  	}
> >> +	if (dev->queue_mode == NULL_Q_BIO) {
> >> +		pr_err("BIO-based IO path is no longer available, using blk-mq instead.\n");
> >> +		dev->queue_mode = NULL_Q_MQ;
> >> +	}
> > 
> > Seems pointless to keep dev->queue_mode around if only one value is
> > valid.
> > 
> > Instead of checking the param here once per device, could we do it just
> > once for the module in null_set_queue_mode()?
> 
> We need the check for the configfs path as well...

Yeah, my snippet suggestion wasn't a fully flushed out idea. The
configfs part would just be this:

---
@@ -401,12 +401,20 @@ static int nullb_apply_poll_queues(struct nullb_device *dev,
        return nullb_update_nr_hw_queues(dev, dev->submit_queues, poll_queues);
 }

+static int nullb_apply_queue_mode(struct nullb_device *dev,
+                                 unsigned int queue_mode)
+{
+	if (queue_mode != NULL_Q_MQ)
+		return -EINVAL;
+	return 0;
+}
+
 NULLB_DEVICE_ATTR(size, ulong, NULL);
 NULLB_DEVICE_ATTR(completion_nsec, ulong, NULL);
 NULLB_DEVICE_ATTR(submit_queues, uint, nullb_apply_submit_queues);
 NULLB_DEVICE_ATTR(poll_queues, uint, nullb_apply_poll_queues);
 NULLB_DEVICE_ATTR(home_node, uint, NULL);
-NULLB_DEVICE_ATTR(queue_mode, uint, NULL);
+NULLB_DEVICE_ATTR(queue_mode, uint, nullb_apply_queue_mode);
 NULLB_DEVICE_ATTR(blocksize, uint, NULL);
 NULLB_DEVICE_ATTR(max_sectors, uint, NULL);
 NULLB_DEVICE_ATTR(irqmode, uint, NULL);
--




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux