public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Wool <vwool@ru.mvista.com>
To: David Brownell <david-b@pacbell.net>
Cc: linux-kernel@vger.kernel.org, dpervushin@gmail.com,
	akpm@osdl.org, greg@kroah.com, basicmark@yahoo.com,
	komal_shah802003@yahoo.com, stephen@streetfiresound.com,
	spi-devel-general@lists.sourceforge.net, Joachim_Jaeger@digi.com
Subject: Re: [spi-devel-general] Re: [PATCH 2.6-git] SPI core refresh
Date: Sun, 11 Dec 2005 20:03:35 +0300	[thread overview]
Message-ID: <439C5BE7.3030503@ru.mvista.com> (raw)
In-Reply-To: <439C1D5E.1020407@ru.mvista.com>

Vitaly Wool wrote:

> David Brownell wrote:
>
>>> Yeah thus we don't have an ability to allocate SPI messages on stack 
>>> as you do, that's what votes for your approach. Yours is thus a bit 
>>> faster, though I suspect that this method is a possible *danger* for 
>>> really high-speed devices with data bursts on the SPI bus like WiFi 
>>> adapters: stack's gonna suffer from large amounts of data allocated.
>>>   
>>
>>
>> No, you're still thinking about a purely synchronous programming model;
>> which we had agreed ages ago was not required.
>>  
>>
> Ah yes. But wait... I've got an important question here.
> For instance, let's take your MTD driver. You're allocating a message 
> structure on stack and passing it then down to spi->master->transfer 
> function.
> The benefit you're talking about is that you don't have to use 
> heavyweight memory allocation. But... the transfer is basically async 
> so spi->master->transfer will need to copy your message structure to 
> its own-allocated structure so some memory copying will occur as this 
> might be an async transfer (and therefore the stack-allocated message 
> may be freed at some point when it's yet used!)
> So your model implies concealed double message allocation/copying, 
> doesn't it?
> And if I'm wrong, can you please explain me this?

Oh, now looks like I understood what is meant. If a function uses 
stack-allocated messages, it should ensure that it will not exit until 
the message is processed (shouldn't it be documented somewhere?). But 
this solves the problem only partially since this technique fits only 
the synchronous transfers.
Functions targeting async transfers will anyway have to kmalloc the 
memory for message structure which makes your approach not really more 
lightweight then ours. It's mainly async transfers that need high 
throughput; and the drivers based on your core will have to kmalloc 
memory for messages in that case.

Vitaly

  reply	other threads:[~2005-12-11 17:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01 16:11 [PATCH 2.6-git] SPI core refresh Vitaly Wool
2005-12-01 16:18 ` [PATCH 2.6-git] MTD/SPI dataflash driver Vitaly Wool
2005-12-01 18:33   ` David Brownell
2005-12-02  6:01     ` Vitaly Wool
2005-12-02 22:07       ` David Brownell
2005-12-01 16:21 ` [PATCH 2.6-git] SPI core refresh Russell King
2005-12-01 16:30   ` Vitaly Wool
2005-12-01 18:04 ` Stephen Street
2005-12-01 18:22 ` Greg KH
2005-12-02  6:06   ` Vitaly Wool
2005-12-02 18:50     ` Mark Underwood
2005-12-02 20:13     ` Greg KH
2005-12-05 18:01 ` Vitaly Wool
2005-12-08  1:59   ` David Brownell
2005-12-08  6:33     ` Vitaly Wool
2005-12-09 22:55       ` David Brownell
2005-12-10 11:15         ` Vitaly Wool
2005-12-11 12:36         ` Vitaly Wool
2005-12-11 17:03           ` Vitaly Wool [this message]
2005-12-11 20:17             ` [spi-devel-general] " David Brownell
2005-12-11 22:13               ` Vitaly Wool
2005-12-11 23:54                 ` David Brownell
2005-12-12  7:09                   ` Vitaly Wool
2005-12-11 22:15               ` Vitaly Wool
2005-12-11 22:18               ` Vitaly Wool
  -- strict thread matches above, loose matches on Subject: below --
2005-12-03 17:10 Mark Underwood
2005-12-03 19:19 ` [spi-devel-general] " Vitaly Wool

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=439C5BE7.3030503@ru.mvista.com \
    --to=vwool@ru.mvista.com \
    --cc=Joachim_Jaeger@digi.com \
    --cc=akpm@osdl.org \
    --cc=basicmark@yahoo.com \
    --cc=david-b@pacbell.net \
    --cc=dpervushin@gmail.com \
    --cc=greg@kroah.com \
    --cc=komal_shah802003@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=stephen@streetfiresound.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