linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: MM/VM todo list
  2001-01-05 17:14 MM/VM todo list Rik van Riel
@ 2001-01-05 15:54 ` Marcelo Tosatti
  2001-01-05 17:50   ` Rik van Riel
  2001-01-05 16:56 ` Marcelo Tosatti
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 14+ messages in thread
From: Marcelo Tosatti @ 2001-01-05 15:54 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-mm, linux-kernel

On Fri, 5 Jan 2001, Rik van Riel wrote:

> Hi,
> 
> here is a TODO list for the memory management area of the
> Linux kernel, with both trivial things that could be done
> for later 2.4 releases and more complex things that really
> have to be 2.5 things.
> 
> Most of these can be found on http://linux24.sourceforge.net/ too
> 
> Trivial stuff:
> * VM: better IO clustering for swap (and filesystem) IO
>   * Marcelo's swapin/out clustering code
    * Swap space preallocation at try_to_swap_out()

>   * ->writepage() IO clustering support

Hum, IMO this should be in the "2.5" list because 

1) It involves changes to the PageDirty scheme if we want to support write
clustering for normal writes, and not only shared writable mappings like
we do now. (basically this changes are in Chris Mason's patch)

2) It involves changes to the filesystem code if we want to support
generic write clustering for fs's which use block_write_full_page.

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 17:14 MM/VM todo list Rik van Riel
  2001-01-05 15:54 ` Marcelo Tosatti
@ 2001-01-05 16:56 ` Marcelo Tosatti
  2001-01-05 21:13   ` Christoph Hellwig
  2001-01-05 17:58 ` Daniel Phillips
  2001-01-08 17:31 ` afei
  3 siblings, 1 reply; 14+ messages in thread
From: Marcelo Tosatti @ 2001-01-05 16:56 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-mm, linux-kernel

On Fri, 5 Jan 2001, Rik van Riel wrote:

> Probably 2.5 era:
> * VM: physical->virtual reverse mapping, so we can do much
>   better page aging with less CPU usage spikes 
> * VM: move all the global VM variables, lists, etc. into the
>   pgdat struct for better NUMA scalability
> * VM: per-node kswapd for NUMA
> * VM: thrashing control, maybe process suspension with some
>   forced swapping ?             (trivial only in theory)
> * VM: experiment with different active lists / aging pages
>   of different ages at different rates + other page replacement
>   improvements
> * VM: Quality of Service / fairness / ... improvements
  * VM: Use kiobuf IO in VM instead buffer_head IO. 

--
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] 14+ messages in thread

