linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas: increase spi driver thread priority
@ 2009-04-02 21:44 Anna Neal
  2009-04-06 20:22 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Anna Neal @ 2009-04-02 21:44 UTC (permalink / raw)
  To: linux-wireless; +Cc: libertas-dev, dcbw, javier

Currently, the libertas main thread contends with the spi driver thread
in the TX path.  To improve throughput, ensure that the driver thread
has higher scheduling priority than the libertas main thread.  Do this
by making the libertas spi driver thread a low priority real time
thread.

We measured an average throughput improvement of 13%.

Signed-off-by: Anna Neal <anna@cozybit.com>
Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 07311e7..97493e2 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -1020,6 +1020,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 	struct libertas_spi_platform_data *pdata = spi->dev.platform_data;
 	int err = 0;
 	u32 scratch;
+	struct sched_param param = { .sched_priority = 1 };
 
 	lbs_deb_enter(LBS_DEB_SPI);
 
@@ -1123,6 +1124,9 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 		lbs_pr_err("error creating SPI thread: err=%d\n", err);
 		goto remove_card;
 	}
+	if (sched_setscheduler(card->spi_thread, SCHED_FIFO, &param))
+		lbs_pr_err("Error setting scheduler, using default.\n");
+
 	err = request_irq(spi->irq, if_spi_host_interrupt,
 			IRQF_TRIGGER_FALLING, "libertas_spi", card);
 	if (err) {
-- 
1.5.6.3




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libertas: increase spi driver thread priority
  2009-04-02 21:44 [PATCH] libertas: increase spi driver thread priority Anna Neal
@ 2009-04-06 20:22 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2009-04-06 20:22 UTC (permalink / raw)
  To: Anna Neal; +Cc: linux-wireless, libertas-dev, javier

On Thu, 2009-04-02 at 14:44 -0700, Anna Neal wrote:
> Currently, the libertas main thread contends with the spi driver thread
> in the TX path.  To improve throughput, ensure that the driver thread
> has higher scheduling priority than the libertas main thread.  Do this
> by making the libertas spi driver thread a low priority real time
> thread.
> 
> We measured an average throughput improvement of 13%.
> 
> Signed-off-by: Anna Neal <anna@cozybit.com>
> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>

Sure; looks fine to me.  

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/if_spi.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
> index 07311e7..97493e2 100644
> --- a/drivers/net/wireless/libertas/if_spi.c
> +++ b/drivers/net/wireless/libertas/if_spi.c
> @@ -1020,6 +1020,7 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  	struct libertas_spi_platform_data *pdata = spi->dev.platform_data;
>  	int err = 0;
>  	u32 scratch;
> +	struct sched_param param = { .sched_priority = 1 };
>  
>  	lbs_deb_enter(LBS_DEB_SPI);
>  
> @@ -1123,6 +1124,9 @@ static int __devinit if_spi_probe(struct spi_device *spi)
>  		lbs_pr_err("error creating SPI thread: err=%d\n", err);
>  		goto remove_card;
>  	}
> +	if (sched_setscheduler(card->spi_thread, SCHED_FIFO, &param))
> +		lbs_pr_err("Error setting scheduler, using default.\n");
> +
>  	err = request_irq(spi->irq, if_spi_host_interrupt,
>  			IRQF_TRIGGER_FALLING, "libertas_spi", card);
>  	if (err) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-06 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-02 21:44 [PATCH] libertas: increase spi driver thread priority Anna Neal
2009-04-06 20:22 ` Dan Williams

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).