From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbdBIGbj (ORCPT ); Thu, 9 Feb 2017 01:31:39 -0500 Received: from out0-134.mail.aliyun.com ([140.205.0.134]:41385 "EHLO out0-134.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbdBIGb1 (ORCPT ); Thu, 9 Feb 2017 01:31:27 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R501e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01l10435;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---.7aDg.E9_1486621373; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Mel Gorman'" , "'Andrew Morton'" Cc: "'Thomas Gleixner'" , "'Peter Zijlstra'" , "'Michal Hocko'" , "'Vlastimil Babka'" , , , "'Ingo Molnar'" References: <20170208152200.ydlvia2c7lm7ln3t@techsingularity.net> In-Reply-To: <20170208152200.ydlvia2c7lm7ln3t@techsingularity.net> Subject: Re: [PATCH] mm, page_alloc: only use per-cpu allocator for irq-safe requests -fix v2 Date: Thu, 09 Feb 2017 14:22:52 +0800 Message-ID: <00d201d2829c$f233b630$d69b2290$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQDfnL37Mc4JgzinkJx+6FgEU5PZGKNF/4Og Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On February 08, 2017 11:22 PM Mel Gorman wrote: > > preempt_enable_no_resched() was used based on review feedback that had > no strong objection at the time. The thinking was that it avoided adding > a preemption point where one didn't exist before so the feedback was > applied. This reasoning was wrong. > > There was an indirect preemption point as explained by Thomas Gleixner where > an interrupt could set_need_resched() followed by preempt_enable being > a preemption point that matters. This use of preempt_enable_no_resched > is bad from both a mainline and RT perspective and a violation of the > preemption mechanism. Peter Zijlstra noted that "the only acceptable use > of preempt_enable_no_resched() is if the next statement is a schedule() > variant". > > The usage was outright broken and I should have stuck to preempt_enable() > as it was originally developed. It's known from previous tests > that there was no detectable difference to the performance by using > preempt_enable_no_resched(). > > This is a fix to the mmotm patch > mm-page_alloc-only-use-per-cpu-allocator-for-irq-safe-requests.patch > > Signed-off-by: Mel Gorman > --- Thanks for fixing it. Acked-by: Hillf Danton > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index eaecb4b145e6..2a36dad03dac 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2520,7 +2520,7 @@ void free_hot_cold_page(struct page *page, bool cold) > } > > out: > - preempt_enable_no_resched(); > + preempt_enable(); > } > > /* > @@ -2686,7 +2686,7 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, > __count_zid_vm_events(PGALLOC, page_zonenum(page), 1 << order); > zone_statistics(preferred_zone, zone); > } > - preempt_enable_no_resched(); > + preempt_enable(); > return page; > } >