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 (25/02/24 10:10), Sebastian Andrzej Siewior wrote:
> 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.

I'm not sure this is true.

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

I thought that preemptible() depends on PREEMPT_COUNT, not on
PREEMPTIBLE, because even on !PREEMPTIBLE preempt-count still
holds hard/soft irq counts, etc.

I ran CONFIG_PREEMPT_NONE=y zram-zstd tests and didn't see any
warnings.




[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