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


Groups > linux.kernel > #1199323 > unrolled thread

Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function

Started byAndrew Morton <akpm@linux-foundation.org>
First post2015-08-04 01:20 +0200
Last post2015-08-04 23:30 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function Andrew Morton <akpm@linux-foundation.org> - 2015-08-04 01:20 +0200
    Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function Robert Jarzmik <robert.jarzmik@free.fr> - 2015-08-04 19:10 +0200
      Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function Andrew Morton <akpm@linux-foundation.org> - 2015-08-04 23:30 +0200

#1199323 — Re: [RFC PATCH v2] lib: scatterlist: add sg splitting function

FromAndrew Morton <akpm@linux-foundation.org>
Date2015-08-04 01:20 +0200
SubjectRe: [RFC PATCH v2] lib: scatterlist: add sg splitting function
Message-ID<pTxbr-VO-9@gated-at.bofh.it>
On Sat,  1 Aug 2015 15:17:13 +0200 Robert Jarzmik <robert.jarzmik@free.fr> wrote:

> Sometimes a scatter-gather has to be split into several chunks, or sub scatter
> lists. This happens for example if a scatter list will be handled by multiple
> DMA channels, each one filling a part of it.
> 
> A concrete example comes with the media V4L2 API, where the scatter list is
> allocated from userspace to hold an image, regardless of the knowledge of how
> many DMAs will fill it :
>  - in a simple RGB565 case, one DMA will pump data from the camera ISP to memory
>  - in the trickier YUV422 case, 3 DMAs will pump data from the camera ISP pipes,
>    one for pipe Y, one for pipe U and one for pipe V
> 
> For these cases, it is necessary to split the original scatter list into
> multiple scatter lists, which is the purpose of this patch.
> 
> ...
>
>  include/linux/scatterlist.h |   5 ++
>  lib/scatterlist.c           | 189 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 194 insertions(+)

It's quite a bit of code for a fairly specialised thing.  How ugly
would it be to put this in a new .c file and have subsystems select it
in Kconfig?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1200166

FromRobert Jarzmik <robert.jarzmik@free.fr>
Date2015-08-04 19:10 +0200
Message-ID<pTNSV-8pz-11@gated-at.bofh.it>
In reply to#1199323
Andrew Morton <akpm@linux-foundation.org> writes:

>>  include/linux/scatterlist.h |   5 ++
>>  lib/scatterlist.c           | 189 ++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 194 insertions(+)
>
> It's quite a bit of code for a fairly specialised thing.  How ugly
> would it be to put this in a new .c file and have subsystems select it
> in Kconfig?
I have no idea about the "ugliness", but why not ...

If nobody objects, and in order to submit a proper patch, there are decisions to
make :
 - what will be the scope of this new .c file ?
   - only sg_plit() ?
   - all sg specialized functions, ie. sg_lib.c ?
 - will include/linux/scatterlist.h have an "ifdefed" portion for what X.c
   offers ?
 - what naming for X.c and the config entry ?

What about adding this to lib/Makefile, and one ifdef to scatterlist.h ? :
     obj-$(CONFIG_SG_LIB) += sg_lib.o

Cheers.

-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1200285

FromAndrew Morton <akpm@linux-foundation.org>
Date2015-08-04 23:30 +0200
Message-ID<pTRWy-5Wc-17@gated-at.bofh.it>
In reply to#1200166
On Tue, 04 Aug 2015 19:04:36 +0200 Robert Jarzmik <robert.jarzmik@free.fr> wrote:

> Andrew Morton <akpm@linux-foundation.org> writes:
> 
> >>  include/linux/scatterlist.h |   5 ++
> >>  lib/scatterlist.c           | 189 ++++++++++++++++++++++++++++++++++++++++++++
> >>  2 files changed, 194 insertions(+)
> >
> > It's quite a bit of code for a fairly specialised thing.  How ugly
> > would it be to put this in a new .c file and have subsystems select it
> > in Kconfig?
> I have no idea about the "ugliness", but why not ...
> 
> If nobody objects, and in order to submit a proper patch, there are decisions to
> make :
>  - what will be the scope of this new .c file ?
>    - only sg_plit() ?
>    - all sg specialized functions, ie. sg_lib.c ?

Just sg_split I'd say.  It's a logical unit.  Other things can be moved
elsewhere later as cleanups/optimisations, but that's all off-topic.

>  - will include/linux/scatterlist.h have an "ifdefed" portion for what X.c
>    offers ?

I prefer to avoid the ifdefs.  This means that the error is reported at
link-time rather than compile-time but that's a pretty small cost and
it's a once-off inconvenience, whereas messy/complex header files are
permanent.

>  - what naming for X.c and the config entry ?

um, CONFIG_SG_SPLIT and sg_split.c?

> What about adding this to lib/Makefile, and one ifdef to scatterlist.h ? :
>      obj-$(CONFIG_SG_LIB) += sg_lib.o

It would be obj-$(CONFIG_SG_SPLIT) += sg_split.o
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web