Skip to contentSkip to conversation

mm: fix some comments in page_alloc.c and mempolicy.c

PATCH In review Hui Su 3 participants 4 messages Sep 25, 2020 – Oct 8, 2020

Subsystems (5)
lore
Share & tools
lore

Hui Su

author
#0 lore raw

PATCH 1/1 mm: fix some comments in page_alloc.c and mempolicy.c

1. the cpuset.c has been moved from kernel/cpuset.c to kernel/cgroup/cpuset.c long time ago, but the comment is stale, so we update it.
2. get_page_from_freelist() may alloc many pages according to order, we may use pages for better.

---
 kernel/cgroup/cpuset.c | 2 +-
 mm/mempolicy.c         | 2 +-
 mm/page_alloc.c        | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
kernel/cgroup/cpuset.c +1 -1
index 642415b8c3c9..1d3011c1aab6 100644
@@ -1,5 +1,5 @@
 /*
- *  kernel/cpuset.c
+ *  kernel/cgroup/cpuset.c
  *
  *  Processor and Memory placement constraints for sets of tasks.
  *
mm/mempolicy.c +1 -1
index eddbe4e56c73..ac59b049b16c 100644
@@ -2295,7 +2295,7 @@ int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
  * rebinds the mempolicy its copying by calling mpol_rebind_policy()
  * with the mems_allowed returned by cpuset_mems_allowed().  This
  * keeps mempolicies cpuset relative after its cpuset moves.  See
- * further kernel/cpuset.c update_nodemask().
+ * further kernel/cgroup/cpuset.c update_nodemask().
  *
  * current's mempolicy may be rebinded by the other task(the task that changes
  * cpuset's mems), so we needn't do rebind work for current task.
mm/page_alloc.c +2 -2
index fab5e97dc9ca..1e3c7493e1cb 100644
@@ -3709,7 +3709,7 @@ static inline unsigned int current_alloc_flags(gfp_t gfp_mask,
 
 /*
  * get_page_from_freelist goes through the zonelist trying to allocate
- * a page.
+ * pages.
  */
 static struct page *
 get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
@@ -3723,7 +3723,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
 retry:
 	/*
 	 * Scan zonelist, looking for a zone with enough free.
-	 * See also __cpuset_node_allowed() comment in kernel/cpuset.c.
+	 * See also __cpuset_node_allowed() comment in kernel/cgroup/cpuset.c.
 	 */
 	no_fallback = alloc_flags & ALLOC_NOFRAGMENT;
 	z = ac->preferred_zoneref;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 42 lines · Hui Su

1. the cpuset.c has been moved from kernel/cpuset.c to kernel/cgroup/cpuset.c long time ago, but the comment is stale, so we update it.
2. get_page_from_freelist() may alloc many pages according to order, we may use pages for better.

---
 kernel/cgroup/cpuset.c | 2 +-
 mm/mempolicy.c         | 2 +-
 mm/page_alloc.c        | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
kernel/cgroup/cpuset.c +1 -1
index 642415b8c3c9..1d3011c1aab6 100644
@@ -1,5 +1,5 @@
 /*
- *  kernel/cpuset.c
+ *  kernel/cgroup/cpuset.c
  *
  *  Processor and Memory placement constraints for sets of tasks.
  *
mm/mempolicy.c +1 -1
index eddbe4e56c73..ac59b049b16c 100644
@@ -2295,7 +2295,7 @@ int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
  * rebinds the mempolicy its copying by calling mpol_rebind_policy()
  * with the mems_allowed returned by cpuset_mems_allowed().  This
  * keeps mempolicies cpuset relative after its cpuset moves.  See
- * further kernel/cpuset.c update_nodemask().
+ * further kernel/cgroup/cpuset.c update_nodemask().
  *
  * current's mempolicy may be rebinded by the other task(the task that changes
  * cpuset's mems), so we needn't do rebind work for current task.
mm/page_alloc.c +0 -0
index fab5e97dc9ca..1e3c7493e1cb 100644

mm/page_alloc.c static inline unsigned int current_alloc_flags(gfp_t gfp_mask, · line 3712

Quoted 5 lines
mm/page_alloc.c +1 -1
@@ -3709,7 +3709,7 @@ static inline unsigned int current_alloc_flags(gfp_t gfp_mask,
 
 /*
  * get_page_from_freelist goes through the zonelist trying to allocate
- * a page.
+ * pages.

"a page" is correct here - it's a single page of the given order (which might be composed out of various order-0 pages, but that's not the point).

Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw
Quoted 4 lines · David Hildenbrand
Quoted 3 lines · Hui Su

1. the cpuset.c has been moved from kernel/cpuset.c to kernel/cgroup/cpuset.c long time ago, but the comment is stale, so we update it.

[]

Quoted 1 line

kernel/cgroup/cpuset.c

Quoted 1 line
kernel/cgroup/cpuset.c +0 -0

[]

Quoted 4 lines

kernel/cgroup/cpuset.c line 2

Quoted 4 lines
kernel/cgroup/cpuset.c +1 -1
@@ -1,5 +1,5 @@
 /*
- *  kernel/cpuset.c
+ *  kernel/cgroup/cpuset.c

It's probably better to remove this altogether instead.

author
#3 lore raw
Quoted 6 lines · Joe Perches
Quoted 4 lines · David Hildenbrand
Quoted 3 lines · Hui Su

1. the cpuset.c has been moved from kernel/cpuset.c to kernel/cgroup/cpuset.c long time ago, but the comment is stale, so we update it.

[]

Quoted 8 lines
Quoted 1 line

kernel/cgroup/cpuset.c

Quoted 1 line
kernel/cgroup/cpuset.c +0 -0

[]

Quoted 4 lines

kernel/cgroup/cpuset.c line 2

Quoted 4 lines
kernel/cgroup/cpuset.c +1 -1
@@ -1,5 +1,5 @@
 /*
- *  kernel/cpuset.c
+ *  kernel/cgroup/cpuset.c

It's probably better to remove this altogether instead.

Please ignore this change, thanks.