Why do you increment the use counter at all in nopage?
There's something wrong here. You shouldn't need to calculate any of this.
The VM layer already keeps track of how many pages are associated with a
mapping in "mapping->nr_pages". Why do you maintain extra counters that
do not give you anything at all?
You should count how many swap cache entries you have allocated for this
inode, and nothing more - the VM keeps track of everything else for you
already. It looks like this code is all historical baggage from when the
shm code didn't use the VM page cache? I'd rather remove it than try to
edit it, no?
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/