Changed pagefault delivery to VM
this patch changes the way pagefaults are delivered to VM. It adopts the same model as the out-of-quantum messages sent by kernel to a scheduler. - everytime a userspace pagefault occurs, kernel creates a message which is sent to VM on behalf of the faulting process - the process is blocked on delivery to VM in the standard IPC code instead of waiting in a spacial in-kernel queue (stack) and is not runnable until VM tell kernel that the pagefault is resolved and is free to clear the RTS_PAGEFAULT flag. - VM does not need call kernel and poll the pagefault information which saves many (1/2?) calls and kernel calls that return "no more data" - VM notification by kernel does not need to use signals - each entry in proc table is by 12 bytes smaller (~3k save)
This commit is contained in:
@@ -28,16 +28,6 @@ typedef struct segframe {
|
||||
struct segdesc_s p_ldt[LDT_SIZE]; /* CS, DS and remote */
|
||||
} segframe_t;
|
||||
|
||||
/* Page fault event. Stored in process table. Only valid if PAGEFAULT
|
||||
* set in p_rts_flags.
|
||||
*/
|
||||
struct pagefault
|
||||
{
|
||||
u32_t pf_virtual; /* Address causing fault (CR2). */
|
||||
u32_t pf_flags; /* Pagefault flags on stack. */
|
||||
};
|
||||
|
||||
|
||||
/* fpu_state_s is used in kernel proc table.
|
||||
* Any changes in this structure requires changes in sconst.h,
|
||||
* since this structure is used in proc structure. */
|
||||
|
||||
@@ -614,7 +614,6 @@
|
||||
|
||||
/* Values for SVMCTL_PARAM. */
|
||||
#define VMCTL_I386_SETCR3 10
|
||||
#define VMCTL_GET_PAGEFAULT 11
|
||||
#define VMCTL_CLEAR_PAGEFAULT 12
|
||||
#define VMCTL_I386_GETCR3 13
|
||||
#define VMCTL_MEMREQ_GET 14
|
||||
@@ -1018,6 +1017,11 @@
|
||||
#define NR_VM_CALLS 42
|
||||
#define VM_CALL_MASK_SIZE BITMAP_CHUNKS(NR_VM_CALLS)
|
||||
|
||||
/* not handled as a normal VM call, thus at the end of the reserved rage */
|
||||
#define VM_PAGEFAULT (VM_RQ_BASE+0xff)
|
||||
# define VPF_ADDR m1_i1
|
||||
# define VPF_FLAGS m1_i2
|
||||
|
||||
/* Basic vm calls allowed to every process. */
|
||||
#define VM_BASIC_CALLS \
|
||||
VM_MMAP, VM_MUNMAP, VM_MUNMAP_TEXT, VM_MAP_PHYS, VM_UNMAP_PHYS
|
||||
|
||||
@@ -75,13 +75,12 @@ typedef unsigned long sigset_t;
|
||||
#define IS_SIGS(signo) (signo>=SIGS_FIRST && signo<=SIGS_LAST)
|
||||
|
||||
/* Signals delivered by the kernel. */
|
||||
#define SIGKPF 27 /* kernel page fault request pending */
|
||||
#define SIGKMEM 28 /* kernel memory request pending */
|
||||
#define SIGKMESS 29 /* new kernel message */
|
||||
#define SIGKSIGSM 30 /* kernel signal pending for signal manager */
|
||||
#define SIGKSIG 31 /* kernel signal pending */
|
||||
#define SIGKMEM 27 /* kernel memory request pending */
|
||||
#define SIGKMESS 28 /* new kernel message */
|
||||
#define SIGKSIGSM 29 /* kernel signal pending for signal manager */
|
||||
#define SIGKSIG 30 /* kernel signal pending */
|
||||
|
||||
#define SIGK_FIRST SIGKPF /* first kernel signal */
|
||||
#define SIGK_FIRST SIGKMEM /* first kernel signal */
|
||||
#define SIGK_LAST SIGKSIG /* last kernel signal */
|
||||
#define IS_SIGK(signo) (signo>=SIGK_FIRST && signo<=SIGK_LAST)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user