Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632434

Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper function

From Logan Gunthorpe <logang@deltatee.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper function
Date 2017-04-28 01:10 +0200
Message-ID <tB0HU-7vd-3@gated-at.bofh.it> (permalink)
References (2 earlier) <tApIl-7Ah-3@gated-at.bofh.it> <tAYd4-5Fs-13@gated-at.bofh.it> <tAYG6-5Us-23@gated-at.bofh.it> <tAZCa-6zp-5@gated-at.bofh.it> <tAZVv-6VL-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 27/04/17 04:11 PM, Jason Gunthorpe wrote:
> On Thu, Apr 27, 2017 at 03:53:37PM -0600, Logan Gunthorpe wrote:
> Well, that is in the current form, with more users it would make sense
> to optimize for the single page case, eg by providing the existing
> call, providing a faster single-page-only variant of the copy, perhaps
> even one that is inlined.

Ok, does it make sense then to have an sg_copy_page_to_buffer (or some
such... I'm having trouble thinking of a sane name that isn't too long).
That just does k(un)map_atomic and memcpy? I could try that if it makes
sense to people.

>> Switching the for_each_sg to sg_miter is probably the nicer solution as
>> it takes care of the mapping and the offset/length accounting for you
>> and will have similar performance.
> 
> sg_miter will still fail when the sg contains __iomem, however I would
> expect that the sg_copy will work with iomem, by using the __iomem
> memcpy variant.

Yes, that's true. Any sg_miters that ever see iomem will need to be
converted to support it. This isn't much different than the other
kmap(sg_page()) users I was converting that will also fail if they see
iomem. Though, I suspect an sg_miter user would be easier to convert to
iomem than a random kmap user.

Logan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper function Logan Gunthorpe <logang@deltatee.com> - 2017-04-25 20:30 +0200
  Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Roger Pau Monné <roger.pau@citrix.com> - 2017-04-26 09:40 +0200
    Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Logan Gunthorpe <logang@deltatee.com> - 2017-04-27 22:30 +0200
      Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-04-27 23:00 +0200
        Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Logan Gunthorpe <logang@deltatee.com> - 2017-04-28 00:00 +0200
          Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-04-28 00:20 +0200
            Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Logan Gunthorpe <logang@deltatee.com> - 2017-04-28 01:10 +0200
              Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2017-04-28 01:30 +0200
                Re: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper  function Logan Gunthorpe <logang@deltatee.com> - 2017-04-28 01:40 +0200

csiph-web