Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Fri, 2007-11-09 at 14:33 +, Mel Gorman wrote: > Filtering zonelists requires very frequent use of zone_idx(). This is costly > as it involves a lookup of another structure and a substraction operation. As > the zone_idx is often required, it should be quickly accessible. The node > idx could also be stored here if it was found that accessing zone->node is > significant which may be the case on workloads where nodemasks are heavily > used. > > This patch introduces a struct zoneref to store a zone pointer and a zone > index. The zonelist then consists of an array of this struct zonerefs which > are looked up as necessary. Helpers are given for accessing the zone index > as well as the node index. > > [EMAIL PROTECTED]: Suggested struct zoneref instead of embedding information > in pointers] > Signed-off-by: Mel Gorman <[EMAIL PROTECTED]> > Acked-by: Christoph Lameter <[EMAIL PROTECTED]> > Acked-by: David Rientjes <[EMAIL PROTECTED]> > --- > > arch/parisc/mm/init.c |2 - > fs/buffer.c|6 ++-- > include/linux/mmzone.h | 64 +--- > include/linux/oom.h|4 +- > kernel/cpuset.c|4 +- > mm/hugetlb.c |3 +- > mm/mempolicy.c | 35 ++-- > mm/oom_kill.c | 45 +++--- > mm/page_alloc.c| 59 > mm/slab.c |2 - > mm/slub.c |2 - > mm/vmscan.c|7 ++-- > mm/vmstat.c|5 ++- > 13 files changed, 145 insertions(+), 93 deletions(-) > > diff -rup -X /usr/src/patchset-0.6/bin//dontdiff > linux-2.6.24-rc1-mm-010_use_two_zonelists/kernel/cpuset.c > linux-2.6.24-rc1-mm-020_zoneid_zonelist/kernel/cpuset.c > --- linux-2.6.24-rc1-mm-010_use_two_zonelists/kernel/cpuset.c 2007-10-24 > 04:50:57.0 +0100 > +++ linux-2.6.24-rc1-mm-020_zoneid_zonelist/kernel/cpuset.c 2007-11-08 > 19:18:27.0 + > @@ -1877,8 +1877,8 @@ int cpuset_zonelist_valid_mems_allowed(s > { > int i; > > - for (i = 0; zl->zones[i]; i++) { > - int nid = zone_to_nid(zl->zones[i]); > + for (i = 0; zl->_zonerefs[i].zone; i++) { > + int nid = zonelist_node_idx(zl->_zonerefs[i]); Should be: +int nid = zonelist_node_idx(>_zonerefs[i]); ^ else doesn't build. Stand by for testing... > > if (node_isset(nid, current->mems_allowed)) > return 1; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Fri, 2007-11-09 at 14:33 +, Mel Gorman wrote: Filtering zonelists requires very frequent use of zone_idx(). This is costly as it involves a lookup of another structure and a substraction operation. As the zone_idx is often required, it should be quickly accessible. The node idx could also be stored here if it was found that accessing zone-node is significant which may be the case on workloads where nodemasks are heavily used. This patch introduces a struct zoneref to store a zone pointer and a zone index. The zonelist then consists of an array of this struct zonerefs which are looked up as necessary. Helpers are given for accessing the zone index as well as the node index. [EMAIL PROTECTED]: Suggested struct zoneref instead of embedding information in pointers] Signed-off-by: Mel Gorman [EMAIL PROTECTED] Acked-by: Christoph Lameter [EMAIL PROTECTED] Acked-by: David Rientjes [EMAIL PROTECTED] --- arch/parisc/mm/init.c |2 - fs/buffer.c|6 ++-- include/linux/mmzone.h | 64 +--- include/linux/oom.h|4 +- kernel/cpuset.c|4 +- mm/hugetlb.c |3 +- mm/mempolicy.c | 35 ++-- mm/oom_kill.c | 45 +++--- mm/page_alloc.c| 59 mm/slab.c |2 - mm/slub.c |2 - mm/vmscan.c|7 ++-- mm/vmstat.c|5 ++- 13 files changed, 145 insertions(+), 93 deletions(-) snip diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.24-rc1-mm-010_use_two_zonelists/kernel/cpuset.c linux-2.6.24-rc1-mm-020_zoneid_zonelist/kernel/cpuset.c --- linux-2.6.24-rc1-mm-010_use_two_zonelists/kernel/cpuset.c 2007-10-24 04:50:57.0 +0100 +++ linux-2.6.24-rc1-mm-020_zoneid_zonelist/kernel/cpuset.c 2007-11-08 19:18:27.0 + @@ -1877,8 +1877,8 @@ int cpuset_zonelist_valid_mems_allowed(s { int i; - for (i = 0; zl-zones[i]; i++) { - int nid = zone_to_nid(zl-zones[i]); + for (i = 0; zl-_zonerefs[i].zone; i++) { + int nid = zonelist_node_idx(zl-_zonerefs[i]); Should be: +int nid = zonelist_node_idx(zl-_zonerefs[i]); ^ else doesn't build. Stand by for testing... if (node_isset(nid, current-mems_allowed)) return 1; snip - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Fri, 28 Sep 2007, Mel Gorman wrote: > > Filtering zonelists requires very frequent use of zone_idx(). This is costly > as it involves a lookup of another structure and a substraction operation. As > the zone_idx is often required, it should be quickly accessible. The node > idx could also be stored here if it was found that accessing zone->node is > significant which may be the case on workloads where nodemasks are heavily > used. > > This patch introduces a struct zoneref to store a zone pointer and a zone > index. The zonelist then consists of an array of this struct zonerefs which > are looked up as necessary. Helpers are given for accessing the zone index > as well as the node index. > > [EMAIL PROTECTED]: Suggested struct zoneref instead of embedding information > in pointers] > Signed-off-by: Mel Gorman <[EMAIL PROTECTED]> > Acked-by: Christoph Lameter <[EMAIL PROTECTED]> OOM locking looks good, thanks. Acked-by: David Rientjes <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Fri, 28 Sep 2007, Mel Gorman wrote: Filtering zonelists requires very frequent use of zone_idx(). This is costly as it involves a lookup of another structure and a substraction operation. As the zone_idx is often required, it should be quickly accessible. The node idx could also be stored here if it was found that accessing zone-node is significant which may be the case on workloads where nodemasks are heavily used. This patch introduces a struct zoneref to store a zone pointer and a zone index. The zonelist then consists of an array of this struct zonerefs which are looked up as necessary. Helpers are given for accessing the zone index as well as the node index. [EMAIL PROTECTED]: Suggested struct zoneref instead of embedding information in pointers] Signed-off-by: Mel Gorman [EMAIL PROTECTED] Acked-by: Christoph Lameter [EMAIL PROTECTED] OOM locking looks good, thanks. Acked-by: David Rientjes [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Wed, 12 Sep 2007, Mel Gorman wrote: > /* > + * This struct contains information about a zone in a zonelist. It is stored > + * here to avoid dereferences into large structures and lookups of tables > + */ > +struct zoneref { > + struct zone *zone; /* Pointer to actual zone */ > + int zone_idx; /* zone_idx(zoneref->zone) */ > +}; Well the structure is going to be 12 bytes wide. Since pointers have to be aligned to 8 bytes we will effectively have to use 16 bytes anyways. There is no additional memory use if we would be adding another 4 bytes. But lets get this merged. We can sort this out later. Too many oscillations already. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] Have zonelist contains structs with both a zone pointer and zone_idx
On Wed, 12 Sep 2007, Mel Gorman wrote: /* + * This struct contains information about a zone in a zonelist. It is stored + * here to avoid dereferences into large structures and lookups of tables + */ +struct zoneref { + struct zone *zone; /* Pointer to actual zone */ + int zone_idx; /* zone_idx(zoneref-zone) */ +}; Well the structure is going to be 12 bytes wide. Since pointers have to be aligned to 8 bytes we will effectively have to use 16 bytes anyways. There is no additional memory use if we would be adding another 4 bytes. But lets get this merged. We can sort this out later. Too many oscillations already. - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/