Re: [PATCH RT] mm: do not warn for suspend when allocate memory on RT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-04-13 12:18:17 [+0800], Liwei Song wrote:
> 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.

Is this the ACPI backtrace or do you have something else?

I'm currently not 100% sure if we can skip the warning.

> Fixes: b5d5bc970f209 ("mm: Warn on memory allocation in non-preemptible context on RT")
> Signed-off-by: Liwei Song <liwei.song@xxxxxxxxxxxxx>
> ---
>  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);

Sebastian



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux