Re: lazy_buddy-2.5.25-1

From: William Lee Irwin III (wli@holomorphy.com)
Date: Thu Jul 11 2002 - 00:11:52 EST


On Wed, Jul 10, 2002 at 10:02:21PM -0700, William Lee Irwin III wrote:
> Even worse, I spotted another (thankfully more minor) bug while still
> peeking at this... okay, back to more urgent things.

I'm *not* having a good day. One parting shot and I really go back to
the other stuff:

> @@ -739,8 +739,8 @@
> for (pgdat = pgdat_list; pgdat; pgdat = pgdat->node_next) {
> node_zones = pgdat->node_zones;
> for (i = 0; i < MAX_NR_ZONES; ++i) {
> - for (order = 0; order < MAX_ORDER; ++order)
> - pages += node_zones[i].free_area[order].locally_free;
> + for (order = MAX_ORDER; order >= 0; --order)
> + pages = 2*pages + node_zones[i].free_area[order].locally_free;
> }
> }
> return pages;

forgets to start from 0 pages for each zone. Don't bother trying to be
smart and let the compiler figure it out, it's for /proc/meminfo anyway:

Cheers,
Bill

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.633 -> 1.634
# mm/page_alloc.c 1.128 -> 1.129
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/10 wli@tisifone.holomorphy.com 1.634
# page_alloc.c:
# Correct nr_deferred_pages() calculation.
# --------------------------------------------
#
diff --minimal -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c Wed Jul 10 22:12:14 2002
+++ b/mm/page_alloc.c Wed Jul 10 22:12:14 2002
@@ -740,7 +740,7 @@
                 node_zones = pgdat->node_zones;
                 for (i = 0; i < MAX_NR_ZONES; ++i) {
                         for (order = 0; order < MAX_ORDER; ++order)
- pages += node_zones[i].free_area[order].locally_free;
+ pages += node_zones[i].free_area[order].locally_free << order;
                 }
         }
         return pages;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:19 EST