public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Subject: Re: IB: increase DMA max_segment_size on Mellanox hardware
Date: Tue, 18 Jan 2011 09:16:46 +0200	[thread overview]
Message-ID: <4D353E5E.2020500@voltaire.com> (raw)
In-Reply-To: <1295318783.3051.81.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>

David Dillow wrote:
> We're talking about different things -- max_segments(sg_tablesize)/max_sectors are 
> the limits as we're adding pages to the bio via bio_add_page(). blk_rq_map_sg() uses
> max_segment_size as a bound on the largest S/G entry into which it can
> coalesce multiple entries from the BIO.
> It is considered in the line
> 	if (sg->length + nbytes > queue_max_segment_size(q))
> 		goto new_segment;

Dave, thanks for the detailed explanation, I understand it much better now, just
to make sure, blk_rq_map_sg() is called through the flow of dma_map_sg, correct?

If this is the case, we're talking on decision making done by the block layer
during dma-mapping which later affect the "IB IOMMU mapping" at the IB driver 
(e.g srp, iser, etc).

>> In iser we want to support up to 512KB IOs, so sg_tablesize is 128 (=512>>12)
>> which on systems with 4K page size accounts to 512K totally (we also set max_sectors 
>> to 1024, so on systems with 16K or whatever page size, we'll not get > 512K IOs).

> Yes, but without this change, you will get your 512 KB request in 8 S/G
> entries minimum, when it could be in one if contiguous. For our systems
> where we're trying to get 1 MB or larger IOs over SRP, we get 16 S/G
> entries when we could get one, potentially forcing us into using FMRs
> and doing additional work when we could just map the single entry directly.

Since the block layer did its best to coalesce multiple entries from the BIO
to SG(s), you would need to FMR whenever dma_map_sg returns value > 1 

As you mention later on, I wonder what would be the benefit from not using FMRs 
as we're talking on large IOs (> 64K, by the assumption that the block it coalesces 
today BIOs that allow that, i.e their pages are contiguous), for which I would 
expect latency, bandwidth and IOPS not to be effected by no-FMRing them. So we're
remained with the CPU usage saving, do you have (say) "vmstat 1" snapshots before/after
this patch with the ~same IO tool/load that can help quantify this saving?

Also when working with direct I/O from user space and/or under file-system,
did you really see many BIOs that can be merged? I was under the impression,
that (specifically after some time the system is active) for the most case, 
I get totally scattered SGs, whose pages can't be coalesced at all.

Or.
--
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:[~2011-01-18  7:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17  2:09 IB: increase DMA max_segment_size on Mellanox hardware David Dillow
     [not found] ` <1295230184.2574.26.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2011-01-17 11:16   ` Or Gerlitz
     [not found]     ` <4D342510.80701-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2011-01-18  2:46       ` David Dillow
     [not found]         ` <1295318783.3051.81.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2011-01-18  5:22           ` Jason Gunthorpe
2011-01-18  7:16           ` Or Gerlitz [this message]
     [not found]             ` <4D353E5E.2020500-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2011-01-18 12:25               ` David Dillow
     [not found]                 ` <1295353524.3051.121.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2011-01-18 18:01                   ` Jason Gunthorpe
2011-01-20 10:14                   ` Or Gerlitz
     [not found]                     ` <4D380AF2.4010905-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2011-01-20 12:15                       ` David Dillow
     [not found]                         ` <1295525737.22825.24.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org>
2011-01-24 15:18                           ` Or Gerlitz
     [not found]                             ` <4D3D9845.4050803-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2011-01-24 19:36                               ` David Dillow
     [not found]                                 ` <1295897819.29946.17.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-02-17  1:06                                   ` David Dillow
     [not found]                                     ` <1297904810.8833.44.camel-FqX9LgGZnHWDB2HL1qBt2PIbXMQ5te18@public.gmane.org>
2011-03-16 19:17                                       ` Or Gerlitz
2011-01-20 10:18           ` Or Gerlitz
     [not found]             ` <4D380BDC.5080002-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2011-01-20 12:25               ` David Dillow
2011-03-22  8:01   ` Or Gerlitz
     [not found]     ` <4D885748.6060600-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-03-22 12:51       ` David Dillow

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=4D353E5E.2020500@voltaire.com \
    --to=ogerlitz-smomgflxvozwk0htik3j/w@public.gmane.org \
    --cc=dillowda-1Heg1YXhbW8@public.gmane.org \
    --cc=eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox