Skip to contentSkip to conversation

The long, long life of an inactive_dirty page

DISCUSSION Andrew Crawford 2 participants 2 messages May 12, 2004 Memory management

lore
Share & tools
lore
#0 lore raw

Thanks for all your replies so far, and the helpful information.

Quoted 2 lines

well you may IF you fix your mail setup to not send me evil mails about having to confirm something.

Just to clarify, you received that mail because you replied to this address directly; This account don't accept emails from unverified addresses. This account is not subscribed to linux-mm, which I read elsewhere.

Quoted 3 lines

One thing to realize is that after bdflush has written the pages out, they can become dirty AGAIN for a variety of reasons, and as such the accounting is not quite straightforward.

Is it possible for a page to become dirty again while still remaining inactive? Could you give an example? (genuinely curious, hope this doesn't sound like I'm arguing!)

Quoted 1 line

the problem is that the "becoming clean" is basically asynchronous

Isn't this equally true for page_launder? Even if bdflush would wait until the next "pass" to move pages to the "clean" list it would be better than the current situation. There must be some mechanism that bdflush uses to avoid writing the same page twice in a row; couldn't it say "oh, already wrote that one, into inactive_clean it goes".

You will probably appreciate that I am coming at this from the point of view of performance measurement and capacity planning; I want to know how much actual memory is free or immediately reusable at a point in time.

With thanks for all help,

Andrew

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 8 lines · Andrew Crawford

Thanks for all your replies so far, and the helpful information.

Quoted 2 lines

well you may IF you fix your mail setup to not send me evil mails about having to confirm something.

Just to clarify, you received that mail because you replied to this address directly; This account don't accept emails from unverified addresses. This account is not subscribed to linux-mm, which I read elsewhere.

I find that truely obnoxious.

Quoted 7 lines
Quoted 3 lines

One thing to realize is that after bdflush has written the pages out, they can become dirty AGAIN for a variety of reasons, and as such the accounting is not quite straightforward.

Is it possible for a page to become dirty again while still remaining inactive? Could you give an example? (genuinely curious, hope this doesn't sound like I'm arguing!)

If someone has that page mmaped for example, the app that has it mmap'd can just write to the memory (which makes the page dirty in the pagetable). The kernel doesn't get involved in that at all.

Quoted 7 lines
Quoted 1 line

the problem is that the "becoming clean" is basically asynchronous

Isn't this equally true for page_launder? Even if bdflush would wait until the next "pass" to move pages to the "clean" list it would be better than the current situation. There must be some mechanism that bdflush uses to avoid writing the same page twice in a row; couldn't it say "oh, already wrote that one, into inactive_clean it goes".

It's slightly more subtle in the kernel you looked at. There is a list for "write out pending" and a "clean" list.
Between all these lists there is a strict LRU order. You don't move it to clean once it gets clean, you move it to "write out pending" when you start writeout, and the VM moves the *other* side of the writeout list to the clean list when it's clean.

Quoted 3 lines

You will probably appreciate that I am coming at this from the point of view of performance measurement and capacity planning; I want to know how much actual memory is free or immediately reusable at a point in time.

That information is not achievable in a reliable way, ever. Simply because it takes a not-even-near-inifintely small amount of time to gather all the stats, during which the other cpu can change all the underlying data away under your nose.