mm: memcontrol: move comments for get_mctgt_type to proper position
Subsystems (3)
PATCH 1/1 mm: memcontrol: move comments for get_mctgt_type to proper position
From: Li RongQing <[email protected]>
move the comments for get_mctgt_type before the get_mctgt_type function
Signed-off-by Li RongQing <[email protected]>
--- mm/memcontrol.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)
mm/memcontrol.c +19 -18
@@ -4290,24 +4290,6 @@ static int mem_cgroup_do_precharge(unsigned long count)return 0 ; } -/** -* get_mctgt_type - get target type of moving charge -* @vma: the vma the pte to be checked belongs -* @addr: the address corresponding to the pte to be checked -* @ptent: the pte to be checked -* @target: the pointer the target page or swap ent will be stored(can be NULL) -* -* Returns -* 0(MC_TARGET_NONE): if the pte is not a target for move charge. -* 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for -* move charge. if @target is not NULL, the page is stored in target->page -* with extra refcnt got(Callers should handle it). -* 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a -* target for charge migration. if @target is not NULL, the entry is stored -* in target->ent. -* -* Called with pte lock held. -*/ union mc_target {struct page *page;swp_entry_t ent;
@@ -4496,6 +4478,25 @@ out:return ret; } +/** +* get_mctgt_type - get target type of moving charge +* @vma: the vma the pte to be checked belongs +* @addr: the address corresponding to the pte to be checked +* @ptent: the pte to be checked +* @target: the pointer the target page or swap ent will be stored(can be NULL) +* +* Returns +* 0(MC_TARGET_NONE): if the pte is not a target for move charge. +* 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for +* move charge. if @target is not NULL, the page is stored in target->page +* with extra refcnt got(Callers should handle it). +* 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a +* target for charge migration. if @target is not NULL, the entry is stored +* in target->ent. +* +* Called with pte lock held. +*/ +static enum mc_target_type get_mctgt_type (struct vm_area_struct *vma,unsigned long addr,pte_t ptent,union mc_target *target) {
Signature · 7 lines
2.1.4 -- 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/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · On Thu 19-05-16 15:57:18, [email protected]…
From: Li RongQing <[email protected]>
move the comments for
get_mctgt_typebefore theget_mctgt_typefunction
heh, it used to be much closer back then when introduced but we have grown quite some code since then...
Quoted 1 line
Signed-off-by Li RongQing <[email protected]>
Quoted 61 lines
--- mm/memcontrol.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)mm/memcontrol.c +19
-18@@ -4290,24 +4290,6 @@ static int mem_cgroup_do_precharge(unsigned long count)return 0 ; } -/** -* get_mctgt_type - get target type of moving charge -* @vma: the vma the pte to be checked belongs -* @addr: the address corresponding to the pte to be checked -* @ptent: the pte to be checked -* @target: the pointer the target page or swap ent will be stored(can be NULL) -* -* Returns -* 0(MC_TARGET_NONE): if the pte is not a target for move charge. -* 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for -* move charge. if @target is not NULL, the page is stored in target->page -* with extra refcnt got(Callers should handle it). -* 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a -* target for charge migration. if @target is not NULL, the entry is stored -* in target->ent. -* -* Called with pte lock held. -*/ union mc_target {struct page *page;swp_entry_t ent;@@ -4496,6 +4478,25 @@ out:return ret; } +/** +* get_mctgt_type - get target type of moving charge +* @vma: the vma the pte to be checked belongs +* @addr: the address corresponding to the pte to be checked +* @ptent: the pte to be checked +* @target: the pointer the target page or swap ent will be stored(can be NULL) +* +* Returns +* 0(MC_TARGET_NONE): if the pte is not a target for move charge. +* 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for +* move charge. if @target is not NULL, the page is stored in target->page +* with extra refcnt got(Callers should handle it). +* 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a +* target for charge migration. if @target is not NULL, the entry is stored +* in target->ent. +* +* Called with pte lock held. +*/ +static enum mc_target_type get_mctgt_type (struct vm_area_struct *vma,unsigned long addr,pte_t ptent,union mc_target *target) {Signature · 1 line
2.1.4
Signature · 2 lines
Michal Hocko SUSE Labs