* [Kernel-janitors] [PATCH] base/dmapool: replace schedule_timeout()
@ 2004-09-15 18:32 Nishanth Aravamudan
2004-09-21 21:14 ` [Kernel-janitors] [PATCH] base/dmapool: replace maximilian attems
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Aravamudan @ 2004-09-15 18:32 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]
Any comments would be appreciated.
Description: msleep_interruptible() is used instead of schedule_timeout()
to guarantee the task delays as expected. To achieve this, the timeout
variable is converted from jiffies to msecs. Also, set_current_state()
is used instead of direct assignment.
--- 2.6.9-rc2-vanilla/drivers/base/dmapool.c 2004-09-13 17:15:46.000000000 -0700
+++ 2.6.9-rc2/drivers/base/dmapool.c 2004-09-14 11:37:07.000000000 -0700
@@ -34,7 +34,7 @@ struct dma_page { /* cacheable header fo
unsigned long bitmap [0];
};
-#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000)
+#define POOL_TIMEOUT_MSECS (100) /* msec */
#define POOL_POISON_FREED 0xa7 /* !inuse */
#define POOL_POISON_ALLOCATED 0xa9 /* !initted */
@@ -293,11 +293,11 @@ restart:
if (mem_flags & __GFP_WAIT) {
DECLARE_WAITQUEUE (wait, current);
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state (TASK_INTERRUPTIBLE);
add_wait_queue (&pool->waitq, &wait);
spin_unlock_irqrestore (&pool->lock, flags);
- schedule_timeout (POOL_TIMEOUT_JIFFIES);
+ msleep_interruptible(POOL_TIMEOUT_MSECS);
remove_wait_queue (&pool->waitq, &wait);
goto restart;
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Kernel-janitors] [PATCH] base/dmapool: replace
2004-09-15 18:32 [Kernel-janitors] [PATCH] base/dmapool: replace schedule_timeout() Nishanth Aravamudan
@ 2004-09-21 21:14 ` maximilian attems
0 siblings, 0 replies; 2+ messages in thread
From: maximilian attems @ 2004-09-21 21:14 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]
On Wed, 15 Sep 2004, Nishanth Aravamudan wrote:
> Any comments would be appreciated.
>
> Description: msleep_interruptible() is used instead of schedule_timeout()
> to guarantee the task delays as expected. To achieve this, the timeout
> variable is converted from jiffies to msecs. Also, set_current_state()
> is used instead of direct assignment.
>
> --- 2.6.9-rc2-vanilla/drivers/base/dmapool.c 2004-09-13 17:15:46.000000000 -0700
> +++ 2.6.9-rc2/drivers/base/dmapool.c 2004-09-14 11:37:07.000000000 -0700
> @@ -34,7 +34,7 @@ struct dma_page { /* cacheable header fo
> unsigned long bitmap [0];
> };
>
> -#define POOL_TIMEOUT_JIFFIES ((100 /* msec */ * HZ) / 1000)
> +#define POOL_TIMEOUT_MSECS (100) /* msec */
> #define POOL_POISON_FREED 0xa7 /* !inuse */
> #define POOL_POISON_ALLOCATED 0xa9 /* !initted */
>
> @@ -293,11 +293,11 @@ restart:
> if (mem_flags & __GFP_WAIT) {
> DECLARE_WAITQUEUE (wait, current);
>
> - current->state = TASK_INTERRUPTIBLE;
> + set_current_state (TASK_INTERRUPTIBLE);
> add_wait_queue (&pool->waitq, &wait);
> spin_unlock_irqrestore (&pool->lock, flags);
>
> - schedule_timeout (POOL_TIMEOUT_JIFFIES);
> + msleep_interruptible(POOL_TIMEOUT_MSECS);
>
> remove_wait_queue (&pool->waitq, &wait);
> goto restart;
added include for kjt.
a++ maks
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-21 21:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 18:32 [Kernel-janitors] [PATCH] base/dmapool: replace schedule_timeout() Nishanth Aravamudan
2004-09-21 21:14 ` [Kernel-janitors] [PATCH] base/dmapool: replace maximilian attems
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.