Changes

Jump to: navigation, search

On-demand accounting

38 bytes added, 12:33, 5 July 2007
m
spelling/wording fixes Example
Let's look at example of how this will work with the user memory accounting.
Currently we account for the [[physpages]] resource. That , that is -- , the number of physical pages consumed by the a set of processes. The accounting hooks are placed inside the page faults fault handlers and hurt thus hurting the performance. The Currently accounting looks like this:
<pre>
struct page *get_new_page(struct mm_struct *mm)
</pre>
However, we have a good upper estimation of the RSS size -- that is the lenghts lengths of mappings of the processes. Since the physical pages can only be allocated within these mappgins mappings, the RSS value can never exceed the sum of theis their lenghs. The accounting will then look like this:
<pre>
struct vm_area_struct *get_new_mapping(struct mm_struct *mm,
}
</pre>
We do not call the slow <code>charge_beancounter()</code> function in the page fault (<code>get_new_page()</code>). Instead we account for the upper estimation in <code>get_new_mapping()</code> call that happens rarely and thus increase do not affect the performance.
Note, that the <code>recalculate_the_rss()</code> is called to calculate the exact RSS value on the beancounter.

Navigation menu