Commit 07422c9
committed
eventpoll: drop vestigial epi->dying flag
With ep_remove() now pinning @file via epi_fget() across the
f_ep clear and hlist_del_rcu(), the dying flag no longer
orchestrates anything: it was set in eventpoll_release_file()
(which only runs from __fput(), i.e. after @file's refcount has
reached zero) and read in __ep_remove() / ep_remove() as a cheap
bail before attempting the same synchronization epi_fget() now
provides unconditionally.
The implication is simple: epi->dying == true always coincides
with file_ref_get(&file->f_ref) == false, because __fput() is
reachable only once the refcount hits zero and the refcount is
monotone in that state. The READ_ONCE(epi->dying) in ep_remove()
therefore selects exactly the same callers that epi_fget() would
reject, just one atomic cheaper. That's not worth a struct
field, a second coordination mechanism, and the comments on
both.
Refresh the eventpoll_release_file() comment to describe what
actually makes the path race-free now (the pin in ep_remove()).
No functional change: the correctness argument is unchanged,
only the mechanism is now a single one instead of two.
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Christian Brauner (Amutable) <[email protected]>1 parent 3a4551e commit 07422c9
1 file changed
Lines changed: 7 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 151 | | |
159 | 152 | | |
160 | 153 | | |
| |||
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 216 | + | |
227 | 217 | | |
228 | 218 | | |
229 | 219 | | |
| |||
918 | 908 | | |
919 | 909 | | |
920 | 910 | | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | 911 | | |
926 | 912 | | |
927 | | - | |
| 913 | + | |
| 914 | + | |
928 | 915 | | |
929 | 916 | | |
930 | 917 | | |
| |||
1126 | 1113 | | |
1127 | 1114 | | |
1128 | 1115 | | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1132 | 1120 | | |
1133 | 1121 | | |
1134 | 1122 | | |
1135 | 1123 | | |
1136 | 1124 | | |
1137 | | - | |
1138 | 1125 | | |
1139 | 1126 | | |
1140 | 1127 | | |
| |||
0 commit comments