linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [rtf] [patch] 2.3.99-pre6-3 overly swappy
@ 2000-04-20 19:43 Ben LaHaise
  2000-04-20 20:13 ` Rik van Riel
  2000-04-21  0:25 ` Juan J. Quintela
  0 siblings, 2 replies; 6+ messages in thread
From: Ben LaHaise @ 2000-04-20 19:43 UTC (permalink / raw)
  To: linux-mm; +Cc: torvalds

The balance between swap and shrink_mmap was upset by the recent per-zone
changes: kswapd wakeups now call swap_out 3 times as much as before,
resulting in increased page faults and swap out activity, especially
under heavy io.  This patch seems to help quite a bit -- can other people
give this a try?

		-ben

diff -ur 2.3.99-pre6-3/mm/vmscan.c linux-test/mm/vmscan.c
--- 2.3.99-pre6-3/mm/vmscan.c	Wed Apr 12 14:39:50 2000
+++ linux-test/mm/vmscan.c	Thu Apr 20 15:12:17 2000
@@ -408,7 +408,7 @@
  * cluster them so that we get good swap-out behaviour. See
  * the "free_memory()" macro for details.
  */
-static int do_try_to_free_pages(unsigned int gfp_mask, zone_t *zone)
+static int do_try_to_free_pages(unsigned int gfp_mask, zone_t *zone, int do_swap)
 {
 	int priority;
 	int count = SWAP_CLUSTER_MAX;
@@ -423,6 +423,8 @@
 				goto done;
 		}
 
+		if (!do_swap)
+			continue;
 
 		/* Try to get rid of some shared memory pages.. */
 		if (gfp_mask & __GFP_IO) {
@@ -507,7 +509,7 @@
 					schedule();
 				if ((!zone->size) || (!zone->zone_wake_kswapd))
 					continue;
-				do_try_to_free_pages(GFP_KSWAPD, zone);
+				do_try_to_free_pages(GFP_KSWAPD, zone, i == (MAX_NR_ZONES - 1));
 			}
 			pgdat = pgdat->node_next;
 		}
@@ -538,7 +540,7 @@
 
 	if (gfp_mask & __GFP_WAIT) {
 		current->flags |= PF_MEMALLOC;
-		retval = do_try_to_free_pages(gfp_mask, zone);
+		retval = do_try_to_free_pages(gfp_mask, zone, 1);
 		current->flags &= ~PF_MEMALLOC;
 	}
 	return retval;

--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtf] [patch] 2.3.99-pre6-3 overly swappy
  2000-04-20 19:43 [rtf] [patch] 2.3.99-pre6-3 overly swappy Ben LaHaise
@ 2000-04-20 20:13 ` Rik van Riel
  2000-04-21  0:25 ` Juan J. Quintela
  1 sibling, 0 replies; 6+ messages in thread
From: Rik van Riel @ 2000-04-20 20:13 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: linux-mm, torvalds

On Thu, 20 Apr 2000, Ben LaHaise wrote:

> The balance between swap and shrink_mmap was upset by the recent per-zone
> changes: kswapd wakeups now call swap_out 3 times as much as before,
> resulting in increased page faults and swap out activity, especially
> under heavy io.  This patch seems to help quite a bit -- can other people
> give this a try?

[snip]

> @@ -507,7 +509,7 @@
>  					schedule();
>  				if ((!zone->size) || (!zone->zone_wake_kswapd))
>  					continue;
> -				do_try_to_free_pages(GFP_KSWAPD, zone);
> +				do_try_to_free_pages(GFP_KSWAPD, zone, i == (MAX_NR_ZONES - 1));
>  			}
>  			pgdat = pgdat->node_next;
>  		}

This seems to mostly work for machines where each bigger zone
is a subset of the smaller zones. I don't think this scheme
would be suitable for eg. ccNUMA machines, but it may be a nice
bandaid for x86...

(I'll get to work on a more generic strategy ASAP, it'll be
very much like what I talked about on irc with Stephen and you)

regards,

Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel?  irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/		http://www.surriel.com/

