rename is_mlocked_vma() to mlocked_vma_newpage()
Subsystems (4)
PATCH 1/1 rename is_mlocked_vma() to mlocked_vma_newpage()
Andrew pointed out that the is_mlocked_vma() is misnamed. A function with name like that would expect bool return and no side-effects.
Since it is called on the fault path for new page, rename it in this patch.
--- mm/internal.h | 5 +++-- mm/vmscan.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
mm/internal.h +3 -2
@@ -131,7 +131,8 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)* to determine if it's being mapped into a LOCKED vma. * If so, mark page as mlocked. */ -static inline int is_mlocked_vma (struct vm_area_struct *vma,struct page *page) +static inline int mlock_vma_newpage (struct vm_area_struct *vma, +struct page *page) {VM_BUG_ON (PageLRU (page));
@@ -189,7 +190,7 @@ extern unsigned long vma_address(struct page *page, struct vm_area_struct *vma);#endif #else /* !CONFIG_MMU */ -static inline int is_mlocked_vma (struct vm_area_struct *v,struct page *p) +static inline int mlock_vma_newpage (struct vm_area_struct *v,struct page *p) {return 0 ; }
mm/vmscan.c +1 -1
@@ -3531,7 +3531,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma)if (mapping_unevictable (page_mapping (page)))return 0 ; -if (PageMlocked (page) || (vma &&is_mlocked_vma (vma, page))) +if (PageMlocked (page) || (vma &&mlock_vma_newpage (vma, page)))return 0 ;return 1 ;
Signature · 8 lines
1.7.7.3 -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Ying Han
Andrew pointed out that the
is_mlocked_vma()is misnamed. A function with name like that would expect bool return and no side-effects.Since it is called on the fault path for new page, rename it in this patch.
Signed-off-by Ying Han<[email protected]>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Ying Han
Andrew pointed out that the
is_mlocked_vma()is misnamed. A function with name like that would expect bool return and no side-effects.Since it is called on the fault path for new page, rename it in this patch.
Signed-off-by Ying Han<[email protected]>
Good.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Ying Han
Andrew pointed out that the
is_mlocked_vma()is misnamed. A function with name like that would expect bool return and no side-effects.Since it is called on the fault path for new page, rename it in this patch.
Signed-off-by Ying Han <[email protected]>
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Ying Han
Andrew pointed out that the
is_mlocked_vma()is misnamed. A function with name like that would expect bool return and no side-effects.Since it is called on the fault path for new page, rename it in this patch.
Signed-off-by Ying Han <[email protected]>
Nitpick:
mlocked_vma_newpage is better?
It seems I am a paranoic about naming. :-)
Feel free to ignore if you don't want.
Quoted 41 lines
--- mm/internal.h | 5 +++-- mm/vmscan.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)mm/internal.h +3
-2@@ -131,7 +131,8 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)* to determine if it's being mapped into a LOCKED vma. * If so, mark page as mlocked. */ -static inline int is_mlocked_vma (struct vm_area_struct *vma,struct page *page) +static inline int mlock_vma_newpage (struct vm_area_struct *vma, +struct page *page) {VM_BUG_ON (PageLRU (page));@@ -189,7 +190,7 @@ extern unsigned long vma_address(struct page *page, struct vm_area_struct *vma);#endif #else /* !CONFIG_MMU */ -static inline int is_mlocked_vma (struct vm_area_struct *v,struct page *p) +static inline int mlock_vma_newpage (struct vm_area_struct *v,struct page *p) {return 0 ; }mm/vmscan.c +1
-1@@ -3531,7 +3531,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma)if (mapping_unevictable (page_mapping (page)))return 0 ; -if (PageMlocked (page) || (vma &&is_mlocked_vma (vma, page))) +if (PageMlocked (page) || (vma &&mlock_vma_newpage (vma, page)))return 0 ;return 1 ;
Signature · 9 lines
Kind regards, Minchan Kim -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 12 lines · Minchan Kim
Quoted 7 lines · Ying Han
Andrew pointed out that the
is_mlocked_vma()is misnamed. A function with name like that would expect bool return and no side-effects.Since it is called on the fault path for new page, rename it in this patch.
Signed-off-by Ying Han <[email protected]>
Quoted 7 lines
Reviewed-by Minchan Kim <[email protected]>Nitpick:
mlocked_vma_newpageis better?
It seems I am a paranoic about naming. :-)
Feel free to ignore if you don't want.
Thanks, at least I see it is inconsistant to the title.
I will post another one
--Ying
Quoted 43 lines
Quoted 43 lines
---
mm/internal.h | 5 +++--
mm/vmscan.c | 2 +-2 files changed, 4 insertions(+), 3 deletions(-)mm/internal.h +3
-2@@ -131,7 +131,8 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)* to determine if it's being mapped into a LOCKED vma. * If so, mark page as mlocked. */ -static inline int is_mlocked_vma (struct vm_area_struct *vma,struct page *page) +static inline int mlock_vma_newpage (struct vm_area_struct *vma, + struct page *page) { VM_BUG_ON(PageLRU(page));@@ -189,7 +190,7 @@ extern unsigned long vma_address(struct page *page, struct vm_area_struct *vma); #endif #else /* !CONFIG_MMU */ -static inline int is_mlocked_vma (struct vm_area_struct *v,struct page *p) +static inline int mlock_vma_newpage (struct vm_area_struct *v,struct page *p) { return 0; }mm/vmscan.c +1
-1@@ -3531,7 +3531,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) if (mapping_unevictable(page_mapping(page))) return 0; - if (PageMlocked(page) || (vma && is_mlocked_vma(vma, page))) + if (PageMlocked(page) || (vma && mlock_vma_newpage(vma, page))) return 0;
Quoted 7 lines
mm/vmscan.c int page_evictable(struct page *page, struct vm_area_struct *vma) · line 3537
Quoted 1 line
mm/vmscan.c +0
-0return 1;--
Kind regards,
Minchan Kim
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>