Page MenuHomeFreeBSD

vnode_pager: clean up undirty_pages()
AcceptedPublic

Authored by dougm on Tue, Dec 23, 5:18 PM.
Tags
None
Referenced Files
F140623821: D54353.id168583.diff
Fri, Dec 26, 2:25 AM
F140623795: D54353.id168578.diff
Fri, Dec 26, 2:25 AM
F140610522: D54353.id.diff
Thu, Dec 25, 10:40 PM
Unknown Object (File)
Wed, Dec 24, 10:16 PM
Unknown Object (File)
Wed, Dec 24, 6:23 PM
Subscribers
None

Details

Reviewers
alc
kib
markj
Summary

The first (second) loop of vnode_pager_undirty_pages() includes an if-test to test whether an iteration is the last (first). Move those if-tests out of their loops.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dougm requested review of this revision.Tue, Dec 23, 5:18 PM
dougm created this revision.
sys/vm/vnode_pager.c
1529

I don't like that the same parameter (written, lpos) sometimes represents a quantity measured in bytes and other times pages. Adding a variable to represent page counts would better.

dougm marked an inline comment as done.

Add npages variable.

sys/vm/vnode_pager.c
1543

I suggest adding some comment after this point.

In the previous organization of the function, it was more or less clear that we process two runs of the pages: first run from the start to the written position, and the second run from eof to the end. Now it is less clear IMO. Explaining this would be beneficial to the reader.

In this place, it is useful to note that we skip touching pages between round_page(written) and trunc_page(eof).

Add comments preceding each block of code that processes a range of consecutive pages. Reformat comment blocks.

sys/vm/vnode_pager.c
1541
dougm marked 2 inline comments as done.

Fix comment typo.

This revision is now accepted and ready to land.Thu, Dec 25, 6:25 PM