On Tue, Feb 21, 2023 at 01:10:44AM +0800, Su Weifeng wrote:The patch is verified to be able to fix the low-probability problem in our scenario. At the same time, we also perform the dup test on the latest kernel(6.2.0-rc8-g0f5e65cd8f9b-dirty) based on your suggestions. The test code model is as follows:
From: Weifeng Su <suweifeng1@xxxxxxxxxx>
The /dev/uioX device has concurrent operations in a few scenarios.
For example, when a process using the device exits abnormally,
the management program starts the same process to operate the device.
When the process exits and closes the /dev/uioX device,
the master bit of the device is cleared. In this case, if the
new process is issuing commands, I/Os are suspended and cannot be
automatically recovered.
Therefore, reference counting is added to clear the master bit
only when the last process exits.
Signed-off-by: Weifeng Su <suweifeng1@xxxxxxxxxx>
---
The difference between the first patch and the first patch is that
the reference counting operation is performed using the atomic semantics,
just like other drivers under UIO:
cdfa835c6e5e87d145f("uio_hv_generic: defer opening vmbus until first use").
And I would claim that that change too is incorrect.
Did you test this with dup()? Lots of open/close cycles on the same
device node? Passing around the file descriptor?
We use the uio_pci_generic driver because we use the DPDK, which is a user-mode development platform on which you can develop the user-mode driver.
Logically, this is identical to your previous change, so why should it
be accepted?
Again, why not just use a real PCI driver for your device?
thanks,
greg k-h