* MM/VM todo list
@ 2001-01-05 17:14 Rik van Riel
  2001-01-05 15:54 ` Marcelo Tosatti
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Rik van Riel @ 2001-01-05 17:14 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel

Hi,

here is a TODO list for the memory management area of the
Linux kernel, with both trivial things that could be done
for later 2.4 releases and more complex things that really
have to be 2.5 things.

Most of these can be found on http://linux24.sourceforge.net/ too

Trivial stuff:
* VM: better IO clustering for swap (and filesystem) IO
  * Marcelo's swapin/out clustering code
  * ->writepage() IO clustering support
  * page_launder()/->writepage() working together in avoiding
    low-yield (small cluster) IO at first, ...
* VM: include Ben LaHaise's code, which moves readahead to the
  VMA level, this way we can do streaming swap IO, complete with
  drop_behind()
* VM: enforce RSS ulimit


Probably 2.5 era:
* VM: physical->virtual reverse mapping, so we can do much
  better page aging with less CPU usage spikes 
* VM: move all the global VM variables, lists, etc. into the
  pgdat struct for better NUMA scalability
* VM: per-node kswapd for NUMA
* VM: thrashing control, maybe process suspension with some
  forced swapping ?             (trivial only in theory)
* VM: experiment with different active lists / aging pages
  of different ages at different rates + other page replacement
  improvements
* VM: Quality of Service / fairness / ... improvements


Additions to this list are always welcome, I'll put it online
on the Linux-MM pages (http://www.linux.eu.org/Linux-MM/) soon.

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to loose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/


--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 15:54 ` Marcelo Tosatti
@ 2001-01-05 17:50   ` Rik van Riel
  0 siblings, 0 replies; 14+ messages in thread
From: Rik van Riel @ 2001-01-05 17:50 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-mm, linux-kernel

On Fri, 5 Jan 2001, Marcelo Tosatti wrote:
> On Fri, 5 Jan 2001, Rik van Riel wrote:
> 
> > here is a TODO list for the memory management area of the
> > Linux kernel, with both trivial things that could be done
> > for later 2.4 releases and more complex things that really
> > have to be 2.5 things.
> > 
> > Most of these can be found on http://linux24.sourceforge.net/ too
> > 
> > Trivial stuff:
> > * VM: better IO clustering for swap (and filesystem) IO
> >   * Marcelo's swapin/out clustering code
>     * Swap space preallocation at try_to_swap_out()
> 
> >   * ->writepage() IO clustering support
> 
> Hum, IMO this should be in the "2.5" list because 

The non-trivial part of improved IO clustering should be a
2.5 thing indeed, but I'm not convinced there aren't any
trivial things left which can give us a nice improvement
now (and for the whole 2.4 series).

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to loose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 17:14 MM/VM todo list Rik van Riel
  2001-01-05 15:54 ` Marcelo Tosatti
  2001-01-05 16:56 ` Marcelo Tosatti
@ 2001-01-05 17:58 ` Daniel Phillips
  2001-01-08 17:31 ` afei
  3 siblings, 0 replies; 14+ messages in thread
From: Daniel Phillips @ 2001-01-05 17:58 UTC (permalink / raw)
  To: Rik van Riel, linux-mm; +Cc: linux-kernel

On Fri, 05 Jan 2001, Rik van Riel wrote:
> Hi,
> 
> here is a TODO list for the memory management area of the
> Linux kernel, with both trivial things that could be done
> for later 2.4 releases and more complex things that really
> have to be 2.5 things.
> 
> Most of these can be found on http://linux24.sourceforge.net/ too
> 
> Trivial stuff:
> * VM: better IO clustering for swap (and filesystem) IO
>   * Marcelo's swapin/out clustering code
>   * ->writepage() IO clustering support
>   * page_launder()/->writepage() working together in avoiding
>     low-yield (small cluster) IO at first, ...
> * VM: include Ben LaHaise's code, which moves readahead to the
>   VMA level, this way we can do streaming swap IO, complete with
>   drop_behind()
> * VM: enforce RSS ulimit
> 
> 
> Probably 2.5 era:
> * VM: physical->virtual reverse mapping, so we can do much
>   better page aging with less CPU usage spikes 
> * VM: move all the global VM variables, lists, etc. into the
>   pgdat struct for better NUMA scalability
> * VM: per-node kswapd for NUMA
> * VM: thrashing control, maybe process suspension with some
>   forced swapping ?             (trivial only in theory)
> * VM: experiment with different active lists / aging pages
>   of different ages at different rates + other page replacement
>   improvements
> * VM: Quality of Service / fairness / ... improvements
> 
> 
> Additions to this list are always welcome, I'll put it online
> on the Linux-MM pages (http://www.linux.eu.org/Linux-MM/) soon.

I'd like to suggest variable sized pages as a research topic.  It's not
clear whether we're talking 2.5 or 2.7 here.

-- 
Daniel
--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 16:56 ` Marcelo Tosatti
@ 2001-01-05 21:13   ` Christoph Hellwig
  2001-01-05 21:20     ` Rik van Riel
  2001-01-05 21:52     ` Stephen C. Tweedie
  0 siblings, 2 replies; 14+ messages in thread
From: Christoph Hellwig @ 2001-01-05 21:13 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Rik van Riel, linux-mm, linux-kernel

On Fri, Jan 05, 2001 at 02:56:40PM -0200, Marcelo Tosatti wrote:
> > * VM: experiment with different active lists / aging pages
> >   of different ages at different rates + other page replacement
> >   improvements
> > * VM: Quality of Service / fairness / ... improvements
>   * VM: Use kiobuf IO in VM instead buffer_head IO. 

I'd vote for killing both bufer_head and kiobuf from VM.
Lokk at my pageio patch - VM doesn't know about the use of kiobufs
in the filesystem IO...

	Christoph
-- 
Whip me.  Beat me.  Make me maintain AIX.
--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 21:13   ` Christoph Hellwig
@ 2001-01-05 21:20     ` Rik van Riel
  2001-01-05 21:26       ` Christoph Hellwig
  2001-01-05 21:52     ` Stephen C. Tweedie
  1 sibling, 1 reply; 14+ messages in thread
From: Rik van Riel @ 2001-01-05 21:20 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Marcelo Tosatti, linux-mm, linux-kernel

On Fri, 5 Jan 2001, Christoph Hellwig wrote:
> On Fri, Jan 05, 2001 at 02:56:40PM -0200, Marcelo Tosatti wrote:
> > > * VM: experiment with different active lists / aging pages
> > >   of different ages at different rates + other page replacement
> > >   improvements
> > > * VM: Quality of Service / fairness / ... improvements
> >   * VM: Use kiobuf IO in VM instead buffer_head IO. 
> 
> I'd vote for killing both bufer_head and kiobuf from VM.
> Lokk at my pageio patch - VM doesn't know about the use of kiobufs
> in the filesystem IO...

Could be interesting ... but is it generalised enough to
also work with eg. network IO ?

I won't kill this TODO item until I understand what exactly
you want to achieve and why it would be a good thing (and
until there is some kind of agreement about this idea).

Btw,
	http://www.linux.eu.org/Linux-MM/todo.shtml

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to loose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 21:20     ` Rik van Riel
@ 2001-01-05 21:26       ` Christoph Hellwig
  2001-01-05 21:27         ` Rik van Riel
  0 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2001-01-05 21:26 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Marcelo Tosatti, linux-mm, linux-kernel

On Fri, Jan 05, 2001 at 07:20:24PM -0200, Rik van Riel wrote:
> > >   * VM: Use kiobuf IO in VM instead buffer_head IO. 
> > 
> > I'd vote for killing both bufer_head and kiobuf from VM.
> > Lokk at my pageio patch - VM doesn't know about the use of kiobufs
> > in the filesystem IO...
> 
> Could be interesting ... but is it generalised enough to
> also work with eg. network IO ?

No other then filesystem IO (page/buffercache) is actively tied to the VM,
so there should be no problems.

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.
--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 21:26       ` Christoph Hellwig
@ 2001-01-05 21:27         ` Rik van Riel
  2001-01-05 21:34           ` Christoph Hellwig
  0 siblings, 1 reply; 14+ messages in thread
From: Rik van Riel @ 2001-01-05 21:27 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Marcelo Tosatti, linux-mm, linux-kernel

On Fri, 5 Jan 2001, Christoph Hellwig wrote:
> On Fri, Jan 05, 2001 at 07:20:24PM -0200, Rik van Riel wrote:
> > > >   * VM: Use kiobuf IO in VM instead buffer_head IO. 
> > > 
> > > I'd vote for killing both bufer_head and kiobuf from VM.
> > > Lokk at my pageio patch - VM doesn't know about the use of kiobufs
> > > in the filesystem IO...
> > 
> > Could be interesting ... but is it generalised enough to
> > also work with eg. network IO ?
> 
> No other then filesystem IO (page/buffercache) is actively tied
> to the VM, so there should be no problems.

Not right now, no. But if you know what is possible
(and planned) with the kiobuf layer, you should think
twice about this idea...

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to loose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 21:27         ` Rik van Riel
@ 2001-01-05 21:34           ` Christoph Hellwig
  0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2001-01-05 21:34 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Marcelo Tosatti, linux-mm, linux-kernel

On Fri, Jan 05, 2001 at 07:27:38PM -0200, Rik van Riel wrote:
> > No other then filesystem IO (page/buffercache) is actively tied
> > to the VM, so there should be no problems.
> 
> Not right now, no. But if you know what is possible
> (and planned) with the kiobuf layer, you should think
> twice about this idea...

I don't think so.  The only place were IO actively interferes with
the VM is of the 'write this out when memory gets low' type thing,
and you don't really want this outside filesystems/blockdevices.

There are some VM tricks that are usefull for IO (COW, map_user_kiobuf),
but these operate always on pages (maybe containered by kiobufs, but that
should be of minor interest for the VM).

	Christoph

-- 
Whip me.  Beat me.  Make me maintain AIX.
--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 21:13   ` Christoph Hellwig
  2001-01-05 21:20     ` Rik van Riel
@ 2001-01-05 21:52     ` Stephen C. Tweedie
  1 sibling, 0 replies; 14+ messages in thread
From: Stephen C. Tweedie @ 2001-01-05 21:52 UTC (permalink / raw)
  To: Marcelo Tosatti, Rik van Riel, linux-mm, linux-kernel; +Cc: Stephen Tweedie

Hi,

On Fri, Jan 05, 2001 at 10:13:27PM +0100, Christoph Hellwig wrote:
> On Fri, Jan 05, 2001 at 02:56:40PM -0200, Marcelo Tosatti wrote:
> > > * VM: experiment with different active lists / aging pages
> > >   of different ages at different rates + other page replacement
> > >   improvements
> > > * VM: Quality of Service / fairness / ... improvements
> >   * VM: Use kiobuf IO in VM instead buffer_head IO. 
> 
> I'd vote for killing both bufer_head and kiobuf from VM.
> Lokk at my pageio patch - VM doesn't know about the use of kiobufs
> in the filesystem IO...

