All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] SKAS: Why pass mm vs. current?
@ 2003-09-05  2:06 stevegt
  2003-09-05 20:12 ` Jeff Dike
  0 siblings, 1 reply; 7+ messages in thread
From: stevegt @ 2003-09-05  2:06 UTC (permalink / raw)
  To: user-mode-linux-devel

Hi All & Jeff,

I'm working on a modified SKAS patch to allow running SKAS mode guests
on openMosix hosts (don't get excited -- no guest process migration,
just SKAS).   I have a question about why the skas patch passes mm down
through the do_mmap* call tree.  Why not just use current->mm when
needed, the way the original kernel does?  Or, if there's a context
issue, then why not pass all of current as a task_struct pointer,
instead of just current->mm?  That would seem to be a lot more flexible.
I know I'm missing something, I'm just not sure what yet.

Here's why I ask -- the process of merging the openMosix and SKAS
patches looks relatively straightforward; these are the only overt
conflicts (openMosix is "-", SKAS is "+"):

____________________________________________________________________________
arch/i386/kernel/sys_i386.c.rej
____________________________________________________________________________
***************
*** 59,67 ****
                        goto out;
        }
  
-       down_write(&current->mm->mmap_sem);
-       error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
-       up_write(&current->mm->mmap_sem);
  
        if (file)
                fput(file);
--- 59,67 ----
                        goto out;
        }
  
+       down_write(&mm->mmap_sem);
+       error = do_mmap_pgoff(mm, file, addr, len, prot, flags, pgoff);
+       up_write(&mm->mmap_sem);
  
        if (file)
                fput(file);
____________________________________________________________________________
mm/mmap.c.rej
____________________________________________________________________________
***************
*** 390,399 ****
        return 0;
  }
  
- unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, unsigned long len,
-       unsigned long prot, unsigned long flags, unsigned long pgoff)
  {
-       struct mm_struct * mm = current->mm;
        struct vm_area_struct * vma, * prev;
        unsigned int vm_flags;
        int correct_wcount = 0;
--- 390,400 ----
        return 0;
  }
  
+ unsigned long do_mmap_pgoff(struct mm_struct *mm, struct file * file, 
+                           unsigned long addr, unsigned long len,
+                           unsigned long prot, unsigned long flags, 
+                           unsigned long pgoff)
  {
        struct vm_area_struct * vma, * prev;
        unsigned int vm_flags;
        int correct_wcount = 0;
____________________________________________________________________________


The less-overt conflict comes from the fact that SKAS assumes that mm is
passed down through the call tree, but openMosix assumes that current is
still correct down deeper, in do_mmap_pgoff and do_mmap_pgoff_down, and
it uses it.  Neither the original kernel nor SKAS use current that deep,
so the SKAS patch doesn't need it or pass it.  

In other words, SKAS only passes mm, but openMosix needs all of current.

The simple thing for me to do might be to pass current down through the
do_mmap* call tree, rather than mm, and get mm from that when needed.  I
just don't know whether that's necessary, or whether it might introduce
other problems, since I don't see why mm was passed in the first place.
Can anyone tell me what I'm missing?

Steve
-- 
Stephen G. Traugott  (KG6HDQ)
UNIX/Linux Infrastructure Architect, TerraLuna Aerospace LLC
stevegt@TerraLuna.Org 
http://www.stevegt.com -- http://Infrastructures.Org 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

end of thread, other threads:[~2003-09-09  3:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-05  2:06 [uml-devel] SKAS: Why pass mm vs. current? stevegt
2003-09-05 20:12 ` Jeff Dike
2003-09-05 21:08   ` stevegt
2003-09-05 21:28     ` Bryan O'Sullivan
2003-09-05 21:47       ` stevegt
2003-09-05 21:53         ` Bryan O'Sullivan
2003-09-08 22:51           ` Adam Heath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.