vdev_disk: move abd return and free off the interrupt handler
commite7425ae6248db21240049df859630d5044dcd58a
authorRob Norris <rob.norris@klarasystems.com>
Fri, 25 Oct 2024 06:28:20 +0000 (25 17:28 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 1 Nov 2024 00:00:53 +0000 (31 17:00 -0700)
treecf9270763345aaae93f3ba15b65325ae135bb39f
parent63bafe60ec741c269d29e26b192a8a5c4f6acf92
vdev_disk: move abd return and free off the interrupt handler

Freeing an ABD can take sleeping locks to update various stats. We
aren't allowed to sleep on an interrupt handler. So, move the free off
to the io_done callback.

We should never have been freeing things in the interrupt handler, but
we got away with it because we were usually freeing a linear ABD, which
at most is returning two objects to a cache and never sleeping. Scatter
ABDs can be used now, and those have more complex locking.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16687
module/os/linux/zfs/vdev_disk.c