diff mbox series

mm/page_alloc: remove unnecessary parameter in rmqueue_pcplist

Message ID 1555591709-11744-1-git-send-email-laoar.shao@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm/page_alloc: remove unnecessary parameter in rmqueue_pcplist | expand

Commit Message

Yafang Shao April 18, 2019, 12:48 p.m. UTC
Because rmqueue_pcplist() is only called when order is 0,
we don't need to use order as a parameter.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 mm/page_alloc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Michal Hocko April 18, 2019, 1:04 p.m. UTC | #1
On Thu 18-04-19 20:48:29, Yafang Shao wrote:
> Because rmqueue_pcplist() is only called when order is 0,
> we don't need to use order as a parameter.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/page_alloc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index f752025..25518bf 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3096,9 +3096,8 @@ static struct page *__rmqueue_pcplist(struct zone *zone, int migratetype,
>  
>  /* Lock and remove page from the per-cpu list */
>  static struct page *rmqueue_pcplist(struct zone *preferred_zone,
> -			struct zone *zone, unsigned int order,
> -			gfp_t gfp_flags, int migratetype,
> -			unsigned int alloc_flags)
> +			struct zone *zone, gfp_t gfp_flags,
> +			int migratetype, unsigned int alloc_flags)
>  {
>  	struct per_cpu_pages *pcp;
>  	struct list_head *list;
> @@ -3110,7 +3109,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone,
>  	list = &pcp->lists[migratetype];
>  	page = __rmqueue_pcplist(zone,  migratetype, alloc_flags, pcp, list);
>  	if (page) {
> -		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
> +		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1);
>  		zone_statistics(preferred_zone, zone);
>  	}
>  	local_irq_restore(flags);
> @@ -3130,8 +3129,8 @@ struct page *rmqueue(struct zone *preferred_zone,
>  	struct page *page;
>  
>  	if (likely(order == 0)) {
> -		page = rmqueue_pcplist(preferred_zone, zone, order,
> -				gfp_flags, migratetype, alloc_flags);
> +		page = rmqueue_pcplist(preferred_zone, zone, gfp_flags,
> +					migratetype, alloc_flags);
>  		goto out;
>  	}
>  
> -- 
> 1.8.3.1
>
Pankaj Gupta April 18, 2019, 1:08 p.m. UTC | #2
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
>  mm/page_alloc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index f752025..25518bf 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3096,9 +3096,8 @@ static struct page *__rmqueue_pcplist(struct zone
> *zone, int migratetype,
>  
>  /* Lock and remove page from the per-cpu list */
>  static struct page *rmqueue_pcplist(struct zone *preferred_zone,
> -			struct zone *zone, unsigned int order,
> -			gfp_t gfp_flags, int migratetype,
> -			unsigned int alloc_flags)
> +			struct zone *zone, gfp_t gfp_flags,
> +			int migratetype, unsigned int alloc_flags)
>  {
>  	struct per_cpu_pages *pcp;
>  	struct list_head *list;
> @@ -3110,7 +3109,7 @@ static struct page *rmqueue_pcplist(struct zone
> *preferred_zone,
>  	list = &pcp->lists[migratetype];
>  	page = __rmqueue_pcplist(zone,  migratetype, alloc_flags, pcp, list);
>  	if (page) {
> -		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
> +		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1);
>  		zone_statistics(preferred_zone, zone);
>  	}
>  	local_irq_restore(flags);
> @@ -3130,8 +3129,8 @@ struct page *rmqueue(struct zone *preferred_zone,
>  	struct page *page;
>  
>  	if (likely(order == 0)) {
> -		page = rmqueue_pcplist(preferred_zone, zone, order,
> -				gfp_flags, migratetype, alloc_flags);
> +		page = rmqueue_pcplist(preferred_zone, zone, gfp_flags,
> +					migratetype, alloc_flags);
>  		goto out;
>  	}
>  
> --
> 1.8.3.1

Patch looks good to me.

Acked-by: Pankaj Gupta <pagupta@redhat.com>


> 
>
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f752025..25518bf 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3096,9 +3096,8 @@  static struct page *__rmqueue_pcplist(struct zone *zone, int migratetype,
 
 /* Lock and remove page from the per-cpu list */
 static struct page *rmqueue_pcplist(struct zone *preferred_zone,
-			struct zone *zone, unsigned int order,
-			gfp_t gfp_flags, int migratetype,
-			unsigned int alloc_flags)
+			struct zone *zone, gfp_t gfp_flags,
+			int migratetype, unsigned int alloc_flags)
 {
 	struct per_cpu_pages *pcp;
 	struct list_head *list;
@@ -3110,7 +3109,7 @@  static struct page *rmqueue_pcplist(struct zone *preferred_zone,
 	list = &pcp->lists[migratetype];
 	page = __rmqueue_pcplist(zone,  migratetype, alloc_flags, pcp, list);
 	if (page) {
-		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order);
+		__count_zid_vm_events(PGALLOC, page_zonenum(page), 1);
 		zone_statistics(preferred_zone, zone);
 	}
 	local_irq_restore(flags);
@@ -3130,8 +3129,8 @@  struct page *rmqueue(struct zone *preferred_zone,
 	struct page *page;
 
 	if (likely(order == 0)) {
-		page = rmqueue_pcplist(preferred_zone, zone, order,
-				gfp_flags, migratetype, alloc_flags);
+		page = rmqueue_pcplist(preferred_zone, zone, gfp_flags,
+					migratetype, alloc_flags);
 		goto out;
 	}