linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: zhongjiang <zhongjiang@huawei.com>,
	mgorman@techsingularity.net, akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm, page_alloc: fix the duplicate save/ressave irq
Date: Mon, 13 Mar 2017 09:31:58 +0100	[thread overview]
Message-ID: <7fe42f09-27cc-db21-58d5-affa4aff2849@suse.cz> (raw)
In-Reply-To: <1489392174-11794-1-git-send-email-zhongjiang@huawei.com>

On 03/13/2017 09:02 AM, zhongjiang wrote:
> From: zhong jiang <zhongjiang@huawei.com>
> 
> when commit 374ad05ab64d ("mm, page_alloc: only use per-cpu allocator for irq-safe requests")
> introduced to the mainline, free_pcppages_bulk irq_save/resave to protect
> the IRQ context. but drain_pages_zone fails to clear away the irq. because
> preempt_disable have take effect. so it safely remove the code.
> 
> Fixes: 374ad05ab64d ("mm, page_alloc: only use per-cpu allocator for irq-safe requests")
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  mm/page_alloc.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 05c3956..7b16095 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2294,11 +2294,9 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp)
>   */
>  static void drain_pages_zone(unsigned int cpu, struct zone *zone)
>  {
> -	unsigned long flags;
>  	struct per_cpu_pageset *pset;
>  	struct per_cpu_pages *pcp;
>  
> -	local_irq_save(flags);
>  	pset = per_cpu_ptr(zone->pageset, cpu);

NAK. we have to make sure that pset corresponds to the cpu we are
running on.

>  
>  	pcp = &pset->pcp;
> @@ -2306,7 +2304,6 @@ static void drain_pages_zone(unsigned int cpu, struct zone *zone)
>  		free_pcppages_bulk(zone, pcp->count, pcp);
>  		pcp->count = 0;
>  	}
> -	local_irq_restore(flags);
>  }
>  
>  /*
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-03-13  8:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13  8:02 [PATCH] mm, page_alloc: fix the duplicate save/ressave irq zhongjiang
2017-03-13  8:31 ` Vlastimil Babka [this message]
2017-03-13 10:08   ` Vlastimil Babka
2017-03-13 10:53     ` zhong jiang
2017-03-13 11:19 ` Mel Gorman
2017-03-13 13:59   ` zhong jiang
2017-03-13 14:26     ` Mel Gorman
2017-03-13 14:51       ` zhong jiang
2017-03-14 12:06       ` zhong jiang
2017-03-14 13:51         ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7fe42f09-27cc-db21-58d5-affa4aff2849@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).