--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtf] [patch] 2.3.99-pre6-3 overly swappy
  2000-04-20 19:43 [rtf] [patch] 2.3.99-pre6-3 overly swappy Ben LaHaise
  2000-04-20 20:13 ` Rik van Riel
@ 2000-04-21  0:25 ` Juan J. Quintela
  2000-04-21  2:54   ` Ben LaHaise
  1 sibling, 1 reply; 6+ messages in thread
From: Juan J. Quintela @ 2000-04-21  0:25 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: linux-mm, torvalds

>>>>> "ben" == Ben LaHaise <bcrl@redhat.com> writes:

ben> The balance between swap and shrink_mmap was upset by the recent per-zone
ben> changes: kswapd wakeups now call swap_out 3 times as much as before,
ben> resulting in increased page faults and swap out activity, especially
ben> under heavy io.  This patch seems to help quite a bit -- can other people
ben> give this a try?

Hi Ben
   I have tested your patch here, with high loads (around 34), the
   system doesn't use swap (like with 2.3.51).  With 2.3.99 it uses a
   lot of swap.  The system has anyway around 60 MB RAM unused,
   i.e. It don't have to use swap.

   I have tested also the other patchs from Rik, here they improving
   responsiveness a lot, the mouse moves smoothly.  With them the
   system has a lot of memory in swap, but not a lot of swap traffic,
   i.e, it swaps the applications that I am not using in that moment. 

   I have tried to mix the two, yours and him, and no way, the system
   begins working OK, but in some moments, the system begins to trash
   (very heavily).  Indeed I boot the machine with mem=64MB (normally
   with 256MB), the same precesses for testing and the machine dies
   in the middle of the trashing (no keyboard, no mouse, no response)
   and the disk sound very loud.

   Hope this helps, if you want more information, me to make some tests
   or something, let me know.

Best regards, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtf] [patch] 2.3.99-pre6-3 overly swappy
  2000-04-21  0:25 ` Juan J. Quintela
@ 2000-04-21  2:54   ` Ben LaHaise
  2000-04-21 17:50     ` Juan J. Quintela
  0 siblings, 1 reply; 6+ messages in thread
From: Ben LaHaise @ 2000-04-21  2:54 UTC (permalink / raw)
  To: Juan J. Quintela; +Cc: linux-mm, torvalds

On 21 Apr 2000, Juan J. Quintela wrote:

>    I have tried to mix the two, yours and him, and no way, the system
>    begins working OK, but in some moments, the system begins to trash
>    (very heavily).  Indeed I boot the machine with mem=64MB (normally
>    with 256MB), the same precesses for testing and the machine dies
>    in the middle of the trashing (no keyboard, no mouse, no response)
>    and the disk sound very loud.

Ahh, I'd expect this to be the case.  We're both going after the same
problem, by tuning the aggressiveness of the different parts of the vm
code.  Note that the patch I posted earlier is completely broken on
machines that don't have the majority of their memory above 16MB, but it's
atleast giving us a hint about what direction we need to go in.

