linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: Memory pressure handling with iSCSI
Date: Tue, 26 Jul 2005 18:40:42 -0700	[thread overview]
Message-ID: <20050726184042.439e336f.akpm@osdl.org> (raw)
In-Reply-To: <1122427889.6433.71.camel@dyn9047017102.beaverton.ibm.com>

Badari Pulavarty <pbadari@us.ibm.com> wrote:
>
> > This machine only has 4G of memory, so the platform code is overestimating
> > the number of pages by 50%.  Can you please check your dmesg, see if your
> > system is also getting this wrong?
> 
> 
> 
> On node 0 totalpages: 1572863
>   DMA zone: 4096 pages, LIFO batch:1
>   Normal zone: 1568767 pages, LIFO batch:31
>   HighMem zone: 0 pages, LIFO batch:1
> On node 1 totalpages: 131071
>   DMA zone: 0 pages, LIFO batch:1
>   Normal zone: 131071 pages, LIFO batch:31
>   HighMem zone: 0 pages, LIFO batch:1
> On node 2 totalpages: 131071
>   DMA zone: 0 pages, LIFO batch:1
>   Normal zone: 131071 pages, LIFO batch:31
>   HighMem zone: 0 pages, LIFO batch:1
> On node 3 totalpages: 131071
>   DMA zone: 0 pages, LIFO batch:1
>   Normal zone: 131071 pages, LIFO batch:31
>   HighMem zone: 0 pages, LIFO batch:1

That's 7.7GB, yes?   On a 6GB machine?

If so, that's a bit off, but not grossly.

Here's the dopey debug patch which I used:

- boot
- dmesg -s 1000000 | grep total_pages > foo
- kill off syslogd  (sudo service syslog stop)
- run the dd command
- wait for it to hit steady state (max dirty memory)
- dmesg -s 1000000 >> foo

diff -puN mm/page-writeback.c~a mm/page-writeback.c
--- 25/mm/page-writeback.c~a	2005-07-26 15:53:46.000000000 -0700
+++ 25-akpm/mm/page-writeback.c	2005-07-26 16:21:55.000000000 -0700
@@ -161,7 +161,8 @@ get_dirty_limits(struct writeback_state 
 	dirty_ratio = vm_dirty_ratio;
 	if (dirty_ratio > unmapped_ratio / 2)
 		dirty_ratio = unmapped_ratio / 2;
-
+	printk("vm_dirty_ratio=%d unmapped_ratio=%d dirty_ratio=%d\n",
+		vm_dirty_ratio, unmapped_ratio, dirty_ratio);
 	if (dirty_ratio < 5)
 		dirty_ratio = 5;
 
@@ -171,6 +172,8 @@ get_dirty_limits(struct writeback_state 
 
 	background = (background_ratio * available_memory) / 100;
 	dirty = (dirty_ratio * available_memory) / 100;
+	printk("dirty_ratio=%d available_memory=%lu dirty=%lu\n",
+		dirty_ratio, available_memory, dirty);
 	tsk = current;
 	if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) {
 		background += background / 4;
@@ -209,6 +212,12 @@ static void balance_dirty_pages(struct a
 		get_dirty_limits(&wbs, &background_thresh,
 					&dirty_thresh, mapping);
 		nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable;
+		printk("background_thresh=%ld dirty_thresh=%ld "
+				"nr_dirty=%ld nr_unstable=%ld "
+				"nr_reclaimable=%ld wbs.nr_writeback=%ld\n",
+			background_thresh, dirty_thresh,
+			wbs.nr_dirty, wbs.nr_unstable,
+			nr_reclaimable, wbs.nr_writeback);
 		if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh)
 			break;
 
@@ -532,6 +541,8 @@ void __init page_writeback_init(void)
 
 	total_pages = nr_free_pagecache_pages();
 
+	printk("total_pages=%ld\n", total_pages);
+
 	correction = (100 * 4 * buffer_pages) / total_pages;
 
 	if (correction < 100) {
_

--
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:[~2005-07-27  1:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26 17:35 Badari Pulavarty
2005-07-26 18:04 ` Roland Dreier
2005-07-26 18:11 ` Andrew Morton
2005-07-26 18:39   ` Badari Pulavarty
2005-07-26 18:48     ` Andrew Morton
2005-07-26 19:12       ` Andrew Morton
2005-07-26 20:36         ` Badari Pulavarty
2005-07-26 21:11         ` Badari Pulavarty
2005-07-26 21:24           ` Andrew Morton
2005-07-26 21:45             ` Badari Pulavarty
2005-07-26 22:10               ` Andrew Morton
2005-07-26 22:48                 ` Badari Pulavarty
2005-07-26 23:07                   ` Andrew Morton
2005-07-26 23:26                     ` Badari Pulavarty
2005-07-27  0:31                       ` Andrew Morton
2005-07-27  1:20                         ` Martin J. Bligh
2005-07-27  1:26                           ` Andrew Morton
2005-07-27  1:47                             ` Martin J. Bligh
2005-07-27  1:31                         ` Badari Pulavarty
2005-07-27  1:40                           ` Andrew Morton [this message]
2005-07-26 19:31     ` Sonny Rao
2005-07-26 20:37       ` Badari Pulavarty
2005-07-26 21:21         ` Andrew Morton
2005-07-26 20:59 ` Rik van Riel
2005-07-26 21:05   ` Badari Pulavarty
2005-07-26 21:33     ` Martin J. Bligh
2005-07-26 22:05       ` Adam Litke
2005-07-26 21:12   ` Andrew Morton

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=20050726184042.439e336f.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pbadari@us.ibm.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