Re: [PATCH RFC] tgtd: send/recv iSCSI PDUs in worker threads

FUJITA Tomonori <[email protected]>
Newsgroups org.kernel.vger.stgt
Message-ID <[email protected]>
On Wed, 06 Nov 2013 10:04:42 +0900
Hitoshi Mitake <[email protected]> wrote:

> At Tue, 05 Nov 2013 23:28:45 +0900 (JST),
> FUJITA Tomonori wrote:
> > 
> > On Mon,  4 Nov 2013 14:13:16 +0900
> > Hitoshi Mitake <[email protected]> wrote:
> > 
> > > From: Hitoshi Mitake <[email protected]>
> > > 
> > > Current tgtd sends and receives iSCSI PDUs in its main event
> > > loop. This design can cause bottleneck when many iSCSI clients connect
> > > to single tgtd process. For example, we need multiple tgtd processes
> > > for utilizing fast network like 10 GbE because typical single
> > > processor core isn't fast enough for processing bunch of requests.
> > > 
> > > This patch lets tgtd send/receive iSCSI PDUs and check digests in its
> > > worker threads. After applying this patch, the bottleneck in the main
> > > event loop is removed and the performance is improved.
> > > 
> > > The improvement can be seen even if tgtd and iSCSI initiator are
> > > running on a single host. Below is a snippet of fio result on my
> > > laptop. The workload is 128MB random RW. Backingstore is sheepdog.
> > > 
> > > original tgtd:
> > >   read : io=65392KB, bw=4445.2KB/s, iops=1111, runt= 14711msec
> > >   write: io=65680KB, bw=4464.8KB/s, iops=1116, runt= 14711msec
> > > 
> > > tgtd with this patch:
> > >   read : io=65392KB, bw=5098.9KB/s, iops=1274, runt= 12825msec
> > >   write: io=65680KB, bw=5121.3KB/s, iops=1280, runt= 12825msec
> > > 
> > > This change will be more effective when a number of iSCSI clients
> > > increases. I'd like to hear your comments on this change.
> > > 
> > > Signed-off-by: Hitoshi Mitake <[email protected]>
> > > ---
> > >  usr/iscsi/iscsi_tcp.c | 291 +++++++++++++++++++++++++++++++++++++++++++++++---
> > >  usr/iscsi/iscsid.c    |  61 +++++++----
> > >  usr/iscsi/iscsid.h    |   4 +
> > >  3 files changed, 322 insertions(+), 34 deletions(-)
> > 
> > This change doesn't affect our complicated logic to handle outstanding
> > commands with tcp disconnection (e.g. conn_close() in conn.c)?
> 
> I think it doesn't affect the closing logic. Because any procedure
> other than send/recv and digest checking are not delegated to worker
> threads. Task queuing, connection closing, etc are done in main
> thread even now.

I've not read the patch but conn_close() has the code to handle a
response to be being sent when a tcp connection is closed.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.