All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Vu Pham <vuhuong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	David Dillow <dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org>,
	Sebastian Parschauer
	<sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 9/9] IB/srp: Add fast registration support
Date: Wed, 14 May 2014 13:13:23 +0300	[thread overview]
Message-ID: <537341C3.1020303@dev.mellanox.co.il> (raw)
In-Reply-To: <53732EAE.9010207-HInyCGIudOg@public.gmane.org>

On 5/14/2014 11:51 AM, Bart Van Assche wrote:
> On 05/14/14 10:18, Sagi Grimberg wrote:
>> On 5/14/2014 10:05 AM, Bart Van Assche wrote:
>>> On 05/13/14 18:48, Sagi Grimberg wrote:
>>>> On 5/13/2014 5:44 PM, Bart Van Assche wrote:
>>>>> +    memcpy(desc->frpl->page_list, state->pages,
>>>>> +           sizeof(state->pages[0]) * state->npages);
>>>> I would really like to avoid this memcpy. Any chance we can map directly
>>>> to frpl->page_list instead ?
>>> Avoiding this memcpy() would be relatively easy if all memory that is
>>> holding data for a SCSI command would always be registered. However,
>>> since if register_always == false the fast registration algorithm in
>>> this patch only allocates an rkey if needed (npages > 1) and since how
>>> many pages are present in a mapping descriptor is only known after
>>> state->pages[] has been filled in, eliminating that memcpy would be
>>> challenging.
>> Yes I see, But since the only constraint that forces us to do this
>> memcpy is the current code logic,
>> I would like to see a /* TODO */ here to remind us that we should
>> re-think on how to avoid this.
> Can you explain why you consider eliminating that memcpy() statement so
> important ? If e.g. the page cache submits an sg-list with 255 pages
> each 4 KB in size and in the case all these pages are scattered then 255
> * 4096 = 1044480 data bytes have to be transferred from main memory to
> HCA. In that case the above memcpy() statement copies an additional 255
> * 8 = 2040 bytes. That's an overhead of about 0.2%.

The data transfer is offloaded and doesn't require any CPU cycles.
Today performance bottlenecks lie in SW CPU utilization. Just wanted to 
point out
that this patch introduces unnecessary extra CPU cycles. I guess I'm 
fine with leaving
it as is if no one is bothered with it.

Sagi.
--
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:[~2014-05-14 10:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 14:38 [PATCH v2 0/9] SRP initiator patches for kernel 3.16 Bart Van Assche
     [not found] ` <53722E4F.7070709-HInyCGIudOg@public.gmane.org>
2014-05-13 14:39   ` [PATCH v2 1/9] IB/srp: Fix a sporadic crash triggered by cable pulling Bart Van Assche
2014-05-13 14:40   ` [PATCH v2 2/9] IB/srp: Fix kernel-doc warnings Bart Van Assche
2014-05-13 14:40   ` [PATCH v2 3/9] IB/srp: Introduce an additional local variable Bart Van Assche
2014-05-13 14:41   ` [PATCH v2 4/9] IB/srp: Introduce srp_map_fmr() Bart Van Assche
2014-05-13 14:41   ` [PATCH v2 5/9] IB/srp: Introduce srp_finish_mapping() Bart Van Assche
2014-05-13 14:42   ` [PATCH v2 6/9] IB/srp: Introduce the 'register_always' kernel module parameter Bart Van Assche
2014-05-13 14:43   ` [PATCH v2 7/9] IB/srp: One FMR pool per SRP connection Bart Van Assche
2014-05-13 14:44   ` [PATCH v2 8/9] IB/srp: Rename FMR-related variables Bart Van Assche
2014-05-13 14:44   ` [PATCH v2 9/9] IB/srp: Add fast registration support Bart Van Assche
     [not found]     ` <53722FE2.4010808-HInyCGIudOg@public.gmane.org>
2014-05-13 16:48       ` Sagi Grimberg
     [not found]         ` <53724CC9.6080509-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-05-14  7:05           ` Bart Van Assche
     [not found]             ` <537315CC.1090001-HInyCGIudOg@public.gmane.org>
2014-05-14  8:18               ` Sagi Grimberg
     [not found]                 ` <537326BF.3010706-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-05-14  8:51                   ` Bart Van Assche
     [not found]                     ` <53732EAE.9010207-HInyCGIudOg@public.gmane.org>
2014-05-14 10:13                       ` Sagi Grimberg [this message]
2014-05-13 16:50   ` [PATCH v2 0/9] SRP initiator patches for kernel 3.16 Sagi Grimberg

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=537341C3.1020303@dev.mellanox.co.il \
    --to=sagig-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=bvanassche-HInyCGIudOg@public.gmane.org \
    --cc=dave-i1Mk8JYDVaaSihdK6806/g@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
    --cc=vuhuong-VPRAkNaXOzVWk0Htik3J/w@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.