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

2018-03-25 Thread Aaron Lu
On Thu, Mar 22, 2018 at 08:17:19AM -0700, Matthew Wilcox wrote: > On Tue, Mar 13, 2018 at 11:34:53AM +0800, Aaron Lu wrote: > > I wish there is a data structure that has the flexibility of list while > > at the same time we can locate the Nth element in the list without the > > need to iterate. Tha

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

2018-03-22 Thread Matthew Wilcox
On Tue, Mar 13, 2018 at 11:34:53AM +0800, Aaron Lu wrote: > I wish there is a data structure that has the flexibility of list while > at the same time we can locate the Nth element in the list without the > need to iterate. That's what I'm looking for when developing clustered > allocation for orde

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

2018-03-12 Thread Aaron Lu
On Mon, Mar 12, 2018 at 03:22:53PM +0100, Vlastimil Babka wrote: > On 03/01/2018 07:28 AM, Aaron Lu wrote: > > 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 t

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

2018-03-12 Thread Vlastimil Babka
On 03/01/2018 07:28 AM, Aaron Lu wrote: > 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 t

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

2018-03-02 Thread Dave Hansen
On 03/02/2018 01:23 PM, Andrew Morton wrote: >> On my Sandybridge desktop, with will-it-scale/page_fault1/single process >> run to emulate uniprocessor system, the score is(average of 3 runs): >> >> base(patch 1/3): 649710 >> this patch: 653554 +0.6% > Does that mean we got faster or

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

2018-03-02 Thread Andrew Morton
On Fri, 2 Mar 2018 16:01:25 +0800 Aaron Lu wrote: > On Thu, Mar 01, 2018 at 04:01:05PM -0800, Andrew Morton wrote: > > On Thu, 1 Mar 2018 14:28:44 +0800 Aaron Lu wrote: > > > > > When freeing a batch of pages from Per-CPU-Pages(PCP) back to buddy, > > > the zone->lock is held and then pages ar

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

2018-03-02 Thread Dave Hansen
On 03/01/2018 11:15 PM, Aaron Lu wrote: > >> I am still quite surprised that this would have such a large impact. > Most likely due to the cachelines for these page structures are warmed > up outside of zone->lock. The workload here is a pretty tight microbenchmark and single biggest bottleneck i

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

2018-03-02 Thread Aaron Lu
On Thu, Mar 01, 2018 at 04:01:05PM -0800, Andrew Morton wrote: > On Thu, 1 Mar 2018 14:28:44 +0800 Aaron Lu wrote: > > > 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 actua

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

2018-03-01 Thread Huang, Ying
Michal Hocko writes: > On Thu 01-03-18 14:28:44, Aaron Lu wrote: >> 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

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

2018-03-01 Thread Aaron Lu
On Thu, Mar 01, 2018 at 02:55:18PM +0100, Michal Hocko wrote: > On Thu 01-03-18 14:28:44, Aaron Lu wrote: > > 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

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

2018-03-01 Thread Andrew Morton
On Thu, 1 Mar 2018 14:28:44 +0800 Aaron Lu wrote: > 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, t

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

2018-03-01 Thread Michal Hocko
On Thu 01-03-18 14:28:44, Aaron Lu wrote: > 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