diff options
Diffstat (limited to 'mm/ksm.c')
-rw-r--r-- | mm/ksm.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -320,10 +320,9 @@ static inline void free_mm_slot(struct mm_slot *mm_slot) | |||
320 | 320 | ||
321 | static struct mm_slot *get_mm_slot(struct mm_struct *mm) | 321 | static struct mm_slot *get_mm_slot(struct mm_struct *mm) |
322 | { | 322 | { |
323 | struct hlist_node *node; | ||
324 | struct mm_slot *slot; | 323 | struct mm_slot *slot; |
325 | 324 | ||
326 | hash_for_each_possible(mm_slots_hash, slot, node, link, (unsigned long)mm) | 325 | hash_for_each_possible(mm_slots_hash, slot, link, (unsigned long)mm) |
327 | if (slot->mm == mm) | 326 | if (slot->mm == mm) |
328 | return slot; | 327 | return slot; |
329 | 328 | ||
@@ -496,9 +495,8 @@ static inline int get_kpfn_nid(unsigned long kpfn) | |||
496 | static void remove_node_from_stable_tree(struct stable_node *stable_node) | 495 | static void remove_node_from_stable_tree(struct stable_node *stable_node) |
497 | { | 496 | { |
498 | struct rmap_item *rmap_item; | 497 | struct rmap_item *rmap_item; |
499 | struct hlist_node *hlist; | ||
500 | 498 | ||
501 | hlist_for_each_entry(rmap_item, hlist, &stable_node->hlist, hlist) { | 499 | hlist_for_each_entry(rmap_item, &stable_node->hlist, hlist) { |
502 | if (rmap_item->hlist.next) | 500 | if (rmap_item->hlist.next) |
503 | ksm_pages_sharing--; | 501 | ksm_pages_sharing--; |
504 | else | 502 | else |
@@ -1898,7 +1896,6 @@ int page_referenced_ksm(struct page *page, struct mem_cgroup *memcg, | |||
1898 | { | 1896 | { |
1899 | struct stable_node *stable_node; | 1897 | struct stable_node *stable_node; |
1900 | struct rmap_item *rmap_item; | 1898 | struct rmap_item *rmap_item; |
1901 | struct hlist_node *hlist; | ||
1902 | unsigned int mapcount = page_mapcount(page); | 1899 | unsigned int mapcount = page_mapcount(page); |
1903 | int referenced = 0; | 1900 | int referenced = 0; |
1904 | int search_new_forks = 0; | 1901 | int search_new_forks = 0; |
@@ -1910,7 +1907,7 @@ int page_referenced_ksm(struct page *page, struct mem_cgroup *memcg, | |||
1910 | if (!stable_node) | 1907 | if (!stable_node) |
1911 | return 0; | 1908 | return 0; |
1912 | again: | 1909 | again: |
1913 | hlist_for_each_entry(rmap_item, hlist, &stable_node->hlist, hlist) { | 1910 | hlist_for_each_entry(rmap_item, &stable_node->hlist, hlist) { |
1914 | struct anon_vma *anon_vma = rmap_item->anon_vma; | 1911 | struct anon_vma *anon_vma = rmap_item->anon_vma; |
1915 | struct anon_vma_chain *vmac; | 1912 | struct anon_vma_chain *vmac; |
1916 | struct vm_area_struct *vma; | 1913 | struct vm_area_struct *vma; |
@@ -1952,7 +1949,6 @@ out: | |||
1952 | int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) | 1949 | int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) |
1953 | { | 1950 | { |
1954 | struct stable_node *stable_node; | 1951 | struct stable_node *stable_node; |
1955 | struct hlist_node *hlist; | ||
1956 | struct rmap_item *rmap_item; | 1952 | struct rmap_item *rmap_item; |
1957 | int ret = SWAP_AGAIN; | 1953 | int ret = SWAP_AGAIN; |
1958 | int search_new_forks = 0; | 1954 | int search_new_forks = 0; |
@@ -1964,7 +1960,7 @@ int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) | |||
1964 | if (!stable_node) | 1960 | if (!stable_node) |
1965 | return SWAP_FAIL; | 1961 | return SWAP_FAIL; |
1966 | again: | 1962 | again: |
1967 | hlist_for_each_entry(rmap_item, hlist, &stable_node->hlist, hlist) { | 1963 | hlist_for_each_entry(rmap_item, &stable_node->hlist, hlist) { |
1968 | struct anon_vma *anon_vma = rmap_item->anon_vma; | 1964 | struct anon_vma *anon_vma = rmap_item->anon_vma; |
1969 | struct anon_vma_chain *vmac; | 1965 | struct anon_vma_chain *vmac; |
1970 | struct vm_area_struct *vma; | 1966 | struct vm_area_struct *vma; |
@@ -2005,7 +2001,6 @@ int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | |||
2005 | struct vm_area_struct *, unsigned long, void *), void *arg) | 2001 | struct vm_area_struct *, unsigned long, void *), void *arg) |
2006 | { | 2002 | { |
2007 | struct stable_node *stable_node; | 2003 | struct stable_node *stable_node; |
2008 | struct hlist_node *hlist; | ||
2009 | struct rmap_item *rmap_item; | 2004 | struct rmap_item *rmap_item; |
2010 | int ret = SWAP_AGAIN; | 2005 | int ret = SWAP_AGAIN; |
2011 | int search_new_forks = 0; | 2006 | int search_new_forks = 0; |
@@ -2017,7 +2012,7 @@ int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *, | |||
2017 | if (!stable_node) | 2012 | if (!stable_node) |
2018 | return ret; | 2013 | return ret; |
2019 | again: | 2014 | again: |
2020 | hlist_for_each_entry(rmap_item, hlist, &stable_node->hlist, hlist) { | 2015 | hlist_for_each_entry(rmap_item, &stable_node->hlist, hlist) { |
2021 | struct anon_vma *anon_vma = rmap_item->anon_vma; | 2016 | struct anon_vma *anon_vma = rmap_item->anon_vma; |
2022 | struct anon_vma_chain *vmac; | 2017 | struct anon_vma_chain *vmac; |
2023 | struct vm_area_struct *vma; | 2018 | struct vm_area_struct *vma; |