All of lore.kernel.org
 help / color / mirror / Atom feed
* v5.10 and less needs a fix up for __build_all_zonelists()
@ 2023-11-03 11:35 Sebastian Andrzej Siewior
  2023-11-03 12:47 ` Luis Claudio R. Goncalves
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2023-11-03 11:35 UTC (permalink / raw)
  To: stable-rt; +Cc: Luis Claudio R. Goncalves

Hi!

upstream landed commit
	a2ebb51575828 ("mm/page_alloc: use write_seqlock_irqsave() instead write_seqlock() + local_irq_save().")

a while ago after Luis pointed me at the actual issue. The v6.1-RT and
v5.15-RT received the proper backport via -stable and are good.
v5.10-RT has the commit
    7bdd3bd5143a4 ("Revert "mm/page_alloc: fix potential deadlock on zonelist_update_seqseqlock"")

which I may have suggested at the time but requires now something
proper. In reality it may not matter because nobody is using
memory-hotplug but is should be fixed properly. Also it (as in v5.10)
affects non-RT users. In less than v5.10 it affects possible RT users.

The fix for 5.10-RT is just the snippet which is the resolution if the
initial commit would be backported to the v5.10 which did not happen.
Everything less than v5.10 should apply commit a2ebb51575828 mentioned
earlier.

Sebastian

-----8<---

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3760a06932a6e..f6b3a46ac87d5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6043,8 +6043,9 @@ static void __build_all_zonelists(void *data)
 	int nid;
 	int __maybe_unused cpu;
 	pg_data_t *self = data;
+	unsigned long flags;
 
-	write_seqlock(&zonelist_update_seq);
+	write_seqlock_irqsave(&zonelist_update_seq, flags);
 
 #ifdef CONFIG_NUMA
 	memset(node_load, 0, sizeof(node_load));
@@ -6077,7 +6078,7 @@ static void __build_all_zonelists(void *data)
 #endif
 	}
 
-	write_sequnlock(&zonelist_update_seq);
+	write_sequnlock_irqrestore(&zonelist_update_seq, flags);
 }
 
 static noinline void __init

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: v5.10 and less needs a fix up for __build_all_zonelists()
  2023-11-03 11:35 v5.10 and less needs a fix up for __build_all_zonelists() Sebastian Andrzej Siewior
@ 2023-11-03 12:47 ` Luis Claudio R. Goncalves
  0 siblings, 0 replies; 2+ messages in thread
From: Luis Claudio R. Goncalves @ 2023-11-03 12:47 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: stable-rt

On Fri, Nov 03, 2023 at 12:35:29PM +0100, Sebastian Andrzej Siewior wrote:
> Hi!
> 
> upstream landed commit
> 	a2ebb51575828 ("mm/page_alloc: use write_seqlock_irqsave() instead write_seqlock() + local_irq_save().")
> 
> a while ago after Luis pointed me at the actual issue. The v6.1-RT and
> v5.15-RT received the proper backport via -stable and are good.
> v5.10-RT has the commit
>     7bdd3bd5143a4 ("Revert "mm/page_alloc: fix potential deadlock on zonelist_update_seqseqlock"")
> 
> which I may have suggested at the time but requires now something
> proper. In reality it may not matter because nobody is using
> memory-hotplug but is should be fixed properly. Also it (as in v5.10)
> affects non-RT users. In less than v5.10 it affects possible RT users.
> 
> The fix for 5.10-RT is just the snippet which is the resolution if the
> initial commit would be backported to the v5.10 which did not happen.
> Everything less than v5.10 should apply commit a2ebb51575828 mentioned
> earlier.

Thank you for the heads-up, Sebastian!

I will finish the work on v5.10.199-rt97-rc1 and then release an RT-only
update with the fix below.

Luis

> Sebastian
> 
> -----8<---
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3760a06932a6e..f6b3a46ac87d5 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6043,8 +6043,9 @@ static void __build_all_zonelists(void *data)
>  	int nid;
>  	int __maybe_unused cpu;
>  	pg_data_t *self = data;
> +	unsigned long flags;
>  
> -	write_seqlock(&zonelist_update_seq);
> +	write_seqlock_irqsave(&zonelist_update_seq, flags);
>  
>  #ifdef CONFIG_NUMA
>  	memset(node_load, 0, sizeof(node_load));
> @@ -6077,7 +6078,7 @@ static void __build_all_zonelists(void *data)
>  #endif
>  	}
>  
> -	write_sequnlock(&zonelist_update_seq);
> +	write_sequnlock_irqrestore(&zonelist_update_seq, flags);
>  }
>  
>  static noinline void __init
> 
---end quoted text---


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-03 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-03 11:35 v5.10 and less needs a fix up for __build_all_zonelists() Sebastian Andrzej Siewior
2023-11-03 12:47 ` Luis Claudio R. Goncalves

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.