lkml.org 
[lkml]   [2017]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] mm, page_alloc: Only use per-cpu allocator for irq-safe requests
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

\
 
 \ /
  Last update: 2017-01-23 12:18    [W:0.079 / U:3.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site