One of the things that really needs fixing is the allocator's way of
choosing which zone to pressure for memory: most allocators don't care if
it's dma/not memory but the call to try_to_free_pages specifies a zone --
which may be the wrong one. :(

		-ben

--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtf] [patch] 2.3.99-pre6-3 overly swappy
  2000-04-21  2:54   ` Ben LaHaise
@ 2000-04-21 17:50     ` Juan J. Quintela
  2000-04-22 18:14       ` Juan J. Quintela
  0 siblings, 1 reply; 6+ messages in thread
From: Juan J. Quintela @ 2000-04-21 17:50 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: linux-mm, Rik van Riel

>>>>> "ben" == Ben LaHaise <bcrl@redhat.com> writes:

ben> Ahh, I'd expect this to be the case.  We're both going after the same
ben> problem, by tuning the aggressiveness of the different parts of the vm
ben> code.  Note that the patch I posted earlier is completely broken on
ben> machines that don't have the majority of their memory above 16MB, but it's
ben> atleast giving us a hint about what direction we need to go in.

ben> One of the things that really needs fixing is the allocator's way of
ben> choosing which zone to pressure for memory: most allocators don't care if
ben> it's dma/not memory but the call to try_to_free_pages specifies a zone --
ben> which may be the wrong one. :(

Hi,
        using only Ben patch, I have got the following Oops, the Oops
        happens just after a call to BUG():
                 page_alloc.c::__free_pages_ok(): 110
                        
	if (PageLocked(page))
		BUG();  <- This one

        Following that this Ooops:

        I am using the kernel 2.3.99-pre6-3 plus Ben Patch (I have
        seen only one, I don't know if it is the first or second), the
        headers are:


diff -ur 2.3.99-pre6-3/mm/vmscan.c linux-test/mm/vmscan.c
--- 2.3.99-pre6-3/mm/vmscan.c	Wed Apr 12 14:39:50 2000
+++ linux-test/mm/vmscan.c	Thu Apr 20 15:12:17 2000
@@ -408,7 +408,7 @@


As allways, more information on request, testing offered, ....

Later, Juan.

        
ksymoops 2.3.4 on i686 2.3.99-pre6b.  Options used
     -V (default)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.3.99-pre6b/ (default)
     -m /boot/System.map-2.3.99-pre6b (default)

invalid operand: 0000
CPU:    0
EIP:    0010:[<c0129bc8>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010286
eax: 00000020   ebx: c1000320   ecx: 00000020   edx: 00000000
esi: 00000000   edi: c2da2864   ebp: 00000000   esp: c3ebfee8
ds: 0018   es: 0018   ss: 0018
Process test004 (pid: 24141, stackpage=c3ebf000)
Stack: c01dbb2a c01dbdd6 0000006e c1000320 00000000 c2da2864 c715312c 005e9200 
       00000001 c1000320 00000000 c012a417 c012a42d c1000320 c012a4b1 c1000320 
       00400000 000003b5 c011f261 c1000320 cf71c800 8444e000 cdad5e40 03d09000 
Call Trace: [<c01dbb2a>] [<c01dbdd6>] [<c012a417>] [<c012a42d>] [<c012a4b1>] [<c011f261>] [<c0121858>] 
       [<c0114645>] [<c0119f81>] [<c011a21e>] [<c010af4c>] 
Code: 0f 0b 83 c4 0c 8d 76 00 8b 43 18 a8 20 74 19 6a 70 68 d6 bd 

>>EIP; c0129bc8 <__free_pages_ok+b8/2a0>   <=====
Trace; c01dbb2a <tvecs+3442/1c7b8>
Trace; c01dbdd6 <tvecs+36ee/1c7b8>
Trace; c012a417 <delete_from_swap_cache_nolock+67/80>
Trace; c012a42d <delete_from_swap_cache_nolock+7d/80>
Trace; c012a4b1 <free_page_and_swap_cache+51/90>
Trace; c011f261 <zap_page_range+171/1f0>
Trace; c0121858 <exit_mmap+b8/120>
Trace; c0114645 <mmput+15/30>
Trace; c0119f81 <do_exit+c1/350>
Trace; c011a21e <sys_exit+e/10>
Trace; c010af4c <system_call+34/38>
Code;  c0129bc8 <__free_pages_ok+b8/2a0>
00000000 <_EIP>:
Code;  c0129bc8 <__free_pages_ok+b8/2a0>   <=====
   0:   0f 0b                     ud2a      <=====
Code;  c0129bca <__free_pages_ok+ba/2a0>
   2:   83 c4 0c                  add    $0xc,%esp
Code;  c0129bcd <__free_pages_ok+bd/2a0>
   5:   8d 76 00                  lea    0x0(%esi),%esi
Code;  c0129bd0 <__free_pages_ok+c0/2a0>
   8:   8b 43 18                  mov    0x18(%ebx),%eax
Code;  c0129bd3 <__free_pages_ok+c3/2a0>
   b:   a8 20                     test   $0x20,%al
Code;  c0129bd5 <__free_pages_ok+c5/2a0>
   d:   74 19                     je     28 <_EIP+0x28> c0129bf0 <__free_pages_ok+e0/2a0>
Code;  c0129bd7 <__free_pages_ok+c7/2a0>
   f:   6a 70                     push   $0x70
Code;  c0129bd9 <__free_pages_ok+c9/2a0>
  11:   68 d6 bd 00 00            push   $0xbdd6


       





-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtf] [patch] 2.3.99-pre6-3 overly swappy
  2000-04-21 17:50     ` Juan J. Quintela
