From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751001AbdAWLSE (ORCPT ); Mon, 23 Jan 2017 06:18:04 -0500 Received: from outbound-smtp04.blacknight.com ([81.17.249.35]:49328 "EHLO outbound-smtp04.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdAWLSE (ORCPT ); Mon, 23 Jan 2017 06:18:04 -0500 Date: Mon, 23 Jan 2017 11:17:59 +0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Linux Kernel , Linux-MM , Hillf Danton , Jesper Dangaard Brouer Subject: Re: [PATCH 4/4] mm, page_alloc: Only use per-cpu allocator for irq-safe requests Message-ID: <20170123111759.fjpox4d22rsknb4a@techsingularity.net> References: <20170117092954.15413-1-mgorman@techsingularity.net> <20170117092954.15413-5-mgorman@techsingularity.net> <675145cb-e026-7ceb-ce96-446d3dd61fe0@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <675145cb-e026-7ceb-ce96-446d3dd61fe0@suse.cz> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 20, 2017 at 04:02:56PM +0100, Vlastimil Babka wrote: > On 01/17/2017 10:29 AM, Mel Gorman wrote: > > [...] > > > @@ -1244,10 +1243,8 @@ static void __free_pages_ok(struct page *page, unsigned int order) > > return; > > > > migratetype = get_pfnblock_migratetype(page, pfn); > > - local_irq_save(flags); > > - __count_vm_events(PGFREE, 1 << order); > > + count_vm_events(PGFREE, 1 << order); > > Maybe this could be avoided by moving the counting into free_one_page()? > Diff suggestion at the end of e-mail. > Yes, that would work. > > @@ -2472,16 +2470,20 @@ void free_hot_cold_page(struct page *page, bool cold) > > { > > struct zone *zone = page_zone(page); > > struct per_cpu_pages *pcp; > > - unsigned long flags; > > unsigned long pfn = page_to_pfn(page); > > int migratetype; > > > > if (!free_pcp_prepare(page)) > > return; > > > > + if (in_interrupt()) { > > + __free_pages_ok(page, 0); > > + return; > > + } > > I think this should go *before* free_pcp_prepare() otherwise > free_pages_prepare() gets done twice in interrupt. > You're right, thanks. -- Mel Gorman SUSE Labs