[PATCH] nvmet-tcp: enable optional queue idle period tracking

Wunderlich, Mark mark.wunderlich at intel.com
Thu Feb 18 19:34:54 EST 2021


>>	if (queue_idle_period && queue->start_poll == 0)
>>		queue->start_poll = jiffies;

>>...
>>[io_work loop]
>>...

>>	if (queue_poll_period) {
>>		if (!time_after(jiffies, queue->start_poll +
>>				usecs_to_jiffies(queue_poll_period)))
>>			pending = true;
>>		else
>>			queue->start_poll = 0;
>>	}

>>Can this work?


>If we were to not adjust or account for time while not in the work item, this logic might work.  And if we wanted to restart the idle period upon any activity, then in the 'if' case after setting pending=true would need to >add check ' if (ops) then queue->start_poll = 0; '

I tested the following along these lines, and appears to work just as well.  As long as user specifies a time period in that at least a single I/O will occur within that period, a new period will continually be assigned until we reach the eventual idle deadline.

code tested:
	if (queue_idle_period_usecs && queue->idle_poll_deadline == 0)
		queue->idle_poll_deadline = jiffies + usecs_to_jiffies(queue_idle_period_usecs);

	[io_work loop]

	if (queue_idle_period_usecs) {
		if (!time_after(jiffies, queue->idle_poll_deadline)) {
			pending = true;
			if (ops > 0)
				queue->idle_poll_deadline = 0;
		} else {
			queue->idle_poll_deadline = 0;
		}
	}

Will do a V2 if you like this better?  Like the names used?



More information about the Linux-nvme mailing list