From: stevegt@TerraLuna.Org
To: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] SKAS: Why pass mm vs. current?
Date: Thu, 4 Sep 2003 19:06:23 -0700 [thread overview]
Message-ID: <20030905020623.GA1601@pathfinder> (raw)
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(¤t->mm->mmap_sem);
- error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
- up_write(¤t->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
next reply other threads:[~2003-09-05 2:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-05 2:06 stevegt [this message]
2003-09-05 20:12 ` [uml-devel] SKAS: Why pass mm vs. current? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030905020623.GA1601@pathfinder \
--to=stevegt@terraluna.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.