linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@kvack.org>
To: kosaki <kosaki.motohiro@jp.fujitsu.com>
Cc: "Marcelo Tosatti" <marcelo@kvack.org>,
	linux-mm@kvack.org, "Daniel Sp蚣g" <daniel.spang@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Rik van Riel" <riel@redhat.com>
Subject: Re: [PATCH] mem notifications v2
Date: Thu, 22 Nov 2007 12:37:41 -0500	[thread overview]
Message-ID: <20071122173741.GA4990@dmt> (raw)
In-Reply-To: <20071122114532.E9E1.KOSAKI.MOTOHIRO@jp.fujitsu.com>

On Thu, Nov 22, 2007 at 12:07:32PM +0900, kosaki wrote:
> Hi Marcelo,
> 
> I am interesting your patch.
> 
> and I have some stupid question.
> please tell me.
> 
> 
> >  static struct class *mem_class;
> > --- linux-2.6.24-rc2-mm1.orig/include/linux/swap.h	2007-11-14 23:51:28.000000000 -0200
> > +++ linux-2.6.24-rc2-mm1/include/linux/swap.h	2007-11-21 15:40:23.000000000 -0200
> > @@ -169,6 +169,8 @@
> >  /* Definition of global_page_state not available yet */
> >  #define nr_free_pages() global_page_state(NR_FREE_PAGES)
> >  
> > +#define total_anon_pages() (global_page_state(NR_ANON_PAGES) \
> > +			    + total_swap_pages - total_swapcache_pages)
> 
> Why you use total_swap_pages?
> Are your intent watching swapon/spwapoff syscall? 
> 
> or, s/total_swapcache_pages/nr_swap_pages/ ?

Oops.

total_anon_pages() is supposed to return the total number of anonymous pages
(including swapped out ones), so that should be: 

#define total_anon_pages() (global_page_state(NR_ANON_PAGES) + \
                           (total_swap_pages-nr_swap_pages)  - \
                            total_swapcache_pages

> > @@ -1199,7 +1208,7 @@
> >  	throttle_vm_writeout(sc->gfp_mask);
> >  	return nr_reclaimed;
> >  }
> > -
> > + 
> >  /*
> >   * This is the direct reclaim path, for page-allocating processes.  We only
> >   * try to reclaim pages from zones which will satisfy the caller's allocation
> 
> cut here, please.

Fixed, thanks.

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-11-22 17:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-21 19:53 Marcelo Tosatti
2007-11-22  3:07 ` kosaki
2007-11-22 17:37   ` Marcelo Tosatti [this message]
2007-11-26 11:18     ` kosaki
2007-11-22 11:23 ` Daniel Spång
2007-11-22 20:47   ` Rik van Riel
2007-11-23  0:27     ` Daniel Spång
2007-11-23  0:36       ` Rik van Riel
2007-11-23 12:42         ` Daniel Spång

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071122173741.GA4990@dmt \
    --to=marcelo@kvack.org \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.spang@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox