Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
On Tue, Feb 27, 2018 at 10:00:58AM +0800, Aaron Lu wrote: > On Mon, Feb 26, 2018 at 01:53:10PM -0800, David Rientjes wrote: > > On Mon, 26 Feb 2018, Aaron Lu wrote: > > > > > @@ -1144,26 +1142,31 @@ static void free_pcppages_bulk(struct zone *zone, > > > int count, > > >

Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
On Tue, Feb 27, 2018 at 10:00:58AM +0800, Aaron Lu wrote: > On Mon, Feb 26, 2018 at 01:53:10PM -0800, David Rientjes wrote: > > On Mon, 26 Feb 2018, Aaron Lu wrote: > > > > > @@ -1144,26 +1142,31 @@ static void free_pcppages_bulk(struct zone *zone, > > > int count, > > >

Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
On Mon, Feb 26, 2018 at 01:53:10PM -0800, David Rientjes wrote: > On Mon, 26 Feb 2018, Aaron Lu wrote: > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 3154859cccd6..35576da0a6c9 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -1116,13 +1116,11 @@ static void

Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
On Mon, Feb 26, 2018 at 01:53:10PM -0800, David Rientjes wrote: > On Mon, 26 Feb 2018, Aaron Lu wrote: > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 3154859cccd6..35576da0a6c9 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -1116,13 +1116,11 @@ static void

Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread David Rientjes
On Mon, 26 Feb 2018, Aaron Lu wrote: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 3154859cccd6..35576da0a6c9 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1116,13 +1116,11 @@ static void free_pcppages_bulk(struct zone *zone, int > count, > int migratetype = 0; >

Re: [PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread David Rientjes
On Mon, 26 Feb 2018, Aaron Lu wrote: > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 3154859cccd6..35576da0a6c9 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -1116,13 +1116,11 @@ static void free_pcppages_bulk(struct zone *zone, int > count, > int migratetype = 0; >

[PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
When freeing a batch of pages from Per-CPU-Pages(PCP) back to buddy, the zone->lock is held and then pages are chosen from PCP's migratetype list. While there is actually no need to do this 'choose part' under lock since it's PCP pages, the only CPU that can touch them is us and irq is also

[PATCH v3 2/3] mm/free_pcppages_bulk: do not hold lock when picking pages to free

2018-02-26 Thread Aaron Lu
When freeing a batch of pages from Per-CPU-Pages(PCP) back to buddy, the zone->lock is held and then pages are chosen from PCP's migratetype list. While there is actually no need to do this 'choose part' under lock since it's PCP pages, the only CPU that can touch them is us and irq is also