diff options
author | Li RongQing <roy.qing.li@gmail.com> | 2016-05-27 17:27:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-27 17:49:37 -0400 |
commit | 7cf7806ce1e30f1691cf340f70b807acbdf419ef (patch) | |
tree | 9fc7ae25996758104f7d0d7bef3fce80807689cf /mm | |
parent | cbedbac3e66121ddbac363776c23119f8eaeefda (diff) |
mm/memcontrol.c: move comments for get_mctgt_type() to proper position
Move the comments for get_mctgt_type() to be before get_mctgt_type()
implementation.
Link: http://lkml.kernel.org/r/1463644638-7446-1-git-send-email-roy.qing.li@gmail.com
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 485c688a7fa8..925b431f3f03 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4309,24 +4309,6 @@ static int mem_cgroup_do_precharge(unsigned long count) | |||
4309 | return 0; | 4309 | return 0; |
4310 | } | 4310 | } |
4311 | 4311 | ||
4312 | /** | ||
4313 | * get_mctgt_type - get target type of moving charge | ||
4314 | * @vma: the vma the pte to be checked belongs | ||
4315 | * @addr: the address corresponding to the pte to be checked | ||
4316 | * @ptent: the pte to be checked | ||
4317 | * @target: the pointer the target page or swap ent will be stored(can be NULL) | ||
4318 | * | ||
4319 | * Returns | ||
4320 | * 0(MC_TARGET_NONE): if the pte is not a target for move charge. | ||
4321 | * 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for | ||
4322 | * move charge. if @target is not NULL, the page is stored in target->page | ||
4323 | * with extra refcnt got(Callers should handle it). | ||
4324 | * 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a | ||
4325 | * target for charge migration. if @target is not NULL, the entry is stored | ||
4326 | * in target->ent. | ||
4327 | * | ||
4328 | * Called with pte lock held. | ||
4329 | */ | ||
4330 | union mc_target { | 4312 | union mc_target { |
4331 | struct page *page; | 4313 | struct page *page; |
4332 | swp_entry_t ent; | 4314 | swp_entry_t ent; |
@@ -4515,6 +4497,25 @@ out: | |||
4515 | return ret; | 4497 | return ret; |
4516 | } | 4498 | } |
4517 | 4499 | ||
4500 | /** | ||
4501 | * get_mctgt_type - get target type of moving charge | ||
4502 | * @vma: the vma the pte to be checked belongs | ||
4503 | * @addr: the address corresponding to the pte to be checked | ||
4504 | * @ptent: the pte to be checked | ||
4505 | * @target: the pointer the target page or swap ent will be stored(can be NULL) | ||
4506 | * | ||
4507 | * Returns | ||
4508 | * 0(MC_TARGET_NONE): if the pte is not a target for move charge. | ||
4509 | * 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for | ||
4510 | * move charge. if @target is not NULL, the page is stored in target->page | ||
4511 | * with extra refcnt got(Callers should handle it). | ||
4512 | * 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a | ||
4513 | * target for charge migration. if @target is not NULL, the entry is stored | ||
4514 | * in target->ent. | ||
4515 | * | ||
4516 | * Called with pte lock held. | ||
4517 | */ | ||
4518 | |||
4518 | static enum mc_target_type get_mctgt_type(struct vm_area_struct *vma, | 4519 | static enum mc_target_type get_mctgt_type(struct vm_area_struct *vma, |
4519 | unsigned long addr, pte_t ptent, union mc_target *target) | 4520 | unsigned long addr, pte_t ptent, union mc_target *target) |
4520 | { | 4521 | { |