Re: kswapd's priority

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Sat, 27 Jun 1998 07:12:09 +0200 (CEST)


On Fri, 26 Jun 1998, MOLNAR Ingo wrote:
> On Fri, 26 Jun 1998, Rik van Riel wrote:
>
> > They don't. All try_to_free_page() calls are made with
> > WAIT=0. [...]
>
> mm.h:#define __GFP_WAIT 0x01
> mm.h:#define GFP_BUFFER (__GFP_LOW | __GFP_WAIT)
> mm.h:#define GFP_USER (__GFP_LOW | __GFP_WAIT | __GFP_IO)
> mm.h:#define GFP_KERNEL (__GFP_LOW | __GFP_WAIT | __GFP_IO)
> mm.h:#define GFP_NFS (__GFP_MED | __GFP_WAIT | __GFP_IO)
>
> in all these cases we wait definitely for the first swapout(s) to finish

Please apply this patch to resolve a little performance
problem with in-context swapouts... The fact that
run_task_queue(&tq_disk) isn't called is intentional.
We only free memory when we're low on memory and kswapd
will run soon anyway.
Not doing the sync means that we'll be holding the kernel
lock for a shorter period and that the process will get
it's memory quicker. It is _very_ likely that we will have
freed some clean pages anyway; only the pages on which we
need to do I/O are queued up for kswapd.
Maybe we need to wake up kswapd from here?

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

--- mm/page_alloc.c.orig Sat Jun 27 06:58:50 1998
+++ mm/page_alloc.c Sat Jun 27 07:00:35 1998
@@ -280,9 +280,9 @@
spin_unlock_irqrestore(&page_alloc_lock, flags);
if (!(gfp_mask & __GFP_WAIT))
break;
+ gfp_mask &= ~__GFP_WAIT; /* go through this only once */
if (!try_to_free_pages(gfp_mask, SWAP_CLUSTER_MAX))
break;
- gfp_mask &= ~__GFP_WAIT; /* go through this only once */
maxorder = NR_MEM_LISTS; /* Allow anything this time */
}
nopage:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu