linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
To: "'David Brownell'" <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Performance of spi_mpc83xx.c sucks.
Date: Tue, 2 Dec 2008 19:58:22 +0100	[thread overview]
Message-ID: <5099.64855523339$1228244405@news.gmane.org> (raw)
In-Reply-To: <200812021031.26711.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>

> -----Original Message-----
> From: David Brownell [mailto:david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org]
> Sent: den 2 december 2008 19:31
> To: Joakim Tjernlund
> Cc: 'Peter Korsgaard'; spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: Re: [spi-devel-general] Performance of spi_mpc83xx.c sucks.
> 
> On Tuesday 02 December 2008, Joakim Tjernlund wrote:
> >
> > >  Joakim> Won't polling for long periods starve user space? How to
> > >  Joakim> overcome this?
> > >
> > > I guess it won't be any worse than the processor being overloaded with
> > > interrupts - In fact it's better, as there's more real work done.
> >
> > It gets the work done faster but will starve everyone else in the process.
> > The IRQ version doesn't do that.
> 
> I've not observed polling from a task context to starve anyone,
> when done sanely.  The opposite is true for doing an order of
> magnitude more instructions in IRQ context ...

When playing with this the app developer complained that the system didn't
behave as expected so I guessed it had to do with starvation. Perhaps
lowering the prio or something would be a wise thing to do? Or is the thread
already at lower prio than normal userspace processes?

I guess you are not keen on a LOWLAT option for SPI transfers?

We a app that needs to do protection(in its own RT pthread) so any SPI
transfers should be performed as quickly as possible when the protection
thread is running, for the rest speed it doesn't matter.

> 
> > >  Joakim> Why use a kernel thread(mpc83xx_spi.0) to do the work?  Would
> > >  Joakim> it not be better if the polling was in process context?
> > >
> > > I guess that's needed for the async stuff.
> >
> > hmm, yes that sounds reasonable.
> 
> Doesn't sound so to me.  Recall that if you have four chipselects,
> the driver using each chip can submit its own request ... *EVERY*
> request made to the controller driver is async, entering a queue
> and coming out when it's done.

I see, so leave thread alone :)

 Jocke


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

  parent reply	other threads:[~2008-12-02 18:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 16:19 Performance of spi_mpc83xx.c sucks Joakim Tjernlund
     [not found] ` <1224605947.14078.17.camel-/EMGr9iCeazgSi9v3i4K4Pmbkio/vSLMs0AfqQuZ5sE@public.gmane.org>
2008-10-21 18:14   ` Peter Korsgaard
     [not found]     ` <877i81rf2g.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2008-10-21 18:31       ` Joakim Tjernlund
     [not found]     ` <002f01c933ab$4bee9180$e3cbb480$@Tjernlund@transmode.se>
     [not found]       ` <002f01c933ab$4bee9180$e3cbb480$@Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2008-11-21  4:10         ` David Brownell
     [not found]           ` <200811202010.30845.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-12-02 15:20             ` Joakim Tjernlund
     [not found]               ` <1228231118.9867.108.camel-/EMGr9iCeazgSi9v3i4K4Pmbkio/vSLMs0AfqQuZ5sE@public.gmane.org>
2008-12-02 16:23                 ` Peter Korsgaard
     [not found]                   ` <87d4gav94h.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2008-12-02 18:20                     ` Joakim Tjernlund
     [not found]                   ` <040001c954aa$a00e3930$e02aab90$@Tjernlund@transmode.se>
     [not found]                     ` <040001c954aa$a00e3930$e02aab90$@Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2008-12-02 18:31                       ` David Brownell
     [not found]                         ` <200812021031.26711.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-12-02 18:58                           ` Joakim Tjernlund [this message]
     [not found]                         ` <041201c954af$f32ad3d0$d9807b70$@Tjernlund@transmode.se>
     [not found]                           ` <041201c954af$f32ad3d0$d9807b70$@Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2008-12-02 20:46                             ` David Brownell
     [not found]                               ` <200812021246.27884.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-12-02 22:12                                 ` Joakim Tjernlund
     [not found]                               ` <041e01c954cb$15c0f030$4142d090$@Tjernlund@transmode.se>
     [not found]                                 ` <041e01c954cb$15c0f030$4142d090$@Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2008-12-03  8:56                                   ` David Brownell
2008-12-02 18:17                 ` David Brownell
     [not found]                   ` <200812021017.11880.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-12-02 18:25                     ` Joakim Tjernlund
     [not found]                   ` <040601c954ab$554cff20$ffe6fd60$@Tjernlund@transmode.se>
     [not found]                     ` <040601c954ab$554cff20$ffe6fd60$@Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2008-12-02 19:10                       ` 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='5099.64855523339$1228244405@news.gmane.org' \
    --to=joakim.tjernlund-snlaxhn9vbcop4wsbpiw7w@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).