mm/rmap: use rmap_walk() in page_referenced()
authorJoonsoo Kim <[email protected]>
Tue, 21 Jan 2014 23:49:53 +0000 (15:49 -0800)
committerLinus Torvalds <[email protected]>
Wed, 22 Jan 2014 00:19:45 +0000 (16:19 -0800)
commit9f32624be943538983eb0f18b73a9052d1493c80
tree990e19eac9ef2534e8fc0909ff7f8aabc9a09d00
parente8351ac9bfa7f4412d5d196b6742309473ca506d
mm/rmap: use rmap_walk() in page_referenced()

Now, we have an infrastructure in rmap_walk() to handle difference from
variants of rmap traversing functions.

So, just use it in page_referenced().

In this patch, I change following things.

1. remove some variants of rmap traversing functions.
cf> page_referenced_ksm, page_referenced_anon,
page_referenced_file

2. introduce new struct page_referenced_arg and pass it to
   page_referenced_one(), main function of rmap_walk, in order to count
   reference, to store vm_flags and to check finish condition.

3. mechanical change to use rmap_walk() in page_referenced().

[[email protected]: fix BUG at rmap_walk]
Signed-off-by: Joonsoo Kim <[email protected]>
Reviewed-by: Naoya Horiguchi <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Hillf Danton <[email protected]>
Signed-off-by: Wanpeng Li <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/ksm.h
include/linux/rmap.h
mm/ksm.c
mm/rmap.c