From: David Brownell <david-b@pacbell.net>
To: Vitaly Wool <vwool@ru.mvista.com>
Cc: linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH/RFC] SPI core: turn transfers to be linked list
Date: Sun, 18 Dec 2005 12:40:46 -0800 [thread overview]
Message-ID: <200512181240.46841.david-b@pacbell.net> (raw)
In-Reply-To: <43A480C0.9080201@ru.mvista.com>
On Saturday 17 December 2005 1:18 pm, Vitaly Wool wrote:
> Greetings,
>
> the patch attached changes the way transfers are chained in the SPI
> core. Namely, they are turned into linked lists instead of array. The
> reason behind is that we'd like to be able to use lightweight memory
> allocation mechanism to use it in interrupt context.
Hmm, color me confused. Is there something preventing a driver from
having its own freelist (or whatever), in cases where kmalloc doesn't
suffice? If not, why should the core change? And what sort of driver
measurements are you doing, to conclude that kmalloc doesn't suffice?
> An example of such
> kind of mechanism can be found in spi-alloc.c file in our core. The
> lightweightness is achieved by the knowledge that all the blocks to be
> allocated are of the same size.
I'd have said that since this increases the per-transfer costs (to set
up and manage the list memberships) you want to increase the weight of
that part of the API, not decrease it. ;)
Note that your current API maps to mine roughly by equating
allocate your spi_msg
allocate my { spi_message + one spi_transfer }
So if you're doing one allocation anyway, you already have the relevant
linked list (in spi_message) and pre-known size. So this patch wouldn't
improve any direct translation of your driver stack.
> We'd like to use this allocation
> technique for both message structure and transfer structure The problem
> with the current code is that transfers are represnted as an array so it
> can be of any size effectively.
Could you elaborate on this problem you perceive? This isn't the only
driver API in Linux to talk in terms of arrays describing transfers,
even potentially large arrays.
Consider how "struct scatterlist" is used, and how USB manages the
descriptors for isochronous transfers. They don't use linked lists
there, and haven't seemed to suffer from it.
- Dave
next prev parent reply other threads:[~2005-12-18 20:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-17 21:18 [PATCH/RFC] SPI core: turn transfers to be linked list Vitaly Wool
2005-12-18 20:40 ` David Brownell [this message]
2005-12-19 7:49 ` Vitaly Wool
2005-12-19 17:00 ` Greg KH
2005-12-19 20:03 ` Vitaly Wool
2005-12-20 8:11 ` David Brownell
2005-12-20 18:15 ` Vitaly Wool
2005-12-21 13:22 ` Vitaly Wool
2005-12-22 17:55 ` David Brownell
2005-12-22 22:12 ` Vitaly Wool
2005-12-22 23:57 ` David Brownell
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=200512181240.46841.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vwool@ru.mvista.com \
/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