Operating system page table & Process Scheduling Tips

This article said that two small Tips about time and space, that is, the CPU and memory of the enemy ... the recent burst of CVE-2019-11478 even let the evil enemy together to shake hands ... See:
HTTPS: // blog.csdn.net/dog250/article/details/94654620

TCP does not say, the next page table and talk about the process of scheduling, this is the core of the core of modern operating systems.

Page table

Whenever possible the index, it must be converted to find, time for space.
Whenever you can find, it must be converted to an index, space for time.
Ratings page table index table memory for more, but not too many 32-bit systems, it can be used.
Ratings page table index table memory for more, but in a non-sparse address 64-bit system architecture, not too much, it can be used.
Hierarchical page table index memory for more, in the case of the sparse structure of 64-bit address system, is unavailable.
Ratings page table index of all virtual address mapping, then the series, the more memory consumption, increase the significance of the index series sparse address space is good.
Because the system all the processes share the same physical memory space, you can imagine, due to the isolation of address spaces, each physical page is basically a part of the process, the virtual page is mapped to the physical page can be converted into a physical one by one page traverse ask the question "are you not already been assigned to me?."

But although there is no physical address space of the virtual address space is big, but not small, one by one traversal unrealistic, therefore, conventional hash is an immediate solution. That first virtual address together with its process ID hash to a smaller physical address space, and then traverse the small space can be.

Considering the shared page, such as this Glibc, the so-called conflict chain will have two categories, namely hash collision and sharing violation.

Thus, a reasonable type of the page table that looks like the following:


This is the inverted page table, note that the system has only one table, a super save memory. Performance depends on the performance of the hash algorithm and synchronization are mutually exclusive.

The core idea is that the index will be able to change the look.

Process Scheduling

In the early, UNIX process scheduling strategies varied, various algorithms, but that time has passed, and now is the era of multi-core, there are more important things to focus on, rather than scheduling policy.

In the early era of the single CPU, all the processes to be in this unique CPU serial line, so it all depends on the efficiency of fairness scheduling algorithm. For example, the process can not starve a long process short, short process to end as soon as possible, and so on.

Now to the multi-core era, due to the presence of multiple execution cores, scheduled to convert to focus on process / thread to find the most suitable processing core. Rather than / select the most appropriate thread execution time for the process.

So, nested question is, for a single processing core, the need does not need to process / thread to select the most appropriate execution time. The answer is needed, but did not matter. Because there are multiple processing cores, process / thread will not choked, big deal to go to other processing cores chant.

So, multi-core era, what needs attention?

Note that multi-core and multi-CPU is not a concept, a little different, multi-core structure necessary thing is the cache architecture, and caching architecture decision process / thread migration between the processing core, and this is precisely scheduled one of the core algorithm.

But in the case of hunger, can not migrate process / thread will not mobility, which will improve the cache utilization.

Secondly, for the individual processing cores, we will find, whether it is Windows NT 4.0+, or Linux 2.6 / 3.x / 4.x / 5.x, or FreeBSD, various UNIX variants, size-fits-all Linux-like 2.6 O (1) O (1) O (1) algorithm, even if the new CFS Linux is no exception:

Dynamic priority adjustment.
Punishment computational task, the task reward IO type.
For a single core, more mature and technology seem enough, but the process between multi-core / thread migration still unsatisfactory, there is still a long way to go. See the following links:
at The Linux Scheduler: A Wasted Decade of Cores
reads as follows:
http://www.ece.ubc.ca/~sasha/papers/eurosys16-final29.pdf

The reason is so bad, it seems to me that the idea of ​​design, people still follow the ancient idea of ​​scheduling algorithm designed to do that in a single processing core, hoping to find a best time to schedule a most appropriate the process / thread.

But on the contrary, I think this is not a time dimension algorithm, but converted into a spatial dimension algorithm, similar to the memory allocation problem, not the problem of CPU time assigned.

Yes, multi-core scheduling, similar to the design of an efficient memory allocation algorithms, no debris (no busy no idle), high cache utilization.

━━━ ● ━━━─ shoes wet 2:07 ─ not fat - the
⇆ ㅤ ㅤ ㅤ ㅤ the ◁ ▷ ❚❚

 

Guess you like

Origin blog.csdn.net/qq_42763389/article/details/95356897