Thread (4 messages) 4 messages, 2 authors, 2021-02-19

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

From: Wunderlich, Mark <hidden>
Date: 2021-02-19 00:35:52

quoted
if (queue_idle_period && queue->start_poll == 0)
	queue->start_poll = jiffies;
quoted
...
[io_work loop]
...
quoted
if (queue_poll_period) {
	if (!time_after(jiffies, queue->start_poll +
			usecs_to_jiffies(queue_poll_period)))
		pending = true;
	else
		queue->start_poll = 0;
}
quoted
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?

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help