Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-14 Thread Oscar Salvador
On Mon, Apr 12, 2021 at 01:08:42PM +0100, Mel Gorman wrote: > zone_pcp_reset allegedly protects against a race with drain_pages > using local_irq_save but this is bogus. local_irq_save only operates > on the local CPU. If memory hotplug is running on CPU A and drain_pages > is running on CPU B,

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-13 Thread Michal Hocko
On Tue 13-04-21 11:36:08, Vlastimil Babka wrote: [...] > AFAIK even Oscar's work on using the node to self-contain its own structures > is > only applicable to struct pages, not percpu allocations? Correct. Teaching pcp storage on movable zone sounds like a large undertaking to me. Not sure this

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-13 Thread Mel Gorman
On Tue, Apr 13, 2021 at 11:36:08AM +0200, Vlastimil Babka wrote: > On 4/12/21 4:08 PM, Mel Gorman wrote: > > On Mon, Apr 12, 2021 at 02:40:18PM +0200, Vlastimil Babka wrote: > >> On 4/12/21 2:08 PM, Mel Gorman wrote: > > > > the pageset structures in place would be much more straight-forward > >

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-13 Thread Vlastimil Babka
On 4/12/21 4:08 PM, Mel Gorman wrote: > On Mon, Apr 12, 2021 at 02:40:18PM +0200, Vlastimil Babka wrote: >> On 4/12/21 2:08 PM, Mel Gorman wrote: > > the pageset structures in place would be much more straight-forward > assuming the structures were not allocated in the zone that is being >

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-13 Thread Michal Hocko
On Mon 12-04-21 14:40:18, Vlastimil Babka wrote: > On 4/12/21 2:08 PM, Mel Gorman wrote: > > zone_pcp_reset allegedly protects against a race with drain_pages > > using local_irq_save but this is bogus. local_irq_save only operates > > on the local CPU. If memory hotplug is running on CPU A and

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-13 Thread Michal Hocko
On Mon 12-04-21 13:08:42, Mel Gorman wrote: > zone_pcp_reset allegedly protects against a race with drain_pages > using local_irq_save but this is bogus. local_irq_save only operates > on the local CPU. If memory hotplug is running on CPU A and drain_pages > is running on CPU B, disabling IRQs on

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread David Hildenbrand
On 12.04.21 17:27, Mel Gorman wrote: On Mon, Apr 12, 2021 at 04:12:11PM +0200, David Hildenbrand wrote: After v1 of the patch, the race was reduced to the point between the zone watermark check and the rmqueue_pcplist but yes, it still existed. Closing it completely was either complex or

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread Mel Gorman
On Mon, Apr 12, 2021 at 04:12:11PM +0200, David Hildenbrand wrote: > > After v1 of the patch, the race was reduced to the point between the > > zone watermark check and the rmqueue_pcplist but yes, it still existed. > > Closing it completely was either complex or expensive. Setting > >

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread David Hildenbrand
On 12.04.21 16:08, Mel Gorman wrote: On Mon, Apr 12, 2021 at 02:40:18PM +0200, Vlastimil Babka wrote: On 4/12/21 2:08 PM, Mel Gorman wrote: zone_pcp_reset allegedly protects against a race with drain_pages using local_irq_save but this is bogus. local_irq_save only operates on the local CPU.

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread Mel Gorman
On Mon, Apr 12, 2021 at 02:40:18PM +0200, Vlastimil Babka wrote: > On 4/12/21 2:08 PM, Mel Gorman wrote: > > zone_pcp_reset allegedly protects against a race with drain_pages > > using local_irq_save but this is bogus. local_irq_save only operates > > on the local CPU. If memory hotplug is running

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread Vlastimil Babka
On 4/12/21 2:08 PM, Mel Gorman wrote: > zone_pcp_reset allegedly protects against a race with drain_pages > using local_irq_save but this is bogus. local_irq_save only operates > on the local CPU. If memory hotplug is running on CPU A and drain_pages > is running on CPU B, disabling IRQs on CPU A

Re: [PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread David Hildenbrand
On 12.04.21 14:08, Mel Gorman wrote: zone_pcp_reset allegedly protects against a race with drain_pages using local_irq_save but this is bogus. local_irq_save only operates on the local CPU. If memory hotplug is running on CPU A and drain_pages is running on CPU B, disabling IRQs on CPU A does

[PATCH v2 resend] mm/memory_hotplug: Make unpopulated zones PCP structures unreachable during hot remove

2021-04-12 Thread Mel Gorman
zone_pcp_reset allegedly protects against a race with drain_pages using local_irq_save but this is bogus. local_irq_save only operates on the local CPU. If memory hotplug is running on CPU A and drain_pages is running on CPU B, disabling IRQs on CPU A does not affect CPU B and offers no