[PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-14 Thread Mel Gorman
There is a lack of clarity of what exactly local_irq_save/local_irq_restore protects in page_alloc.c . It conflates the protection of per-cpu page allocation structures with per-cpu vmstat deltas. This patch protects the PCP structure using local_lock which for most configurations is identical to

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-13 Thread Mel Gorman
On Mon, Apr 12, 2021 at 11:47:00PM +0200, Thomas Gleixner wrote: > On Mon, Apr 12 2021 at 12:56, Mel Gorman wrote: > > On Fri, Apr 09, 2021 at 08:55:39PM +0200, Peter Zijlstra wrote: > > I'll update the changelog and comment accordingly. I'll decide later > > whether to leave it or move the

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-12 Thread Thomas Gleixner
On Mon, Apr 12 2021 at 12:56, Mel Gorman wrote: > On Fri, Apr 09, 2021 at 08:55:39PM +0200, Peter Zijlstra wrote: > I'll update the changelog and comment accordingly. I'll decide later > whether to leave it or move the location of the lock at the end of the > series. If the patch is added, it'll

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-12 Thread Mel Gorman
On Fri, Apr 09, 2021 at 08:55:39PM +0200, Peter Zijlstra wrote: > On Fri, Apr 09, 2021 at 02:32:56PM +0100, Mel Gorman wrote: > > That said, there are some curious users already. > > fs/squashfs/decompressor_multi_percpu.c looks like it always uses the > > local_lock in CPU 0's per-cpu structure

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-09 Thread Peter Zijlstra
On Fri, Apr 09, 2021 at 02:32:56PM +0100, Mel Gorman wrote: > That said, there are some curious users already. > fs/squashfs/decompressor_multi_percpu.c looks like it always uses the > local_lock in CPU 0's per-cpu structure instead of stabilising a per-cpu > pointer. I'm not sure how you read

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-09 Thread Mel Gorman
On Fri, Apr 09, 2021 at 10:24:24AM +0200, Peter Zijlstra wrote: > On Fri, Apr 09, 2021 at 08:59:39AM +0100, Mel Gorman wrote: > > In the end I just gave up and kept it simple as there is no benefit to > > !PREEMPT_RT which just disables IRQs. Maybe it'll be worth considering when > > PREEMPT_RT is

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-09 Thread Peter Zijlstra
On Fri, Apr 09, 2021 at 08:59:39AM +0100, Mel Gorman wrote: > In the end I just gave up and kept it simple as there is no benefit to > !PREEMPT_RT which just disables IRQs. Maybe it'll be worth considering when > PREEMPT_RT is upstream and can be enabled. The series was functionally > tested on

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-09 Thread Mel Gorman
On Fri, Apr 09, 2021 at 08:39:45AM +0200, Peter Zijlstra wrote: > On Thu, Apr 08, 2021 at 06:42:44PM +0100, Mel Gorman wrote: > > On Thu, Apr 08, 2021 at 12:52:07PM +0200, Peter Zijlstra wrote: > > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > > > index a68bacddcae0..e9e60d1a85d4 100644 >

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-09 Thread Peter Zijlstra
On Thu, Apr 08, 2021 at 06:42:44PM +0100, Mel Gorman wrote: > On Thu, Apr 08, 2021 at 12:52:07PM +0200, Peter Zijlstra wrote: > > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > > index a68bacddcae0..e9e60d1a85d4 100644 > > > --- a/mm/page_alloc.c > > > +++ b/mm/page_alloc.c > > > @@ -112,6

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-08 Thread Mel Gorman
On Thu, Apr 08, 2021 at 12:52:07PM +0200, Peter Zijlstra wrote: > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index a68bacddcae0..e9e60d1a85d4 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -112,6 +112,13 @@ typedef int __bitwise fpi_t; > > static

Re: [PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-08 Thread Peter Zijlstra
On Wed, Apr 07, 2021 at 09:24:14PM +0100, Mel Gorman wrote: > There is a lack of clarity of what exactly local_irq_save/local_irq_restore > protects in page_alloc.c . It conflates the protection of per-cpu page > allocation structures with per-cpu vmstat deltas. > > This patch protects the PCP

[PATCH 02/11] mm/page_alloc: Convert per-cpu list protection to local_lock

2021-04-07 Thread Mel Gorman
There is a lack of clarity of what exactly local_irq_save/local_irq_restore protects in page_alloc.c . It conflates the protection of per-cpu page allocation structures with per-cpu vmstat deltas. This patch protects the PCP structure using local_lock which for most configurations is identical to