Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-06 Thread Matthew Wilcox
On Tue, Mar 06, 2018 at 08:27:33PM +0800, Aaron Lu wrote: > On Tue, Mar 06, 2018 at 08:55:57AM +0100, Vlastimil Babka wrote: > > So the adjacent line prefetch might be disabled? Could you check bios or > > the MSR mentioned in > >

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-06 Thread Aaron Lu
On Tue, Mar 06, 2018 at 08:55:57AM +0100, Vlastimil Babka wrote: > On 03/05/2018 12:41 PM, Aaron Lu wrote: > > On Fri, Mar 02, 2018 at 06:55:25PM +0100, Vlastimil Babka wrote: > >> On 03/01/2018 03:00 PM, Michal Hocko wrote: > >>> > >>> I am really surprised that this has such a big impact. > >> >

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-05 Thread Vlastimil Babka
On 03/05/2018 12:41 PM, Aaron Lu wrote: > On Fri, Mar 02, 2018 at 06:55:25PM +0100, Vlastimil Babka wrote: >> On 03/01/2018 03:00 PM, Michal Hocko wrote: >>> >>> I am really surprised that this has such a big impact. >> >> It's even stranger to me. Struct page is 64 bytes these days, exactly a >>

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-05 Thread Aaron Lu
On Mon, Mar 05, 2018 at 07:41:59PM +0800, Aaron Lu wrote: > On Fri, Mar 02, 2018 at 06:55:25PM +0100, Vlastimil Babka wrote: > > On 03/01/2018 03:00 PM, Michal Hocko wrote: > > > On Thu 01-03-18 14:28:45, Aaron Lu wrote: > > >> When a page is freed back to the global pool, its buddy will be

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-05 Thread Aaron Lu
On Fri, Mar 02, 2018 at 06:55:25PM +0100, Vlastimil Babka wrote: > On 03/01/2018 03:00 PM, Michal Hocko wrote: > > On Thu 01-03-18 14:28:45, Aaron Lu wrote: > >> When a page is freed back to the global pool, its buddy will be checked > >> to see if it's possible to do a merge. This requires

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-02 Thread Vlastimil Babka
On 03/02/2018 07:00 PM, Dave Hansen wrote: > On 03/02/2018 09:55 AM, Vlastimil Babka wrote: >> It's even stranger to me. Struct page is 64 bytes these days, exactly a >> a cache line. Unless that changed, Intel CPUs prefetched a "buddy" cache >> line (that forms an aligned 128 bytes block with the

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-02 Thread Dave Hansen
On 03/02/2018 09:55 AM, Vlastimil Babka wrote: > It's even stranger to me. Struct page is 64 bytes these days, exactly a > a cache line. Unless that changed, Intel CPUs prefetched a "buddy" cache > line (that forms an aligned 128 bytes block with the one we touch). I believe that was a behavior

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-02 Thread Vlastimil Babka
On 03/01/2018 03:00 PM, Michal Hocko wrote: > On Thu 01-03-18 14:28:45, Aaron Lu wrote: >> When a page is freed back to the global pool, its buddy will be checked >> to see if it's possible to do a merge. This requires accessing buddy's >> page structure and that access could take a long time if

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-02 Thread Aaron Lu
On Thu, Mar 01, 2018 at 03:00:44PM +0100, Michal Hocko wrote: > On Thu 01-03-18 14:28:45, Aaron Lu wrote: > > When a page is freed back to the global pool, its buddy will be checked > > to see if it's possible to do a merge. This requires accessing buddy's > > page structure and that access could

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-02 Thread Aaron Lu
On Thu, Mar 01, 2018 at 04:09:50PM -0800, Andrew Morton wrote: > On Thu, 1 Mar 2018 14:28:45 +0800 Aaron Lu wrote: > > > When a page is freed back to the global pool, its buddy will be checked > > to see if it's possible to do a merge. This requires accessing buddy's > >

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-01 Thread Andrew Morton
On Thu, 1 Mar 2018 14:28:45 +0800 Aaron Lu wrote: > When a page is freed back to the global pool, its buddy will be checked > to see if it's possible to do a merge. This requires accessing buddy's > page structure and that access could take a long time if it's cache cold. >

Re: [PATCH v4 3/3] mm/free_pcppages_bulk: prefetch buddy while not holding lock

2018-03-01 Thread Michal Hocko
On Thu 01-03-18 14:28:45, Aaron Lu wrote: > When a page is freed back to the global pool, its buddy will be checked > to see if it's possible to do a merge. This requires accessing buddy's > page structure and that access could take a long time if it's cache cold. > > This patch adds a prefetch