Re: [PATCH v8 14/17] zram: permit reclaim in zstd custom allocator

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

 



On 2025-02-22 07:25:45 [+0900], Sergey Senozhatsky wrote:
>  static void *zstd_custom_alloc(void *opaque, size_t size)
>  {
> -	if (!preemptible())
> +	/* Technically this should not happen */
> +	if (WARN_ON_ONCE(!preemptible()))
>  		return kvzalloc(size, GFP_ATOMIC);

This check works only on preemptible kernels.
If you run this on !PREEMPTIBLE kernels, preemptible() reports always 0
so that WARNING will always trigger there.

> -	return kvzalloc(size, __GFP_KSWAPD_RECLAIM | __GFP_NOWARN);
> +	return kvzalloc(size, GFP_NOIO | __GFP_NOWARN);
>  }
>  
>  static void zstd_custom_free(void *opaque, void *address)
> -- 
> 2.48.1.601.g30ceb7b040-goog
> 

Sebastian




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux