From: Jeff D. <jd...@ka...> - 2003-01-04 23:27:34
|
jon...@ya... said: > UML is SMP capable now and I couldn't figure out how SMP can work if > the kernel processes run in separate address spaces. In tt mode, the procedure is this: early in boot, UML copies its text and data segments into anonymous mapped memory the text and data segments are unmapped the shared memory segments are mapped MAP_SHARED in their place This turns off the COW that would normally happen on fork() and causes that data to be shared among all the UML host processes. Given this, SMP works automatically. Even though there are a bazillion UML !CLONE_VM processes on the host, the kernel text and data are shared between them. In skas mode, there's nothing to do. There is one kernel address space and the processors are threads in that address space. I don't know what the problem is, exactly. If it is that only one process can mmap io memory, then tt mode is screwed. It doesn't sound like you can play the same remapping games with that memory. skas mode would be fine, though. > We may not hear from him for a while. Heh, snow doesn't hurt my connectivity. It does hurt my mobility (there's a large, oddly-shaped pile of snow at the end of my driveway, and I'm assuming my car is inside it somethere :-). > I think he is located somewhere > in upper Vermont/New Hampshire. Central-ish NH. > I just got two feet of snow in Boston, > he probably got twice as much. A little more than a foot so far - it's still snowing here. (Jerold - I haven't yet congratulated you on this work. I've been waiting for quite a while for someone to do this. It will be a boon to driver writers everywhere once it's up to date. I would recommend making an announcement on the kernel list - that might rustle up some volunteers to polish the code). Jeff Jeff |
From: Jeff D. <jd...@ka...> - 2003-01-05 03:30:15
|
jon...@ya... said: > How does this work: > 1) tt mode is booted and all of the kernel processes have been created. > 2) I insmod a new device driver > 3) It wants to iomap memory that should appear in all of the kernel > processes' address space. > > mmap says: > MAP_SHARED Share this mapping with all other processes that > map this object. Storing to the region is equivalent to writing to the > file. > > Which object is "this object", the file descriptor? It would be easy > to open /dev/mem or /proc/bus/pci/xxx before the initial fork()s > occur. Would this make the mmap appear in all of the forked() > processes? "Share this mapping" is misleading. What MAP_SHARED really does is share the data with any other processes that have somehow managed to map the same object. It doesn't change the address space mappings in any other processes. fork() copies the parent address space. Any mappings that are MAP_PRIVATE are COWed. MAP_SHARED mappings end up in the child shared. So, if you open the descriptor and map from it before any other processes are created, then you win. If not, then the mapping will appear in only those processes that are children of the process that did the mapping, which are forked after the map is made. A workaround which I use for kernel VM in tt mode is to set some flag at the time the new mapping is created. This flag is checked at context-switch time, and the incoming process changes whatever mappings need changing. This works for UP, but not SMP. SMP needs an IPI to be sent around to the other processors so they know what they need to update. In skas mode, like I've said before, none of this is a problem. Jeff |
From: Jon S. <jon...@ya...> - 2003-01-05 03:48:21
|
Could tt mode use clone() instead of fork()? Or is the plan for tt mode to die and skas be the one true path. ===== Jon Smirl jon...@ya... __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |
From: Jeff D. <jd...@ka...> - 2003-01-05 16:31:31
|
jon...@ya... said: > Could tt mode use clone() instead of fork()? Have you read the code? Jeff |
From: j p <jp...@ho...> - 2003-01-08 20:09:13
|
From: j p <jp...@ho...> - 2003-01-08 21:22:04
|
From: j p <jp...@ho...> - 2003-01-08 21:26:17
|
From: Jon S. <jon...@ya...> - 2003-01-05 00:32:26
|
How does this work: 1) tt mode is booted and all of the kernel processes have been created. 2) I insmod a new device driver 3) It wants to iomap memory that should appear in all of the kernel processes' address space. mmap says: MAP_SHARED Share this mapping with all other processes that map this object. Storing to the region is equivalent to writing to the file. Which object is "this object", the file descriptor? It would be easy to open /dev/mem or /proc/bus/pci/xxx before the initial fork()s occur. Would this make the mmap appear in all of the forked() processes? ===== Jon Smirl jon...@ya... __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |