Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1552662

Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests

From Mel Gorman <mgorman@techsingularity.net>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests
Date 2017-01-06 11:20 +0100
Message-ID <sWzMS-iN-7@gated-at.bofh.it> (permalink)
References <sVRLP-3XT-7@gated-at.bofh.it> <sVRLP-3XT-9@gated-at.bofh.it> <sWto5-420-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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? get_cpu()
is not an alternative and the point is to avoid disabling interrupts
which is a much more expensive operation.

-- 
Mel Gorman
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests Mel Gorman <mgorman@techsingularity.net> - 2017-01-04 12:20 +0100
  Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for  irq-safe requests Jesper Dangaard Brouer <brouer@redhat.com> - 2017-01-04 15:30 +0100
  Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-06 04:30 +0100
    Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for  irq-safe requests Mel Gorman <mgorman@techsingularity.net> - 2017-01-06 11:20 +0100
      Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-09 04:20 +0100
        Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for  irq-safe requests Mel Gorman <mgorman@techsingularity.net> - 2017-01-09 10:50 +0100
          Re: [PATCH 3/4] mm, page_allocator: Only use per-cpu allocator for irq-safe requests "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2017-01-09 11:00 +0100

csiph-web