Skip to content

Commit a914bd9

Browse files
mjguzikbrauner
authored andcommitted
fs: use fput_close() in filp_close()
When tracing a kernel build over refcounts seen this is a wash: @[kprobe:filp_close]: [0] 32195 |@@@@@@@@@@ | [1] 164567 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| I verified vast majority of the skew comes from do_close_on_exec() which could be changed to use a different variant instead. Even without changing that, the 19.5% of calls which got here still can save the extra atomic. Calls here are borderline non-existent compared to fput (over 3.2 mln!), so they should not negatively affect scalability. Signed-off-by: Mateusz Guzik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 3e46a92 commit a914bd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ int filp_close(struct file *filp, fl_owner_t id)
15501550
int retval;
15511551

15521552
retval = filp_flush(filp, id);
1553-
fput(filp);
1553+
fput_close(filp);
15541554

15551555
return retval;
15561556
}

0 commit comments

Comments
 (0)