linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RT] mm: do not warn for suspend when allocate memory on RT
@ 2020-04-13  4:18 Liwei Song
  2020-04-16 17:09 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 7+ messages in thread
From: Liwei Song @ 2020-04-13  4:18 UTC (permalink / raw)
  To: linux-rt; +Cc: liwei.song

Interrupts are off during resume from RAM, this will triger a warning
when allocate memory in non-preemptible context on RT since commit
b5d5bc970f209 ("mm: Warn on memory allocation in non-preemptible
context on RT"), exclude suspend from this warning check.

Fixes: b5d5bc970f209 ("mm: Warn on memory allocation in non-preemptible context on RT")
Signed-off-by: Liwei Song <liwei.song@windriver.com>
---
 mm/slub.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 1929645daa53..ebff24ae50ea 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2771,7 +2771,8 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s,
 	unsigned long tid;
 
 	if (IS_ENABLED(CONFIG_PREEMPT_RT) && IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP))
-		WARN_ON_ONCE(!preemptible() && system_state >= SYSTEM_SCHEDULING);
+		WARN_ON_ONCE(!preemptible() && system_state >= SYSTEM_SCHEDULING &&
+				system_state != SYSTEM_SUSPEND);
 
 	s = slab_pre_alloc_hook(s, gfpflags);
 	if (!s)
@@ -3236,7 +3237,8 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,
 	int i;
 
 	if (IS_ENABLED(CONFIG_PREEMPT_RT) && IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP))
-		WARN_ON_ONCE(!preemptible() && system_state >= SYSTEM_SCHEDULING);
+		WARN_ON_ONCE(!preemptible() && system_state >= SYSTEM_SCHEDULING &&
+				system_state != SYSTEM_SUSPEND);
 
 	/* memcg and kmem_cache debug support */
 	s = slab_pre_alloc_hook(s, flags);
-- 
2.17.1


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

end of thread, other threads:[~2020-05-05  4:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  4:18 [PATCH RT] mm: do not warn for suspend when allocate memory on RT Liwei Song
2020-04-16 17:09 ` Sebastian Andrzej Siewior
2020-04-17  2:50   ` Liwei Song
2020-04-21 14:51     ` Sebastian Andrzej Siewior
2020-04-24  9:09       ` Liwei Song
2020-05-04 14:53         ` [PATCH RT] mm: Don't warn about atomic memory allocations during suspend Sebastian Andrzej Siewior
2020-05-05  3:59           ` Liwei Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).