freebsd-dev/sys/compat/linuxkpi/common/src
Hans Petter Selasky b764a42653 There is a window where threads are removed from the process list and where
the thread destructor is invoked. Catch that window by waiting for all
task_struct allocations to be returned before freeing the UMA zone in the
LinuxKPI. Else UMA may fail to release the zone due to concurrent access
and panic:

panic() - Bad link element prev->next != elm
zone_release()
bucket_drain()
bucket_free()
zone_dtor()
zone_free_item()
uma_zdestroy()
linux_current_uninit()

This failure can be triggered by loading and unloading the LinuxKPI module
in a loop:

while true
do
kldload linuxkpi
kldunload linuxkpi
done

Discussed with:	kib@
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-05-21 13:18:41 +02:00
..
linux_acpi.c LinuxKPI: Implement ACPI bits required by drm-kmod in base system 2020-11-09 13:20:14 +00:00
linux_compat.c Implement cdev_device_add() and cdev_device_del() in the LinuxKPI. 2021-05-11 21:00:23 +02:00
linux_current.c There is a window where threads are removed from the process list and where 2021-05-21 13:18:41 +02:00
linux_devres.c LinuxKPI: implement devres() framework parts and two examples 2021-01-28 16:32:43 +00:00
linux_dmi.c linuxkpi: Add dmi_* function 2020-10-02 18:28:00 +00:00
linux_domain.c Implement basic support for allocating memory from a specific numa node 2021-03-09 21:01:47 +01:00
linux_firmware.c LinuxKPI: treat firmware file names more lenient 2021-04-02 10:03:39 +00:00
linux_fpu.c linuxkpi: add kernel_fpu_begin/kernel_fpu_end 2021-01-12 12:31:00 +01:00
linux_hrtimer.c compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
linux_idr.c compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
linux_kmod.c LinuxKPI: add module dependency on firmware(9) 2021-01-30 17:50:26 +00:00
linux_kthread.c schedlock 1/4 2019-12-15 21:11:15 +00:00
linux_lock.c Populate the acquire context field of a ww_mutex in the LinuxKPI. 2020-10-04 17:23:39 +00:00
linux_page.c Remove some redundant assignments and computations. 2020-06-28 21:34:38 +00:00
linux_pci.c LinuxKPI: enhance PCI bits for DRM 2021-01-28 16:23:19 +00:00
linux_radix.c compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
linux_rcu.c Reduce chance of RCU deadlock in the LinuxKPI by implementing the section 2021-03-29 10:55:14 +02:00
linux_schedule.c Implement the init_wait_entry() function macro in the LinuxKPI. 2018-06-06 14:59:23 +00:00
linux_seq_file.c compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
linux_shmemfs.c linuxkpi: Move shmem related functions in it's own file 2020-02-21 09:28:45 +00:00
linux_shrinker.c linuxkpi: Fix the shrinker scan target 2021-01-18 17:07:55 -05:00
linux_slab.c LinuxKPI: Reimplement irq_work queue on top of fast taskqueue 2021-01-17 12:47:28 +01:00
linux_tasklet.c Make sure all tasklets are drained before unloading the LinuxKPI. 2021-05-21 11:21:32 +02:00
linux_usb.c Improve handling of alternate settings in the USB stack. 2020-12-15 12:05:07 +00:00
linux_work.c Fix race condition in linuxkpi workqueue 2021-02-04 13:54:53 -05:00
linux_xarray.c Implement extensible arrays API using the existing radix tree implementation 2020-08-27 10:28:12 +00:00