All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Potential lost receive WCs (was "[PATCH WIP 38/43]")
Date: Thu, 30 Jul 2015 10:51:14 -0400	[thread overview]
Message-ID: <2B721046-EC96-4768-8ECC-138FF4AE9D90@oracle.com> (raw)
In-Reply-To: <55B9CB78.9040501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>


On Jul 30, 2015, at 3:00 AM, Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> 
>>> The drivers we have that don't dequeue all the CQEs are doing
>>> something like NAPI polling and have other mechanisms to guarentee
>>> progress. Don't copy something like budget without copying the other
>>> mechanisms :)
>> 
>> OK, that makes total sense. Thanks for clarifying.
> 
> IIRC NAPI is soft-IRQ which chuck is trying to avoid.
> 
> Chuck, I think I was the one that commented on this. I observed a
> situation in iser where the polling loop kept going continuously
> without ever leaving the soft-IRQ context (high workload obviously).
> In addition to the polling loop hogging the CPU, other CQs with the
> same IRQ assignment were starved. So I suggested you should take care
> of it in xprtrdma as well.
> 
> The correct approach is NAPI. There is an equivalent for storage which
> is called blk_iopoll (block/blk-iopool.c) which sort of has nothing
> specific to block devices (also soft-IRQ context). I have attempted to
> convert iser to use it, but I got some unpredictable latency jitters so
> I stopped and didn't get a chance to pick it up ever since.
> 
> I still think that draining the CQ without respecting a quota is
> wrong, even if driverX has a glitch there.

The iWARP and IBTA specs disagree: they both recommend clearing
existing CQEs when handling a completion upcall. Thus the API is
designed with the expectation that consumers do not impose a poll
budget.

Any solution to the starvation problem, including quota + NAPI,
involves deferring receive work. xprtrdma already defers work.

Our completion handlers are lightweight. The bulk of receive
handling is done in softIRQ in a tasklet that handles each RPC
reply in a loop. It's more likely the tasklet loop, rather than
completion handling, is going to result in starvation.

The only issue we've seen so far is the reply tasklet can hog
one CPU because it is single-threaded across all transport
connections. Thus it is more effective for us to replace the
tasklet with a work queue where each RPC reply can be globally
scheduled and does not interfere with other work being done
by softIRQ.

In other words, the starvation issue seen in xprtrdma is not
in the receive handler, so fixing it there is likely to be
ineffective.


--
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-07-30 14:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 20:26 Potential lost receive WCs (was "[PATCH WIP 38/43]") Chuck Lever
     [not found] ` <7824831C-3CC5-49C4-9E0B-58129D0E7FFF-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-07-24 20:46   ` Jason Gunthorpe
     [not found]     ` <20150724204604.GA28244-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-29 20:47       ` Chuck Lever
     [not found]         ` <E855E210-F640-4104-9B35-2A75DF1BF2E3-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-07-29 21:15           ` Jason Gunthorpe
     [not found]             ` <20150729211557.GA16284-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-29 21:19               ` Chuck Lever
     [not found]                 ` <DC5354A4-3EB4-46FF-AA34-9AE26DD25031-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-07-30  7:00                   ` Sagi Grimberg
     [not found]                     ` <55B9CB78.9040501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-07-30 14:51                       ` Chuck Lever [this message]
2015-07-30 16:00                       ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2B721046-EC96-4768-8ECC-138FF4AE9D90@oracle.com \
    --to=chuck.lever-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.