Skip to contentSkip to conversation

pageable page tables

DISCUSSION Rik van Riel 1 participant 2 messages Dec 9, 1997 1 message not in the archive Memory management

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Pavel Machek

Hi!

Quoted 5 lines
Quoted 4 lines

Simple task might be 'memory priorities'. Something like priorities for scheduler but for memory. (I tried to implement them, and they gave <1% performance gain ;-), but I have interface to set such parameter if you want to play).

Quoted 6 lines
Quoted 1 line

sounds rather good... (swapout-priorities??)

But proved to be pretty ineffective. I came to this idea when I realized that to cook machine, running 100 processes will not hurt too much. But running 10 processes, 50 megabytes each will cook almost anything...

I think it will be more of a scheduling issue... Suspending low-priority, background jobs for a minute (in turn) will make swapping / running possible again (even without changes to the swapping code).

To do this, we could create a new scheduling class: SCHED_BG Processes in this class are run:
- one at a time (possibly two??)
- for LONG slices, getting longer after each slice (a'la CTSS)
- so only one of them has to be in memory...
- at a lower priority than interactive jobs.
- CPU time and memory used by these processes aren't charged when user quota's are inforced... this should encourage users to run large jobs (and even medium compiles) as SCHED_BG jobs

about the time-slicing:
- the SCHED_BG process is run when no interactive process is runnable
- it starts with a 1 second slice, followed by 2, 4, 8, 16, and longer timeslices (in order to reduce swapping).
- these slices are only interrupted by:
- an interactive process wanting the CPU
- blocking on a resource
- another SCHED_BG process is woken up
- after the timeslice is over, the process is put to sleep for a duration of: last_timeslice * nr_background_processes
- when no background process is running/runnable, the next SCHED_BG process to be woken up is made runnable
- the SCHED_BG processes can run together/in parrallel when available memory is above a certain threshold (then they can receive 'normal' timeslices)

And when free memory stays below free_pages_low for more than 5 seconds, we can choose to have even normal processes queued for some time (in order to reduce paging)

Where Do You Want Us To Take You Today ? (tm)

Rik.

--
Send Linux memory-management wishes to me: I'm currently looking for something to hack...

#2 lore raw
In reply to a message not in the archive
Quoted 11 lines · Pavel Machek
Quoted 6 lines
Quoted 4 lines

Simple task might be 'memory priorities'. Something like priorities for scheduler but for memory. (I tried to implement them, and they gave <1% performance gain ;-), but I have interface to set such parameter if you want to play).

sounds rather good... (swapout-priorities??)

But proved to be pretty ineffective. I came to this idea when I realized that to cook machine, running 100 processes will not hurt too much. But running 10 processes, 50 megabytes each will cook almost anything...

what about:

if (page->age - p->mem_priority)

	exit 0 / goto next;
else {
	get_rid_of(page);
	and_dont_show_your_face_again_for_some_time(page);
}

effectively putting the program to sleep if:
- this page faults again soon
- memory is still tight

hmm, just an idea...

Rik.

--
Send Linux memory-management wishes to me: I'm currently looking for something to hack...