Skip to contentSkip to conversation

2.4.16-rmap-6

PATCH New Rik van Riel 3 participants 4 messages Dec 20, 2001 – Dec 21, 2001

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.16-rmap-6

Hi,

The 6th version of the reverse mapping based VM is now available. This is an attempt at making a more robust and flexible VM subsystem, while cleaning up a lot of code at the time. The patch is available from:

	   http://surriel.com/patches/2.4/2.4.16-rmap-6

and http://linuxvm.bkbits.net/

The big TODO items for the _next_ release are:
- integrate some of wli's pigmem stuff
- fix page_launder() so it doesn't submit the whole inactive_dirty list for writeout in one go

Changelog:

rmap 6:
- make the active and inactive_dirty list per zone, this is finally possible because we can free pages
based on their physical address (William Lee Irwin)
- cleaned up William's code a bit (me)
- turn some defines into inlines and move those to

    mm_inline.h (the includes are a mess ...)                         (me)
  - improve the VM balancing a bit                                    (me)
  - add back inactive_target to /proc/meminfo                         (me)

rmap 5:
- fixed recursive buglet, introduced by directly
editing the patch for making rmap 4 ;))) (me)
rmap 4:
- look at the referenced bits in page tables (me)
rmap 3:
- forgot one FASTCALL definition (me)
rmap 2:

  - teach try_to_unmap_one() about mremap()                           (me)
  - don't assign swap space to pages with buffers                     (me)
  - make the rmap.c functions FASTCALL / inline                       (me)

rmap 1:
- fix the swap leak in rmap 0 (Dave McCracken)
rmap 0:
- port of reverse mapping VM to 2.4.16 (me)

regards,

Rik

Signature · 8 lines
Shortwave goes a long way:  irc.starchat.net  #swl

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/
#1 lore raw

RFC 1/1 Concept: Active/busy "reverse" mapping

The goal of this code is to make sure that used pages are marked as such.

This is accomplished by:

* When a process is descheduled - look in its mm for used pages - update corresponding page. (Done at most once per tick)

Pros:
* No need for extra elements in page
* Used page will be updated promptly

Cons:
* Context switch times will increase
* CPU cycle waste.

But:
* On my UP it does not affect performance that much :-)
- Lost at most 1,7 MB/s (-7%)
+ Gained in some cases (read, diff, dbench 4%)
[I thought it would become much worse - with other mm changes
compensating]

Signature · 3 lines
Roger Larsson
Skelleftea
Sweden

*******************************************
Patch prepared by: [email protected]
Name of file: /home/roger/patches/patch-2.4.17rc1-update_page_usage_R2

kernel/sched.c renamed from kernel/sched.c.orig +4 -0
@@ -557,6 +557,10 @@
 	spin_lock_prefetch(&runqueue_lock);
 
 	if (!current->active_mm) BUG();
+
+	if (current->mm)
+	    update_page_usage(current->mm);
+
 need_resched_back:
 	prev = current;
 	this_cpu = prev->processor;
mm/vmscan.c renamed from mm/vmscan.c.orig +49 -16

97 lines not on this page · raw message

include/linux/mm.h renamed from include/linux/mm.h.orig +7 -2
@@ -423,6 +423,9 @@
 extern void ptrace_disable(struct task_struct *);
 extern int ptrace_check_attach(struct task_struct *task, int kill);
 
+int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
+		int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
+
 /*
  * On a two-level page table, this ends up being trivial. Thus the
  * inlining and the symmetry break with pte_alloc() that does all
@@ -558,11 +561,13 @@
 	 * before relocating the vma range ourself.
 	 */
 	address &= PAGE_MASK;
+ 	spin_lock(&vma->vm_mm->page_table_lock);
 	grow = (vma->vm_start - address) >> PAGE_SHIFT;
 	if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur ||
-	    ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->rlim[RLIMIT_AS].rlim_cur)
+	    ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->rlim[RLIMIT_AS].rlim_cur) {
+		spin_unlock(&vma->vm_mm->page_table_lock);
 		return -ENOMEM;
-	spin_lock(&vma->vm_mm->page_table_lock);
+	}
 	vma->vm_start = address;
 	vma->vm_pgoff -= grow;
 	vma->vm_mm->total_vm += grow;
include/linux/mmzone.h renamed from include/linux/mmzone.h.orig +3 -2
@@ -113,8 +113,9 @@
 extern int numnodes;
 extern pg_data_t *pgdat_list;
 
-#define memclass(pgzone, classzone)	(((pgzone)->zone_pgdat == (classzone)->zone_pgdat) \
-			&& ((pgzone) <= (classzone)))
+/* with this change classzone might be zero! */
+#define memclass(pgzone, classzone)	(((pgzone) <= (classzone)) && \
+                                         ((pgzone)->zone_pgdat == (classzone)->zone_pgdat))
 
 /*
  * The following two are not meant for general usage. They are here as
Makefile renamed from Makefile.orig +1 -1
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 17
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc1-update_page_usage
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
#2 lore raw

Re: [RFC] Concept: Active/busy "reverse" mapping

Quoted 6 lines · Roger Larsson

The goal of this code is to make sure that used pages are marked as such.

This is accomplished by:

* When a process is descheduled - look in its mm for used pages - update corresponding page. (Done at most once per tick)

Interesting. The same effect is acheived by the reverse mapping code on a global scale while addressing the issue of how to figure out what extent memory pressure is needed on the page tables.

-ben

Signature · 5 lines
Fish.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/
#3 lore raw

Re: [RFC] Concept: Active/busy "reverse" mapping

Quoted 5 lines · Benjamin LaHaise
Quoted 4 lines · Roger Larsson

The goal of this code is to make sure that used pages are marked as such.

This is accomplished by:

Quoted 8 lines
Quoted 2 lines

* When a process is descheduled - look in its mm for used pages - update corresponding page. (Done at most once per tick)

Interesting. The same effect is acheived by the reverse mapping code on a global scale while addressing the issue of how to figure out what extent memory pressure is needed on the page tables.

-ben

There are other ways too...
Link all used mm:s and check them with kswapd...
etc... etc...

It should be possible to optimize away most performance problems...

/RogerL

PS
I will be away for some days...
DS

Signature · 7 lines
Roger Larsson
Skelleftea
Sweden
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/