[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.0.999.0710260742140.30120@woody.linux-foundation.org>
Date: Fri, 26 Oct 2007 07:52:25 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Paul Mackerras <paulus@...ba.org>
cc: Rusty Russell <rusty@...tcorp.com.au>,
Boaz Harrosh <bharrosh@...asas.com>,
Jens Axboe <jens.axboe@...cle.com>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Linux Kernel Development <linux-kernel@...r.kernel.org>,
mingo@...e.hu
Subject: Re: [PATCH 09/10] Change table chaining layout
On Fri, 26 Oct 2007, Paul Mackerras wrote:
>
> Linus Torvalds writes:
>
> > Nobody should *ever* walk the list to find the length. Does anybody really
> > do that? Yes, we pass the thing down, but do people *need* it?
>
> Yes, I need it for devices that use the macintosh DBDMA
> (descriptor-based DMA) hardware. The DBDMA hardware reads an array of
> descriptors from system RAM, so I need to allocate an array and fill
> it in with DBDMA command blocks (and then dma-map it and point the
> device at it).
Yes, for allocation purposes you'd need the size ahead of time, agreed.
Otherwise you have to walk the list twice.
> Maybe the drivers for devices that use DBDMA are now buggy. Certainly
> filling in the array of DBDMA command blocks involves walking the
> list, but it would extremely useful to know how much to allocate
> before we start filling them in. So we at least need an upper bound
> on the number of "real" entries, even if we don't have the exact
> number.
Hmm. Depending on where you do this, and if this is some block-layer
specific driver/code (rather than necessarily a generic SG thing), you do
have the req->nr_phys_segments thing which should be that for you (ie the
SG list may have _fewer_ requests in it in case some of those entries got
squashed together due to be contiguous).
But yeah, I don't think it would be wrong at all to have a
struct scatterlist_head {
unsigned int entries;
unsigned int flags; /* ? */
struct scatterlist *sg;
};
which would be passed down at higher levels.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists