[patch-2.3.44-pre3] corrected comments on kswapd (was Re: kswapd (simple) question)

From: Tigran Aivazian (tigran@sco.COM)
Date: Fri Feb 11 2000 - 06:36:39 EST


On Thu, 10 Feb 2000, Rik van Riel wrote:
> On Thu, 10 Feb 2000, Tigran Aivazian wrote:
> > The comments in mm/vmscan.c:kswapd() say "wake up once a second" but I
> > cannot see any timers setup there - all I see is a simple sleep/wakeup
> > relationship with mm/page_alloc.c:__alloc_pages(). What am I missing?
>
> Which kernel version?
>
> I know that in most kernels kswapd _will_ wake up all by
> itself...

I was looking at 2.3.43-pre8 but that is history now, so assume I was
talking about 2.3.44-pre3.

Anyway, I put a printk() in kswapd() just before it goes to sleep
and before it does the work showing the jiffies value and proved that it
does *NOT* go to sleep every second so the comments are wrong. Here is the
patch (and cc:Linus)

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

--- vmscan.c.0 Fri Feb 11 10:21:29 2000
+++ vmscan.c Fri Feb 11 10:26:33 2000
@@ -457,12 +457,11 @@
  * The background pageout daemon, started as a kernel thread
  * from the init process.
  *
- * This basically executes once a second, trickling out pages
- * so that we have _some_ free memory available even if there
- * is no other activity that frees anything up. This is needed
- * for things like routing etc, where we otherwise might have
- * all activity going on in asynchronous contexts that cannot
- * page things out.
+ * This basically trickles out pages so that we have _some_
+ * free memory available even if there is no other activity
+ * that frees anything up. This is needed for things like routing
+ * etc, where we otherwise might have all activity going on in
+ * asynchronous contexts that cannot page things out.
  *
  * If there are applications that are active memory-allocators
  * (most normal use), this basically shouldn't matter.
@@ -479,7 +478,7 @@
         /*
          * Tell the memory management that we're a "memory allocator",
          * and that if we need more memory we should get access to it
- * regardless (see "__get_free_pages()"). "kswapd" should
+ * regardless (see "__alloc_pages()"). "kswapd" should
          * never get caught in the normal page freeing logic.
          *
          * (Kswapd normally doesn't need memory anyway, but sometimes
@@ -492,9 +491,6 @@
 
         while (1) {
                 /*
- * Wake up once a second to see if we need to make
- * more memory available.
- *
                  * If we actually get into a low-memory situation,
                  * the processes needing more memory will wake us
                  * up on a more timely basis.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:20 EST