From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbdAMKSL (ORCPT ); Fri, 13 Jan 2017 05:18:11 -0500 Received: from outbound-smtp03.blacknight.com ([81.17.249.16]:39887 "EHLO outbound-smtp03.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdAMKSI (ORCPT ); Fri, 13 Jan 2017 05:18:08 -0500 Date: Fri, 13 Jan 2017 10:18:06 +0000 From: Mel Gorman To: Vlastimil Babka Cc: Andrew Morton , Linux Kernel , Linux-MM , Hillf Danton , Jesper Dangaard Brouer Subject: Re: [PATCH 3/3] mm, page_allocator: Only use per-cpu allocator for irq-safe requests Message-ID: <20170113101806.a4pm4ltxrgntp6sn@techsingularity.net> References: <20170112104300.24345-1-mgorman@techsingularity.net> <20170112104300.24345-4-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: 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 Thu, Jan 12, 2017 at 06:02:38PM +0100, Vlastimil Babka wrote: > > Signed-off-by: Mel Gorman > > Acked-by: Hillf Danton > > Acked-by: Jesper Dangaard Brouer > > Very promising! But I have some worries. Should we put something like > VM_BUG_ON(in_interrupt()) into free_hot_cold_page() and rmqueue_pcplist() to > catch future potential misuses and also document this requirement? Also > free_hot_cold_page() has other call sites besides __free_pages() and I'm not > sure if those are all guaranteed to be !IRQ? E.g. free_hot_cold_page_list() > which is called by release_page() which uses irq-safe lock operations... > They are not guaranteed to be !irq but the API is easier to call incorrectly than it could be. I think the checks can be pushed further down without excessive overhead. > Smaller nit below: > > > @@ -2453,8 +2450,8 @@ void free_hot_cold_page(struct page *page, bool cold) > > > > migratetype = get_pfnblock_migratetype(page, pfn); > > set_pcppage_migratetype(page, migratetype); > > - local_irq_save(flags); > > - __count_vm_event(PGFREE); > > + preempt_disable(); > > + count_vm_event(PGFREE); > > AFAICS preempt_disable() is enough for using __count_vm_event(), no? > It is, I'll fix it. Thanks. -- Mel Gorman SUSE Labs