With microkernels you get the option to implement copy on write as a kernel functionality but also as a user page fault handler.
I'm a bit muddled what is the best here. There is nothing preventing you from implementing both but I'm leaning towards putting in the kernel. The reason is the user page fault handler might not own or has the source page mapped when the fault occurs. The kernel can however map whatever physical page it wants. Also, kernel copy on write is faster due to you skip one or more context switches.
What do you think, where would you have put your copy on write functionality?
Copy on write with microkernels, put it in user or kernel?
-
- Member
- Posts: 595
- Joined: Mon Jul 05, 2010 4:15 pm
-
- Member
- Posts: 41
- Joined: Thu Aug 09, 2012 5:10 am
Re: Copy on write with microkernels, put it in user or kerne
Personally, I'd put it in the kernel. It's easier, and allows less outside manipulation.
<PixelToast> but i cant mouse
Porting is good if you want to port, not if you want maximum quality. -- sortie
Porting is good if you want to port, not if you want maximum quality. -- sortie
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Copy on write with microkernels, put it in user or kerne
Then just implement the copying in the running app to avoid the big overhead that is a task switch. After all, it has the original read-only version to start with.Also, kernel copy on write is faster due to you skip one or more context switches.
-
- Member
- Posts: 595
- Joined: Mon Jul 05, 2010 4:15 pm
Re: Copy on write with microkernels, put it in user or kerne
It is so obvious and makes sense, like I didn't see the forest because of all the trees. Unfortunately, there will be context switch due the design of the kernel but I like the approach none the less and this is probably the best solution so far. Definitely a good contender.Combuster wrote:Then just implement the copying in the running app to avoid the big overhead that is a task switch. After all, it has the original read-only version to start with.
EDIT: There is a slight chicken and egg problem with this solution. The pager needs to be registered before starting the user program and there is no real way to determine where the pager code is located in the executable before it has started.
Re: Copy on write with microkernels, put it in user or kerne
Assuming that this is still relevant, and the way you want to solve this is as above,OSwhatever wrote: EDIT: There is a slight chicken and egg problem with this solution. The pager needs to be registered before starting the user program and there is no real way to determine where the pager code is located in the executable before it has started.
Locating specific code in an executable becomes really easy if it's the only code at in a given executable section.
-
- Member
- Posts: 595
- Joined: Mon Jul 05, 2010 4:15 pm
Re: Copy on write with microkernels, put it in user or kerne
Yes, it is possible to locate that code in a special elf section. This might also only be done once, in the dynamic linker executable and the executable that is supposed to run does not need this special treatment.greyOne wrote:Assuming that this is still relevant, and the way you want to solve this is as above,
Locating specific code in an executable becomes really easy if it's the only code at in a given executable section.