All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: linux-mm@kvack.org, jschopp@austin.ibm.com,
	linux-kernel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com,
	lhms-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/4] Split the free lists into kernel and user parts
Date: Mon, 23 Jan 2006 13:13:41 -0600	[thread overview]
Message-ID: <20060123191341.GA4892@dmt.cnet> (raw)
In-Reply-To: <Pine.LNX.4.58.0601230937200.11319@skynet>

On Mon, Jan 23, 2006 at 09:39:16AM +0000, Mel Gorman wrote:
> On Sun, 22 Jan 2006, Marcelo Tosatti wrote:
> 
> > Hi Mel,
> >
> > On Fri, Jan 20, 2006 at 11:54:55AM +0000, Mel Gorman wrote:
> > >
> > > This patch adds the core of the anti-fragmentation strategy. It works by
> > > grouping related allocation types together. The idea is that large groups of
> > > pages that may be reclaimed are placed near each other. The zone->free_area
> > > list is broken into RCLM_TYPES number of lists.
> > >
> > > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> > > Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
> > > diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/mmzone.h linux-2.6.16-rc1-mm1-002_fragcore/include/linux/mmzone.h
> > > --- linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/mmzone.h	2006-01-19 11:21:59.000000000 +0000
> > > +++ linux-2.6.16-rc1-mm1-002_fragcore/include/linux/mmzone.h	2006-01-19 21:51:05.000000000 +0000
> > > @@ -22,8 +22,16 @@
> > >  #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
> > >  #endif
> > >
> > > +#define RCLM_NORCLM 0
> > > +#define RCLM_EASY   1
> > > +#define RCLM_TYPES  2
> > > +
> > > +#define for_each_rclmtype_order(type, order) \
> > > +	for (order = 0; order < MAX_ORDER; order++) \
> > > +		for (type = 0; type < RCLM_TYPES; type++)
> > > +
> > >  struct free_area {
> > > -	struct list_head	free_list;
> > > +	struct list_head	free_list[RCLM_TYPES];
> > >  	unsigned long		nr_free;
> > >  };
> > >
> > > diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/page-flags.h linux-2.6.16-rc1-mm1-002_fragcore/include/linux/page-flags.h
> > > --- linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/page-flags.h	2006-01-19 11:21:59.000000000 +0000
> > > +++ linux-2.6.16-rc1-mm1-002_fragcore/include/linux/page-flags.h	2006-01-19 21:51:05.000000000 +0000
> > > @@ -76,6 +76,7 @@
> > >  #define PG_reclaim		17	/* To be reclaimed asap */
> > >  #define PG_nosave_free		18	/* Free, should not be written */
> > >  #define PG_uncached		19	/* Page has been mapped as uncached */
> > > +#define PG_easyrclm		20	/* Page is in an easy reclaim block */
> > >
> > >  /*
> > >   * Global page accounting.  One instance per CPU.  Only unsigned longs are
> > > @@ -345,6 +346,12 @@ extern void __mod_page_state_offset(unsi
> > >  #define SetPageUncached(page)	set_bit(PG_uncached, &(page)->flags)
> > >  #define ClearPageUncached(page)	clear_bit(PG_uncached, &(page)->flags)
> > >
> > > +#define PageEasyRclm(page)	test_bit(PG_easyrclm, &(page)->flags)
> > > +#define SetPageEasyRclm(page)	set_bit(PG_easyrclm, &(page)->flags)
> > > +#define ClearPageEasyRclm(page)	clear_bit(PG_easyrclm, &(page)->flags)
> > > +#define __SetPageEasyRclm(page)	__set_bit(PG_easyrclm, &(page)->flags)
> > > +#define __ClearPageEasyRclm(page) __clear_bit(PG_easyrclm, &(page)->flags)
> > > +
> >
> > You can't read/write to page->flags non-atomically, except when you
> > guarantee that the page is not visible to other CPU's (eg at the very
> > end of the page freeing code).
> >
> 
> The helper PageEasyRclm is only used when either the spinlock is held or a
> per-cpu page is being released so it should be safe. The Set and Clear
> helpers are only used with a spinlock held.

Mel,

Other codepaths which touch page->flags do not hold any lock, so you
really must use atomic operations, except when you've guarantee that the
page is being freed and won't be reused.



WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: linux-mm@kvack.org, jschopp@austin.ibm.com,
	linux-kernel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com,
	lhms-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/4] Split the free lists into kernel and user parts
Date: Mon, 23 Jan 2006 13:13:41 -0600	[thread overview]
Message-ID: <20060123191341.GA4892@dmt.cnet> (raw)
In-Reply-To: <Pine.LNX.4.58.0601230937200.11319@skynet>

On Mon, Jan 23, 2006 at 09:39:16AM +0000, Mel Gorman wrote:
> On Sun, 22 Jan 2006, Marcelo Tosatti wrote:
> 
> > Hi Mel,
> >
> > On Fri, Jan 20, 2006 at 11:54:55AM +0000, Mel Gorman wrote:
> > >
> > > This patch adds the core of the anti-fragmentation strategy. It works by
> > > grouping related allocation types together. The idea is that large groups of
> > > pages that may be reclaimed are placed near each other. The zone->free_area
> > > list is broken into RCLM_TYPES number of lists.
> > >
> > > Signed-off-by: Mel Gorman <mel@csn.ul.ie>
> > > Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
> > > diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/mmzone.h linux-2.6.16-rc1-mm1-002_fragcore/include/linux/mmzone.h
> > > --- linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/mmzone.h	2006-01-19 11:21:59.000000000 +0000
> > > +++ linux-2.6.16-rc1-mm1-002_fragcore/include/linux/mmzone.h	2006-01-19 21:51:05.000000000 +0000
> > > @@ -22,8 +22,16 @@
> > >  #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
> > >  #endif
> > >
> > > +#define RCLM_NORCLM 0
> > > +#define RCLM_EASY   1
> > > +#define RCLM_TYPES  2
> > > +
> > > +#define for_each_rclmtype_order(type, order) \
> > > +	for (order = 0; order < MAX_ORDER; order++) \
> > > +		for (type = 0; type < RCLM_TYPES; type++)
> > > +
> > >  struct free_area {
> > > -	struct list_head	free_list;
> > > +	struct list_head	free_list[RCLM_TYPES];
> > >  	unsigned long		nr_free;
> > >  };
> > >
> > > diff -rup -X /usr/src/patchset-0.5/bin//dontdiff linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/page-flags.h linux-2.6.16-rc1-mm1-002_fragcore/include/linux/page-flags.h
> > > --- linux-2.6.16-rc1-mm1-001_antifrag_flags/include/linux/page-flags.h	2006-01-19 11:21:59.000000000 +0000
> > > +++ linux-2.6.16-rc1-mm1-002_fragcore/include/linux/page-flags.h	2006-01-19 21:51:05.000000000 +0000
> > > @@ -76,6 +76,7 @@
> > >  #define PG_reclaim		17	/* To be reclaimed asap */
> > >  #define PG_nosave_free		18	/* Free, should not be written */
> > >  #define PG_uncached		19	/* Page has been mapped as uncached */
> > > +#define PG_easyrclm		20	/* Page is in an easy reclaim block */
> > >
> > >  /*
> > >   * Global page accounting.  One instance per CPU.  Only unsigned longs are
> > > @@ -345,6 +346,12 @@ extern void __mod_page_state_offset(unsi
> > >  #define SetPageUncached(page)	set_bit(PG_uncached, &(page)->flags)
> > >  #define ClearPageUncached(page)	clear_bit(PG_uncached, &(page)->flags)
> > >
> > > +#define PageEasyRclm(page)	test_bit(PG_easyrclm, &(page)->flags)
> > > +#define SetPageEasyRclm(page)	set_bit(PG_easyrclm, &(page)->flags)
> > > +#define ClearPageEasyRclm(page)	clear_bit(PG_easyrclm, &(page)->flags)
> > > +#define __SetPageEasyRclm(page)	__set_bit(PG_easyrclm, &(page)->flags)
> > > +#define __ClearPageEasyRclm(page) __clear_bit(PG_easyrclm, &(page)->flags)
> > > +
> >
> > You can't read/write to page->flags non-atomically, except when you
> > guarantee that the page is not visible to other CPU's (eg at the very
> > end of the page freeing code).
> >
> 
> The helper PageEasyRclm is only used when either the spinlock is held or a
> per-cpu page is being released so it should be safe. The Set and Clear
> helpers are only used with a spinlock held.

Mel,

Other codepaths which touch page->flags do not hold any lock, so you
really must use atomic operations, except when you've guarantee that the
page is being freed and won't be reused.


--
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:[~2006-01-24 21:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-20 11:54 [PATCH 0/4] Reducing fragmentation using lists (sub-zones) v22 Mel Gorman
2006-01-20 11:54 ` Mel Gorman
2006-01-20 11:54 ` [PATCH 1/4] Add __GFP_EASYRCLM flag and update callers Mel Gorman
2006-01-20 11:54   ` Mel Gorman
2006-01-20 11:54 ` [PATCH 2/4] Split the free lists into kernel and user parts Mel Gorman
2006-01-20 11:54   ` Mel Gorman
2006-01-22 13:31   ` Marcelo Tosatti
2006-01-22 13:31     ` Marcelo Tosatti
2006-01-23  9:39     ` Mel Gorman
2006-01-23  9:39       ` Mel Gorman
2006-01-23 19:13       ` Marcelo Tosatti [this message]
2006-01-23 19:13         ` Marcelo Tosatti
2006-01-26 15:55         ` Mel Gorman
2006-01-26 15:55           ` Mel Gorman
2006-01-31 19:57           ` Marcelo Tosatti
2006-02-05  8:57   ` Coywolf Qi Hunt
2006-02-05  8:57     ` Coywolf Qi Hunt
2006-02-05  9:12     ` Coywolf Qi Hunt
2006-02-05  9:12       ` Coywolf Qi Hunt
2006-01-20 11:55 ` [PATCH 3/4] Split the per-cpu " Mel Gorman
2006-01-20 11:55   ` Mel Gorman
2006-01-20 11:55 ` [PATCH 4/4] Add a configure option for anti-fragmentation Mel Gorman
2006-01-20 11:55   ` Mel Gorman

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=20060123191341.GA4892@dmt.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=jschopp@austin.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /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 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.