* [PATCH 01/32] arm/omap: use system_wq in mailbox
[not found] <1294062595-30097-1-git-send-email-tj@kernel.org>
@ 2011-01-03 13:49 ` Tejun Heo
2011-01-03 21:35 ` Kanigeri, Hari
0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2011-01-03 13:49 UTC (permalink / raw)
To: linux-kernel; +Cc: Tejun Heo, Tony Lindgren, linux-omap
With cmwq, there's no reason to use a separate workqueue for mailbox.
Use the system_wq instead. mbox->rxq->work is sync flushed in
omap_mbox_fini() to make sure it's not running on any cpu, which makes
sure that no mbox work is running when omap_mbox_exit() is entered.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
---
Only compile tested. Please feel free to take it into the subsystem
tree or simply ack - I'll route it through the wq tree.
Thanks.
arch/arm/plat-omap/mailbox.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index d2fafb8..5bc4d7b 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -31,7 +31,6 @@
#include <plat/mailbox.h>
-static struct workqueue_struct *mboxd;
static struct omap_mbox **mboxes;
static bool rq_full;
@@ -186,7 +185,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
/* no more messages in the fifo. clear IRQ source. */
ack_mbox_irq(mbox, IRQ_RX);
nomem:
- queue_work(mboxd, &mbox->rxq->work);
+ schedule_work(&mbox->rxq->work);
}
static irqreturn_t mbox_interrupt(int irq, void *p)
@@ -291,7 +290,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
{
free_irq(mbox->irq, mbox);
tasklet_kill(&mbox->txq->tasklet);
- flush_work(&mbox->rxq->work);
+ flush_work_sync(&mbox->rxq->work);
mbox_queue_free(mbox->txq);
mbox_queue_free(mbox->rxq);
@@ -385,10 +384,6 @@ static int __init omap_mbox_init(void)
if (err)
return err;
- mboxd = create_workqueue("mboxd");
- if (!mboxd)
- return -ENOMEM;
-
/* kfifo size sanity check: alignment and minimal size */
mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t));
@@ -399,7 +394,6 @@ subsys_initcall(omap_mbox_init);
static void __exit omap_mbox_exit(void)
{
- destroy_workqueue(mboxd);
class_unregister(&omap_mbox_class);
}
module_exit(omap_mbox_exit);
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 01/32] arm/omap: use system_wq in mailbox
2011-01-03 13:49 ` [PATCH 01/32] arm/omap: use system_wq in mailbox Tejun Heo
@ 2011-01-03 21:35 ` Kanigeri, Hari
2011-01-04 5:24 ` Tejun Heo
0 siblings, 1 reply; 6+ messages in thread
From: Kanigeri, Hari @ 2011-01-03 21:35 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-kernel, Tony Lindgren, linux-omap
Tejun,
On Mon, Jan 3, 2011 at 7:49 AM, Tejun Heo <tj@kernel.org> wrote:
> With cmwq, there's no reason to use a separate workqueue for mailbox.
> Use the system_wq instead. mbox->rxq->work is sync flushed in
> omap_mbox_fini() to make sure it's not running on any cpu, which makes
> sure that no mbox work is running when omap_mbox_exit() is entered.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: linux-omap@vger.kernel.org
> ---
> Only compile tested. Please feel free to take it into the subsystem
> tree or simply ack - I'll route it through the wq tree.
This was changed to dedicated work queue because of performance issues
when there is heavy mailbox traffic between the cores.
Reference:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg24240.html
>
> Thanks.
>
> arch/arm/plat-omap/mailbox.c | 10 ++--------
> 1 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
> index d2fafb8..5bc4d7b 100644
> --- a/arch/arm/plat-omap/mailbox.c
> +++ b/arch/arm/plat-omap/mailbox.c
> @@ -31,7 +31,6 @@
>
> #include <plat/mailbox.h>
>
> -static struct workqueue_struct *mboxd;
> static struct omap_mbox **mboxes;
> static bool rq_full;
>
> @@ -186,7 +185,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
> /* no more messages in the fifo. clear IRQ source. */
> ack_mbox_irq(mbox, IRQ_RX);
> nomem:
> - queue_work(mboxd, &mbox->rxq->work);
> + schedule_work(&mbox->rxq->work);
> }
>
> static irqreturn_t mbox_interrupt(int irq, void *p)
> @@ -291,7 +290,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
> {
> free_irq(mbox->irq, mbox);
> tasklet_kill(&mbox->txq->tasklet);
> - flush_work(&mbox->rxq->work);
> + flush_work_sync(&mbox->rxq->work);
> mbox_queue_free(mbox->txq);
> mbox_queue_free(mbox->rxq);
>
> @@ -385,10 +384,6 @@ static int __init omap_mbox_init(void)
> if (err)
> return err;
>
> - mboxd = create_workqueue("mboxd");
> - if (!mboxd)
> - return -ENOMEM;
> -
> /* kfifo size sanity check: alignment and minimal size */
> mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
> mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, sizeof(mbox_msg_t));
> @@ -399,7 +394,6 @@ subsys_initcall(omap_mbox_init);
>
> static void __exit omap_mbox_exit(void)
> {
> - destroy_workqueue(mboxd);
> class_unregister(&omap_mbox_class);
> }
> module_exit(omap_mbox_exit);
> --
> 1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Thank you,
Best regards,
Hari Kanigeri
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 01/32] arm/omap: use system_wq in mailbox
2011-01-03 21:35 ` Kanigeri, Hari
@ 2011-01-04 5:24 ` Tejun Heo
2011-01-25 13:47 ` Tejun Heo
0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2011-01-04 5:24 UTC (permalink / raw)
To: Kanigeri, Hari; +Cc: linux-kernel, Tony Lindgren, linux-omap
Hello,
On Mon, Jan 03, 2011 at 03:35:45PM -0600, Kanigeri, Hari wrote:
> This was changed to dedicated work queue because of performance issues
> when there is heavy mailbox traffic between the cores.
>
> Reference:
> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg24240.html
Using dedicated workqueue or system_wq doesn't make any difference in
terms of execution latency anymore. Sleeping work items no longer
delay execution of other work items. If mailbox is very latency
sensitive, it might make sense to create a HIGHPRI workqueue but that
usually isn't necessary.
Thank you.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 01/32] arm/omap: use system_wq in mailbox
2011-01-04 5:24 ` Tejun Heo
@ 2011-01-25 13:47 ` Tejun Heo
2011-01-25 15:34 ` Hari Kanigeri
0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2011-01-25 13:47 UTC (permalink / raw)
To: Kanigeri, Hari; +Cc: linux-kernel, Tony Lindgren, linux-omap
On Tue, Jan 04, 2011 at 06:24:21AM +0100, Tejun Heo wrote:
> Using dedicated workqueue or system_wq doesn't make any difference in
> terms of execution latency anymore. Sleeping work items no longer
> delay execution of other work items. If mailbox is very latency
> sensitive, it might make sense to create a HIGHPRI workqueue but that
> usually isn't necessary.
Ping. Shall I apply the patch?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 01/32] arm/omap: use system_wq in mailbox
2011-01-25 13:47 ` Tejun Heo
@ 2011-01-25 15:34 ` Hari Kanigeri
2011-01-25 15:37 ` Tejun Heo
0 siblings, 1 reply; 6+ messages in thread
From: Hari Kanigeri @ 2011-01-25 15:34 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-kernel, Tony Lindgren, linux-omap
Tejun,
On Tue, Jan 25, 2011 at 5:47 AM, Tejun Heo <tj@kernel.org> wrote:
> On Tue, Jan 04, 2011 at 06:24:21AM +0100, Tejun Heo wrote:
>> Using dedicated workqueue or system_wq doesn't make any difference in
>> terms of execution latency anymore. Sleeping work items no longer
>> delay execution of other work items. If mailbox is very latency
>> sensitive, it might make sense to create a HIGHPRI workqueue but that
>> usually isn't necessary.
>
> Ping. Shall I apply the patch?
>
I am sorry for the delay in acking your response. Your patch looks good to me.
thank you,
best regards,
Hari
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 01/32] arm/omap: use system_wq in mailbox
2011-01-25 15:34 ` Hari Kanigeri
@ 2011-01-25 15:37 ` Tejun Heo
0 siblings, 0 replies; 6+ messages in thread
From: Tejun Heo @ 2011-01-25 15:37 UTC (permalink / raw)
To: Hari Kanigeri; +Cc: linux-kernel, Tony Lindgren, linux-omap
On Tue, Jan 25, 2011 at 07:34:08AM -0800, Hari Kanigeri wrote:
> Tejun,
>
> On Tue, Jan 25, 2011 at 5:47 AM, Tejun Heo <tj@kernel.org> wrote:
> > On Tue, Jan 04, 2011 at 06:24:21AM +0100, Tejun Heo wrote:
> >> Using dedicated workqueue or system_wq doesn't make any difference in
> >> terms of execution latency anymore. Sleeping work items no longer
> >> delay execution of other work items. If mailbox is very latency
> >> sensitive, it might make sense to create a HIGHPRI workqueue but that
> >> usually isn't necessary.
> >
> > Ping. Shall I apply the patch?
> >
> I am sorry for the delay in acking your response. Your patch looks good to me.
Thanks. Acked-by added.
--
tejun
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-01-25 15:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1294062595-30097-1-git-send-email-tj@kernel.org>
2011-01-03 13:49 ` [PATCH 01/32] arm/omap: use system_wq in mailbox Tejun Heo
2011-01-03 21:35 ` Kanigeri, Hari
2011-01-04 5:24 ` Tejun Heo
2011-01-25 13:47 ` Tejun Heo
2011-01-25 15:34 ` Hari Kanigeri
2011-01-25 15:37 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox