Commit 6feb992
Optimize close_random_fds
Summary:
A high `fs.nr_open` (ex. 1073741816) can cause watchman to spend 1+ minute
during startup closing fds.
Let's try to use `close_range` instead. If `close_range` is not
available, limit the `max_fd` to a "reasonable" configurable
number (2500000) so watchman won't take too long to start.
Reviewed By: muirdm
Differential Revision: D74923577
fbshipit-source-id: 903e7e389572a2ea5ae93b199dea83b75d6fb9d71 parent ecb6fcf commit 6feb992
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| |||
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
263 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
264 | 272 | | |
265 | 273 | | |
266 | 274 | | |
267 | | - | |
| 275 | + | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
0 commit comments