@ 2000-04-22 18:14       ` Juan J. Quintela
  0 siblings, 0 replies; 6+ messages in thread
From: Juan J. Quintela @ 2000-04-22 18:14 UTC (permalink / raw)
  To: Ben LaHaise; +Cc: linux-mm, Rik van Riel

>>>>> "juan" == Juan J Quintela <quintela@fi.udc.es> writes:

juan> Hi,
juan> using only Ben patch, I have got the following Oops, the Oops
juan> happens just after a call to BUG():
juan> page_alloc.c::__free_pages_ok(): 110
                        
juan> if (PageLocked(page))
juan> BUG();  <- This one


Just one reboot later, using the same program as a test, but with the
patch from Rik, nor the Ben one, I get another
BUG in the same function, this time
page_alloc.c::__free_pages_ok(): 104
	if (page->mapping)
		BUG(); <- This one.

This time again, the machine was in trashing (heavy trashing).

Following the BUG(), two Oops that are attached.

As always, if you need more information or anything, let me know.

Later, Juan.

PS. Somebody tolds me that all the bugs could be caused by Bad Memory,
    21 hours and 18 passes of memtest86 find not a single error.


ksymoops 2.3.4 on i686 2.3.99-pre6r3.  Options used
     -V (default)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.3.99-pre6r3/ (default)
     -m /boot/System.map-2.3.99-pre6r3 (default)

invalid operand: 0000
CPU:    0
EIP:    0010:[<c0129b89>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00013286
eax: 00000020   ebx: c1000170   ecx: 0000003b   edx: cf4a0480
esi: c1000170   edi: c33a7674   ebp: 00000000   esp: c14a1ef4
ds: 0018   es: 0018   ss: 0018
Process kswapd (pid: 2, stackpage=c14a1000)
Stack: c01dc3b0 c01dc67c 00000068 7419e000 c1000170 c33a7674 c32f5800 00aeb900 
       0049a200 c1408470 c6b60438 c0129243 c012927b 7419e000 74400000 c33a7674 
       74400000 00aeb900 c01294bf c32f5800 7419d000 c33a7674 00000004 c32f5800 
Call Trace: [<c01dc3b0>] [<c01dc67c>] [<c0129243>] [<c012927b>] [<c01294bf>] [<c012956b>] [<c012965e>] 
       [<c012972a>] [<c01297b5>] [<c0108df8>] 
Code: 0f 0b 83 c4 0c 89 f6 89 d8 2b 05 ec c2 21 c0 69 c0 39 8e e3 

>>EIP; c0129b89 <__free_pages_ok+49/2a0>   <=====
Trace; c01dc3b0 <tvecs+3644/1d794>
Trace; c01dc67c <tvecs+3910/1d794>
Trace; c0129243 <try_to_swap_out+83/1e0>
Trace; c012927b <try_to_swap_out+bb/1e0>
Trace; c01294bf <swap_out_vma+11f/190>
Trace; c012956b <swap_out_mm+3b/70>
Trace; c012965e <swap_out+be/110>
Trace; c012972a <do_try_to_free_pages+7a/90>
Trace; c01297b5 <kswapd+75/f0>
Trace; c0108df8 <kernel_thread+28/40>
Code;  c0129b89 <__free_pages_ok+49/2a0>
00000000 <_EIP>:
Code;  c0129b89 <__free_pages_ok+49/2a0>   <=====
   0:   0f 0b                     ud2a      <=====
Code;  c0129b8b <__free_pages_ok+4b/2a0>
   2:   83 c4 0c                  add    $0xc,%esp
Code;  c0129b8e <__free_pages_ok+4e/2a0>
   5:   89 f6                     mov    %esi,%esi
Code;  c0129b90 <__free_pages_ok+50/2a0>
   7:   89 d8                     mov    %ebx,%eax
Code;  c0129b92 <__free_pages_ok+52/2a0>
   9:   2b 05 ec c2 21 c0         sub    0xc021c2ec,%eax
Code;  c0129b98 <__free_pages_ok+58/2a0>
   f:   69 c0 39 8e e3 00         imul   $0xe38e39,%eax,%eax


and

ksymoops 2.3.4 on i686 2.3.99-pre6r3.  Options used
     -V (default)
     -k /proc/ksyms (default)
     -l /proc/modules (default)
     -o /lib/modules/2.3.99-pre6r3/ (default)
     -m /boot/System.map-2.3.99-pre6r3 (default)

invalid operand: 0000
CPU:    0
EIP:    0010:[<c0129b89>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010286
eax: 00000020   ebx: c10001b8   ecx: 00000022   edx: 00000000
esi: 00000058   edi: c8e31748   ebp: 00000000   esp: cac61ef4
ds: 0018   es: 0018   ss: 0018
Process test004 (pid: 2642, stackpage=cac61000)
Stack: c01dc3b0 c01dc67c 00000068 c10001b8 00000058 c8e31748 c365eea0 c1048008 
       c021c6b8 00000213 ffffffff 00400000 c012a513 00400000 00000058 c011f261 
       c10001b8 c32f5d80 7021a000 ce02fd80 08953000 c8e31748 74800000 00000000 
Call Trace: [<c01dc3b0>] [<c01dc67c>] [<c012a513>] [<c011f261>] [<c0121858>] [<c0114645>] [<c0119f81>] 
       [<c011a21e>] [<c010af4c>] 
Code: 0f 0b 83 c4 0c 89 f6 89 d8 2b 05 ec c2 21 c0 69 c0 39 8e e3 

>>EIP; c0129b89 <__free_pages_ok+49/2a0>   <=====
Trace; c01dc3b0 <tvecs+3644/1d794>
Trace; c01dc67c <tvecs+3910/1d794>
Trace; c012a513 <free_page_and_swap_cache+83/90>
Trace; c011f261 <zap_page_range+171/1f0>
Trace; c0121858 <exit_mmap+b8/120>
Trace; c0114645 <mmput+15/30>
Trace; c0119f81 <do_exit+c1/350>
Trace; c011a21e <sys_exit+e/10>
Trace; c010af4c <system_call+34/38>
Code;  c0129b89 <__free_pages_ok+49/2a0>
00000000 <_EIP>:
Code;  c0129b89 <__free_pages_ok+49/2a0>   <=====
   0:   0f 0b                     ud2a      <=====
Code;  c0129b8b <__free_pages_ok+4b/2a0>
   2:   83 c4 0c                  add    $0xc,%esp
Code;  c0129b8e <__free_pages_ok+4e/2a0>
   5:   89 f6                     mov    %esi,%esi
Code;  c0129b90 <__free_pages_ok+50/2a0>
   7:   89 d8                     mov    %ebx,%eax
Code;  c0129b92 <__free_pages_ok+52/2a0>
   9:   2b 05 ec c2 21 c0         sub    0xc021c2ec,%eax
Code;  c0129b98 <__free_pages_ok+58/2a0>
   f:   69 c0 39 8e e3 00         imul   $0xe38e39,%eax,%eax








-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
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.eu.org/Linux-MM/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-04-22 18:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-20 19:43 [rtf] [patch] 2.3.99-pre6-3 overly swappy Ben LaHaise
2000-04-20 20:13 ` Rik van Riel
2000-04-21  0:25 ` Juan J. Quintela
2000-04-21  2:54   ` Ben LaHaise
2000-04-21 17:50     ` Juan J. Quintela
2000-04-22 18:14       ` Juan J. Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox