From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033818AbdAIDPk (ORCPT ); Sun, 8 Jan 2017 22:15:40 -0500 Received: from out0-141.mail.aliyun.com ([140.205.0.141]:54633 "EHLO out0-141.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933873AbdAIDPj (ORCPT ); Sun, 8 Jan 2017 22:15:39 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03297;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---.7Pfc8yr_1483931669; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Mel Gorman'" Cc: "'Jesper Dangaard Brouer'" , "'Linux Kernel'" , "'Linux-MM'" References: <20170104111049.15501-1-mgorman@techsingularity.net> <20170104111049.15501-4-mgorman@techsingularity.net> <00ee01d267cc$b61feaa0$225fbfe0$@alibaba-inc.com> <20170106101530.zq7mpvu4uw2dppal@techsingularity.net> In-Reply-To: <20170106101530.zq7mpvu4uw2dppal@techsingularity.net> Subject: Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests Date: Mon, 09 Jan 2017 11:14:29 +0800 Message-ID: <019901d26a26$7def6c30$79ce4490$@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: AQDSEFujIimX2KX/REGb7JUBMTEPagK0FPKsAXYPawkB42ZmYKL/u/WQ Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Sent: Friday, January 06, 2017 6:16 PM Mel Gorman wrote: > > On Fri, Jan 06, 2017 at 11:26:46AM +0800, Hillf Danton wrote: > > > > On Wednesday, January 04, 2017 7:11 PM Mel Gorman wrote: > > > @@ -2647,9 +2644,8 @@ static struct page *rmqueue_pcplist(struct zone *preferred_zone, > > > struct list_head *list; > > > bool cold = ((gfp_flags & __GFP_COLD) != 0); > > > struct page *page; > > > - unsigned long flags; > > > > > > - local_irq_save(flags); > > > + preempt_disable(); > > > pcp = &this_cpu_ptr(zone->pageset)->pcp; > > > list = &pcp->lists[migratetype]; > > > page = __rmqueue_pcplist(zone, order, gfp_flags, migratetype, > > > @@ -2658,7 +2654,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, gfp_flags); > > > } > > > - local_irq_restore(flags); > > > + preempt_enable(); > > > return page; > > > } > > > > > With PREEMPT configured, preempt_enable() adds entry point to schedule(). > > Is that needed when we try to allocate a page? > > > > Not necessarily but what are you proposing as an alternative? preempt_enable_no_resched() looks at first glance a choice for us to avoid flipping interrupts. > get_cpu() > is not an alternative and the point is to avoid disabling interrupts > which is a much more expensive operation. > Agree with every word. Hillf