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 > > https://software.intel.com/en-us/articles/disclosure-of-hw-prefetche

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 >> 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 checked

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 accessi

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 th

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 it

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 t

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 > > page structure and that

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. > > This patch adds a

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 to