On Thu 29-06-23 20:13:05, Baokun Li wrote:I suddenly understand what you mean, you mean that now dqput() doesn't have
On 2023/6/29 19:08, Jan Kara wrote:OK, let me phrase it in a "changelog" way :):
On Wed 28-06-23 21:21:54, Baokun Li wrote:I don't understand this sentence very well, so I would appreciate it
Now when dqput() drops the last reference count, it will callNice simplification! It is also important that dqput() now cannot sleep
synchronize_srcu(&dquot_srcu) in quota_release_workfn() to ensure that
no other user will use the dquot after the last reference count is dropped,
so we don't need to call synchronize_srcu(&dquot_srcu) in drop_dquot_ref()
and remove the corresponding logic directly to simplify the code.
which was another reason for the logic with tofree_head in
remove_inode_dquot_ref().
if you could explain it in detail. 🤔
remove_inode_dquot_ref() currently does not release the last dquot
reference but instead adds the dquot to tofree_head list. This is because
dqput() can sleep while dropping of the last dquot reference (writing back
the dquot and calling ->release_dquot()) and that must not happen under
dq_list_lock. Now that dqput() queues the final dquot cleanup into a
workqueue, remove_inode_dquot_ref() can call dqput() unconditionally
and we can significantly simplify it.
Honza