It has already been talked about, and is something I'd like for 2.5
--- it's easy enough to push the buffer-head list into the
per-address-space structures so that the upper VM has no knowledge of
the IO mechanism being used underneath.

Cheers,
 Stephen
--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-05 17:14 MM/VM todo list Rik van Riel
                   ` (2 preceding siblings ...)
  2001-01-05 17:58 ` Daniel Phillips
@ 2001-01-08 17:31 ` afei
  2001-01-08 17:36   ` Rik van Riel
  3 siblings, 1 reply; 14+ messages in thread
From: afei @ 2001-01-08 17:31 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-mm, linux-kernel

About the RSS ulimit proposal, have we resolved the correctness of
counting RSS in a process?

Fei

On Fri, 5 Jan 2001, Rik van Riel wrote:

> Hi,
> 
> here is a TODO list for the memory management area of the
> Linux kernel, with both trivial things that could be done
> for later 2.4 releases and more complex things that really
> have to be 2.5 things.
> 
> Most of these can be found on http://linux24.sourceforge.net/ too
> 
> Trivial stuff:
> * VM: better IO clustering for swap (and filesystem) IO
>   * Marcelo's swapin/out clustering code
>   * ->writepage() IO clustering support
>   * page_launder()/->writepage() working together in avoiding
>     low-yield (small cluster) IO at first, ...
> * VM: include Ben LaHaise's code, which moves readahead to the
>   VMA level, this way we can do streaming swap IO, complete with
>   drop_behind()
> * VM: enforce RSS ulimit
> 
> 
> Probably 2.5 era:
> * VM: physical->virtual reverse mapping, so we can do much
>   better page aging with less CPU usage spikes 
> * VM: move all the global VM variables, lists, etc. into the
>   pgdat struct for better NUMA scalability
> * VM: per-node kswapd for NUMA
> * VM: thrashing control, maybe process suspension with some
>   forced swapping ?             (trivial only in theory)
> * VM: experiment with different active lists / aging pages
>   of different ages at different rates + other page replacement
>   improvements
> * VM: Quality of Service / fairness / ... improvements
> 
> 
> Additions to this list are always welcome, I'll put it online
> on the Linux-MM pages (http://www.linux.eu.org/Linux-MM/) soon.
> 
> regards,
> 
> Rik
> --
> Virtual memory is like a game you can't win;
> However, without VM there's truly nothing to loose...
> 
> 		http://www.surriel.com/
> http://www.conectiva.com/	http://distro.conectiva.com.br/
> 
> 
> --
> 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/
> 

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-08 17:31 ` afei
@ 2001-01-08 17:36   ` Rik van Riel
  2001-01-08 20:23     ` Rasmus Andersen
  0 siblings, 1 reply; 14+ messages in thread
From: Rik van Riel @ 2001-01-08 17:36 UTC (permalink / raw)
  To: afei; +Cc: linux-mm, linux-kernel

On Mon, 8 Jan 2001 afei@jhu.edu wrote:

> About the RSS ulimit proposal, have we resolved the correctness
> of counting RSS in a process?

I have not taken^Whad the time to check the kernel tree
and see if the RSS counting has indeed been made safe
everywhere.

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

--
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] 14+ messages in thread

* Re: MM/VM todo list
  2001-01-08 17:36   ` Rik van Riel
@ 2001-01-08 20:23     ` Rasmus Andersen
  0 siblings, 0 replies; 14+ messages in thread
From: Rasmus Andersen @ 2001-01-08 20:23 UTC (permalink / raw)
  To: Rik van Riel; +Cc: afei, linux-mm, linux-kernel

On Mon, Jan 08, 2001 at 03:36:23PM -0200, Rik van Riel wrote:
> I have not taken^Whad the time to check the kernel tree
> and see if the RSS counting has indeed been made safe
> everywhere.

I have posted the one below a couple of times without it making
it in. If you like ot please fold it into your mm patchset. It
is against 2.4.0.

In addition to the places this patch touches there are some places
in fs/ where mm->rss is touched. But I am not sure of the finer
points of this code, so perhaps somebody else could have a look?
The files are binfmt_aout.c, binfmt_elf.c, and exec.c.


diff -aur linux-2.4.0-clean/mm/memory.c linux/mm/memory.c
--- linux-2.4.0-clean/mm/memory.c	Mon Jan  1 19:37:41 2001
+++ linux/mm/memory.c	Mon Jan  8 21:09:08 2001
@@ -371,7 +371,6 @@
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	} while (address && (address < end));
-	spin_unlock(&mm->page_table_lock);
 	/*
 	 * Update rss for the mm_struct (not necessarily current->mm)
 	 * Notice that rss is an unsigned long.
@@ -380,6 +379,7 @@
 		mm->rss -= freed;
 	else
 		mm->rss = 0;
+	spin_unlock(&mm->page_table_lock);
 }
 
 
@@ -1034,7 +1034,9 @@
 		flush_icache_page(vma, page);
 	}
 
+	spin_lock(&mm->page_table_lock);
 	mm->rss++;
+	spin_unlock(&mm->page_table_lock);
 
 	pte = mk_pte(page, vma->vm_page_prot);
 
@@ -1068,7 +1070,9 @@
 			return -1;
 		clear_user_highpage(page, addr);
 		entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
+		spin_lock(&mm->page_table_lock);
 		mm->rss++;
+		spin_unlock(&mm->page_table_lock);
 		flush_page_to_ram(page);
 	}
 	set_pte(page_table, entry);
@@ -1107,7 +1111,9 @@
 		return 0;
 	if (new_page == NOPAGE_OOM)
 		return -1;
+	spin_lock(&mm->page_table_lock);
 	++mm->rss;
+	spin_unlock(&mm->page_table_lock);
 	/*
 	 * This silly early PAGE_DIRTY setting removes a race
 	 * due to the bad i386 page protection. But it's valid
diff -aur linux-2.4.0-clean/mm/mmap.c linux/mm/mmap.c
--- linux-2.4.0-clean/mm/mmap.c	Sat Dec 30 18:35:19 2000
+++ linux/mm/mmap.c	Mon Jan  8 21:09:08 2001
@@ -879,8 +879,8 @@
 	spin_lock(&mm->page_table_lock);
 	mpnt = mm->mmap;
 	mm->mmap = mm->mmap_avl = mm->mmap_cache = NULL;
-	spin_unlock(&mm->page_table_lock);
 	mm->rss = 0;
+	spin_unlock(&mm->page_table_lock);
 	mm->total_vm = 0;
 	mm->locked_vm = 0;
 	while (mpnt) {
diff -aur linux-2.4.0-clean/mm/swapfile.c linux/mm/swapfile.c
--- linux-2.4.0-clean/mm/swapfile.c	Fri Dec 29 23:07:24 2000
+++ linux/mm/swapfile.c	Mon Jan  8 21:09:08 2001
@@ -231,7 +231,9 @@
 	set_pte(dir, pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
 	swap_free(entry);
 	get_page(page);
+	spin_lock(&vma->vm_mm->page_table_lock);
 	++vma->vm_mm->rss;
+	spin_unlock(&vma->vm_mm->page_table_lock);
 }
 
 static inline void unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
diff -aur linux-2.4.0-clean/mm/vmscan.c linux/mm/vmscan.c
--- linux-2.4.0-clean/mm/vmscan.c	Thu Jan  4 05:45:26 2001
+++ linux/mm/vmscan.c	Mon Jan  8 21:09:08 2001
@@ -100,7 +100,9 @@
 		set_pte(page_table, swp_entry_to_pte(entry));
 drop_pte:
 		UnlockPage(page);
+		spin_lock(&mm->page_table_lock);
 		mm->rss--;
+		spin_unlock(&mm->page_table_lock);
 		deactivate_page(page);
 		page_cache_release(page);
 out_failed:

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

Television is called a medium because it is neither rare nor well-done. 
  -- Anonymous
--
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] 14+ messages in thread

end of thread, other threads:[~2001-01-08 20:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-05 17:14 MM/VM todo list Rik van Riel
2001-01-05 15:54 ` Marcelo Tosatti
2001-01-05 17:50   ` Rik van Riel
2001-01-05 16:56 ` Marcelo Tosatti
2001-01-05 21:13   ` Christoph Hellwig
2001-01-05 21:20     ` Rik van Riel
2001-01-05 21:26       ` Christoph Hellwig
2001-01-05 21:27         ` Rik van Riel
2001-01-05 21:34           ` Christoph Hellwig
2001-01-05 21:52     ` Stephen C. Tweedie
2001-01-05 17:58 ` Daniel Phillips
2001-01-08 17:31 ` afei
2001-01-08 17:36   ` Rik van Riel
2001-01-08 20:23     ` Rasmus Andersen

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