Possible fault while swapping code pages in stage 27?

79 views
Skip to first unread message

ADEEB HADI.SEEYAD

unread,
Dec 2, 2022, 12:58:37 AM12/2/22
to XOS Users
In stage 27 after selecting a process to swap to disk, the stack pages and the unshared heap pages of the process are swapped to the disk after which the stack pages, unshared heap pages and the code pages are released. Documentation just asks to check if the page is shared for heap pages.
"Now that, a process is selected to swap out, the TICK field for the selected process is initialized to 0. (From now on, the TICK field must count for what amount of time the process has been in memory). The code pages for the swapping-out process are released and the page table entries of the code pages are invalidated. The process selected for swapping out, can have shared heap pages. To simplify implementation, shared heap pages are not swapped out into the disk. Again, to simplify implementation, the kernel stack page is also not swapped out." - Documentation
But doesn't swapping shared code pages create an issue since we are not updating the page table of the processes sharing the code page and hence when these processes try to access the page since the valid bit is set they end up accessing the wrong page instead of an exception arising? 
Or am I missing something here?

ALEN ANTONY

unread,
Dec 2, 2022, 2:53:29 AM12/2/22
to XOS Users
The shared memory pages won't be allocated to any other process, as the contents of the memory free list entry for those pages would not be zero.(It will be the number of processes (not swapped) sharing the page).

ADEEB HADI.SEEYAD

unread,
Dec 2, 2022, 4:11:27 AM12/2/22
to XOS Users
Ya makes sense.

Murali Krishnan

unread,
Dec 2, 2022, 10:03:09 AM12/2/22
to xos-...@googlegroups.com
Thanks Alan
Murali

--
You received this message because you are subscribed to the Google Groups "XOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xos-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/xos-users/8abfbb7a-fdea-4c20-a5fe-1c24f42aef1fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages