> > Ideally, freeing QOM object should not require a global lock. > > If you see any other QOM requiring a global lock, please let us know, we > are willing to fix it. > > All of them. When unplugging a device, the device object will be freed > from an RCU callback. >
Thanks for your reply, Some objects may not need lock at all to be freed, Some objects may just need a small lock to be freed, Should we let RCU callbacks to decide which lock they need instead of enforcing the global lock in RCU thread? As for the device object, can we get the global lock inside the object free/destroy function for now? If we can remove the global lock inside RCU thread, we can save 9MB heap memory, that's a lot! Please share with us if you have other idea to do this. Thanks Anthony