[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170113101806.a4pm4ltxrgntp6sn@techsingularity.net>
Date: Fri, 13 Jan 2017 10:18:06 +0000
From: Mel Gorman <mgorman@...hsingularity.net>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>,
Hillf Danton <hillf.zj@...baba-inc.com>,
Jesper Dangaard Brouer <brouer@...hat.com>
Subject: Re: [PATCH 3/3] mm, page_allocator: Only use per-cpu allocator for
irq-safe requests
On Thu, Jan 12, 2017 at 06:02:38PM +0100, Vlastimil Babka wrote:
> > Signed-off-by: Mel Gorman <mgorman@...hsingularity.net>
> > Acked-by: Hillf Danton <hillf.zj@...baba-inc.com>
> > Acked-by: Jesper Dangaard Brouer <brouer@...hat.com>
>
> 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
Powered by blists - more mailing lists