revert to 4G since this is more involved than just a config option.
[linux-2.6.git] / linux-2.6-590-chopstix-intern.patch
index ffbe5c5..6eb5a89 100644 (file)
@@ -194,15 +194,6 @@ diff -Nurb linux-2.6.22-580/fs/bio.c linux-2.6.22-590/fs/bio.c
 diff -Nurb linux-2.6.22-580/fs/exec.c linux-2.6.22-590/fs/exec.c
 --- linux-2.6.22-580/fs/exec.c 2008-04-30 09:29:26.000000000 -0400
 +++ linux-2.6.22-590/fs/exec.c 2008-04-30 09:29:41.000000000 -0400
-@@ -38,7 +38,7 @@
- #include <linux/binfmts.h>
- #include <linux/swap.h>
- #include <linux/utsname.h>
--#include <linux/pid_namespace.h>
-+/*#include <linux/pid_namespace.h>*/
- #include <linux/module.h>
- #include <linux/namei.h>
- #include <linux/proc_fs.h>
 @@ -52,6 +52,7 @@
  #include <linux/audit.h>
  #include <linux/signalfd.h>
@@ -224,17 +215,6 @@ diff -Nurb linux-2.6.22-580/fs/exec.c linux-2.6.22-590/fs/exec.c
                file = ERR_PTR(-EACCES);
                if (!(nd.mnt->mnt_flags & MNT_NOEXEC) &&
                    S_ISREG(inode->i_mode)) {
-@@ -627,8 +634,10 @@
-        * Reparenting needs write_lock on tasklist_lock,
-        * so it is safe to do it under read_lock.
-        */
-+      /*
-       if (unlikely(tsk->group_leader == child_reaper(tsk)))
-               tsk->nsproxy->pid_ns->child_reaper = tsk;
-+              */
-       zap_other_threads(tsk);
-       read_unlock(&tasklist_lock);
 diff -Nurb linux-2.6.22-580/include/linux/arrays.h linux-2.6.22-590/include/linux/arrays.h
 --- linux-2.6.22-580/include/linux/arrays.h    1969-12-31 19:00:00.000000000 -0500
 +++ linux-2.6.22-590/include/linux/arrays.h    2008-04-30 09:29:41.000000000 -0400
@@ -311,7 +291,7 @@ diff -Nurb linux-2.6.22-580/kernel/mutex.c linux-2.6.22-590/kernel/mutex.c
  #include <linux/interrupt.h>
  #include <linux/debug_locks.h>
 +#include <linux/arrays.h>
-+
++#undef CONFIG_CHOPSTIX
 +#ifdef CONFIG_CHOPSTIX
 +struct event_spec {
 +      unsigned long pc;
@@ -745,3 +725,54 @@ diff -Nurb linux-2.6.22-580/mm/slab.c linux-2.6.22-590/mm/slab.c
        local_irq_restore(flags);
  }
  EXPORT_SYMBOL(kfree);
+--- linux-2.6.22.19-chopstix/mm/memory.c.orig  2008-02-25 18:59:40.000000000 -0500
++++ linux-2.6.22.19-chopstix/mm/memory.c       2009-02-17 18:34:55.000000000 -0500
+@@ -59,6 +59,7 @@
+ #include <linux/swapops.h>
+ #include <linux/elf.h>
++#include <linux/arrays.h>
+ #ifndef CONFIG_NEED_MULTIPLE_NODES
+ /* use the per-pgdat data instead for discontigmem - mbligh */
+@@ -2581,6 +2582,15 @@
+       return VM_FAULT_MINOR;
+ }
++extern void (*rec_event)(void *,unsigned int);
++struct event_spec {
++      unsigned long pc;
++      unsigned long dcookie; 
++      unsigned count;
++      unsigned char reason;
++};
++
++
+ /*
+  * By the time we get here, we already hold the mm semaphore
+  */
+@@ -2610,6 +2620,24 @@
+       if (!pte)
+               return VM_FAULT_OOM;
++#ifdef CONFIG_CHOPSTIX
++      if (rec_event) {
++              struct event event;
++              struct event_spec espec;
++        struct pt_regs *regs;
++        unsigned int pc;
++        regs = task_pt_regs(current);
++        pc = regs->eip & (unsigned int) ~4095;
++
++              espec.reason = 0; /* alloc */
++              event.event_data=&espec;
++              event.task = current;
++              espec.pc=pc;
++              event.event_type=5; 
++              (*rec_event)(&event, 1);
++      }
++#endif
++
+       return handle_pte_fault(mm, vma, address, pte, pmd, write_access);
+ }