2001-10-04 20:20:20

by Marcelo Tosatti

[permalink] [raw]
Subject: [PATCH] Add information to SysRq+M output


Hi,

Here goes a patch, against 2.4.10pre3, which adds very useful information
to Alt+SysRq+M: it prints per-zone free information (freepages,
freepages.min, freepages.low, freepages.high).

Linus, pleasy apply.

--- linux/mm/page_alloc.c.orig Thu Oct 4 17:18:00 2001
+++ linux/mm/page_alloc.c Thu Oct 4 17:18:12 2001
@@ -515,6 +515,30 @@
{
unsigned int order;
unsigned type;
+ pg_data_t *tmpdat = pgdat;
+
+ printk("Free pages: %6dkB (%6dkB HighMem)\n",
+ nr_free_pages() << (PAGE_SHIFT-10),
+ nr_free_highpages() << (PAGE_SHIFT-10));
+
+ while (tmpdat) {
+ zone_t *zone;
+ for (zone = tmpdat->node_zones;
+ zone < tmpdat->node_zones + MAX_NR_ZONES; zone++)
+ printk("Zone:%s freepages:%6dkB min:%6dKB low:%6dkB "
+ "high:%6dkB\n",
+ zone->name,
+ (zone->free_pages)
+ << ((PAGE_SHIFT-10)),
+ zone->pages_min
+ << ((PAGE_SHIFT-10)),
+ zone->pages_low
+ << ((PAGE_SHIFT-10)),
+ zone->pages_high
+ << ((PAGE_SHIFT-10)));
+
+ tmpdat = tmpdat->node_next;
+ }

printk("Free pages: %6dkB (%6dkB HighMem)\n",
nr_free_pages() << (PAGE_SHIFT-10),


2001-10-04 20:25:00

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [PATCH] Add information to SysRq+M output



On Thu, 4 Oct 2001, Marcelo Tosatti wrote:

>
> Hi,
>
> Here goes a patch, against 2.4.10pre3, which adds very useful information
^^ ^

I menan 2.4.11pre3, obviously.