public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
@ 2024-11-04 22:52 kernel test robot
  2024-11-05 15:34 ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2024-11-04 22:52 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: oe-kbuild-all, linux-kernel, Jens Axboe, Christoph Hellwig,
	Hannes Reinecke, Martin K. Petersen, Bart Van Assche

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   557329bcecc2f55e134db8974953b32b69db9d15
commit: dd291d77cc90eb6a86e9860ba8e6e38eebd57d12 block: Introduce zone write plugging
date:   7 months ago
config: alpha-randconfig-r064-20241105 (https://download.01.org/0day-ci/archive/20241105/202411050650.ilIZa8S7-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411050650.ilIZa8S7-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.

vim +579 block/blk-zoned.c

   576	
   577	static inline void disk_put_zone_wplug(struct blk_zone_wplug *zwplug)
   578	{
 > 579		if (atomic_dec_and_test(&zwplug->ref)) {
   580			WARN_ON_ONCE(!bio_list_empty(&zwplug->bio_list));
   581			WARN_ON_ONCE(!list_empty(&zwplug->link));
   582	
 > 583			call_rcu(&zwplug->rcu_head, disk_free_zone_wplug_rcu);
   584		}
   585	}
   586	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
  2024-11-04 22:52 block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583 kernel test robot
@ 2024-11-05 15:34 ` Christoph Hellwig
  2024-11-05 15:36   ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2024-11-05 15:34 UTC (permalink / raw)
  To: kernel test robot
  Cc: Damien Le Moal, oe-kbuild-all, linux-kernel, Jens Axboe,
	Christoph Hellwig, Hannes Reinecke, Martin K. Petersen,
	Bart Van Assche

On Tue, Nov 05, 2024 at 06:52:25AM +0800, kernel test robot wrote:
> >> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.

Does anyone know what this warning is supposed to mean?


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

* Re: block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
  2024-11-05 15:34 ` Christoph Hellwig
@ 2024-11-05 15:36   ` Jens Axboe
  2024-11-05 15:37     ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2024-11-05 15:36 UTC (permalink / raw)
  To: Christoph Hellwig, kernel test robot
  Cc: Damien Le Moal, oe-kbuild-all, linux-kernel, Hannes Reinecke,
	Martin K. Petersen, Bart Van Assche

On 11/5/24 8:34 AM, Christoph Hellwig wrote:
> On Tue, Nov 05, 2024 at 06:52:25AM +0800, kernel test robot wrote:
>>>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
> 
> Does anyone know what this warning is supposed to mean?

It's supposed to mean "use refcount_t for things like this".

-- 
Jens Axboe


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

* Re: block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
  2024-11-05 15:36   ` Jens Axboe
@ 2024-11-05 15:37     ` Christoph Hellwig
  2024-11-05 15:56       ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2024-11-05 15:37 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Christoph Hellwig, kernel test robot, Damien Le Moal,
	oe-kbuild-all, linux-kernel, Hannes Reinecke, Martin K. Petersen,
	Bart Van Assche

On Tue, Nov 05, 2024 at 08:36:33AM -0700, Jens Axboe wrote:
> On 11/5/24 8:34 AM, Christoph Hellwig wrote:
> > On Tue, Nov 05, 2024 at 06:52:25AM +0800, kernel test robot wrote:
> >>>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
> > 
> > Does anyone know what this warning is supposed to mean?
> 
> It's supposed to mean "use refcount_t for things like this".

Have we finally resolved the performance problems with refcount_t for
fast path operations?


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

* Re: block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
  2024-11-05 15:37     ` Christoph Hellwig
@ 2024-11-05 15:56       ` Jens Axboe
  2024-11-06 22:53         ` Damien Le Moal
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2024-11-05 15:56 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: kernel test robot, Damien Le Moal, oe-kbuild-all, linux-kernel,
	Hannes Reinecke, Martin K. Petersen, Bart Van Assche

On 11/5/24 8:37 AM, Christoph Hellwig wrote:
> On Tue, Nov 05, 2024 at 08:36:33AM -0700, Jens Axboe wrote:
>> On 11/5/24 8:34 AM, Christoph Hellwig wrote:
>>> On Tue, Nov 05, 2024 at 06:52:25AM +0800, kernel test robot wrote:
>>>>>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
>>>
>>> Does anyone know what this warning is supposed to mean?
>>
>> It's supposed to mean "use refcount_t for things like this".
> 
> Have we finally resolved the performance problems with refcount_t for
> fast path operations?

I mean it's closer, but it's still slower. Will always be so. Does it
matter for zoned devices? Probably not.

I don't think it matters for this case. It's not like the ref itself is
something that is user controllable in terms of being able to get
anywhere near an overflow.

-- 
Jens Axboe

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

* Re: block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
  2024-11-05 15:56       ` Jens Axboe
@ 2024-11-06 22:53         ` Damien Le Moal
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Le Moal @ 2024-11-06 22:53 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig
  Cc: kernel test robot, oe-kbuild-all, linux-kernel, Hannes Reinecke,
	Martin K. Petersen, Bart Van Assche

On 11/6/24 00:56, Jens Axboe wrote:
> On 11/5/24 8:37 AM, Christoph Hellwig wrote:
>> On Tue, Nov 05, 2024 at 08:36:33AM -0700, Jens Axboe wrote:
>>> On 11/5/24 8:34 AM, Christoph Hellwig wrote:
>>>> On Tue, Nov 05, 2024 at 06:52:25AM +0800, kernel test robot wrote:
>>>>>>> block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583.
>>>>
>>>> Does anyone know what this warning is supposed to mean?
>>>
>>> It's supposed to mean "use refcount_t for things like this".
>>
>> Have we finally resolved the performance problems with refcount_t for
>> fast path operations?
> 
> I mean it's closer, but it's still slower. Will always be so. Does it
> matter for zoned devices? Probably not.
> 
> I don't think it matters for this case. It's not like the ref itself is
> something that is user controllable in terms of being able to get
> anywhere near an overflow.

OK. Will work on a patch to switch to refcount.


-- 
Damien Le Moal
Western Digital Research

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

end of thread, other threads:[~2024-11-06 22:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 22:52 block/blk-zoned.c:579:5-24: WARNING: atomic_dec_and_test variation before object free at line 583 kernel test robot
2024-11-05 15:34 ` Christoph Hellwig
2024-11-05 15:36   ` Jens Axboe
2024-11-05 15:37     ` Christoph Hellwig
2024-11-05 15:56       ` Jens Axboe
2024-11-06 22:53         ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox