* mempool - only init waitqueue in slow path
@ 2005-05-13 15:50 Benjamin LaHaise
2005-05-14 6:26 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin LaHaise @ 2005-05-13 15:50 UTC (permalink / raw)
To: akpm; +Cc: linux-mm
Hello,
Here's a small patch to improve the performance of mempool_alloc by only
initializing the wait queue when we're about to wait.
-ben
--
"Time is what keeps everything from happening all at once." -- John Wheeler
Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
diff -purN v2.6.12-rc4/mm/mempool.c mempool-rc4/mm/mempool.c
--- v2.6.12-rc4/mm/mempool.c 2005-05-09 15:47:01.000000000 -0400
+++ mempool-rc4/mm/mempool.c 2005-05-13 10:04:54.000000000 -0400
@@ -197,7 +197,7 @@ void * mempool_alloc(mempool_t *pool, un
{
void *element;
unsigned long flags;
- DEFINE_WAIT(wait);
+ wait_queue_t wait;
int gfp_temp;
might_sleep_if(gfp_mask & __GFP_WAIT);
@@ -228,6 +228,7 @@ repeat_alloc:
/* Now start performing page reclaim */
gfp_temp = gfp_mask;
+ init_wait(&wait);
prepare_to_wait(&pool->wait, &wait, TASK_UNINTERRUPTIBLE);
smp_mb();
if (!pool->curr_nr)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mempool - only init waitqueue in slow path
2005-05-13 15:50 mempool - only init waitqueue in slow path Benjamin LaHaise
@ 2005-05-14 6:26 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-05-14 6:26 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: linux-mm
Benjamin LaHaise <bcrl@kvack.org> wrote:
>
> Here's a small patch to improve the performance of mempool_alloc by only
> initializing the wait queue when we're about to wait.
>
> -ben
> --
> "Time is what keeps everything from happening all at once." -- John Wheeler
>
> Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
> diff -purN v2.6.12-rc4/mm/mempool.c mempool-rc4/mm/mempool.c
> --- v2.6.12-rc4/mm/mempool.c 2005-05-09 15:47:01.000000000 -0400
> +++ mempool-rc4/mm/mempool.c 2005-05-13 10:04:54.000000000 -0400
> @@ -197,7 +197,7 @@ void * mempool_alloc(mempool_t *pool, un
> {
> void *element;
> unsigned long flags;
> - DEFINE_WAIT(wait);
> + wait_queue_t wait;
> int gfp_temp;
>
> might_sleep_if(gfp_mask & __GFP_WAIT);
> @@ -228,6 +228,7 @@ repeat_alloc:
>
> /* Now start performing page reclaim */
> gfp_temp = gfp_mask;
> + init_wait(&wait);
> prepare_to_wait(&pool->wait, &wait, TASK_UNINTERRUPTIBLE);
> smp_mb();
hmm, I'd have thought that gcc was smart enough to defer the
initialisations until the thing-which-is-being-initialised is about to be
used. But with gcc-3.4 this patch changes the generated asm in large ways.
Odd.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-14 6:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-13 15:50 mempool - only init waitqueue in slow path Benjamin LaHaise
2005-05-14 6:26 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox