Commit be9a227
fork: Redo ifdefs around task stack handling
The use of ifdef CONFIG_VMAP_STACK is confusing in terms what is
actually happenning and what can happen.
For instance from reading free_thread_stack() it appears that in the
CONFIG_VMAP_STACK case it may receive a non-NULL vm pointer but it may also
be NULL in which case __free_pages() is used to free the stack. This is
however not the case because in the VMAP case a non-NULL pointer is always
returned here. Since it looks like this might happen, the compiler creates
the correct dead code with the invocation to __free_pages() and everything
around it. Twice.
Add spaces between the ifdef and the identifer to recognize the ifdef
level which is currently in scope.
Add the current identifer as a comment behind #else and #endif.
Move the code within free_thread_stack() and alloc_thread_stack_node()
into the relevant ifdef blocks.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20220217102406.3697941-2-bigeasy@linutronix.de1 parent cfb9244 commit be9a227
1 file changed
Lines changed: 39 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
217 | | - | |
218 | 216 | | |
219 | 217 | | |
220 | 218 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 259 | | |
272 | 260 | | |
273 | | - | |
| 261 | + | |
274 | 262 | | |
275 | | - | |
276 | 263 | | |
| 264 | + | |
277 | 265 | | |
278 | | - | |
279 | | - | |
| 266 | + | |
| 267 | + | |
280 | 268 | | |
281 | | - | |
282 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
283 | 273 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
288 | 282 | | |
289 | | - | |
290 | | - | |
| 283 | + | |
291 | 284 | | |
292 | | - | |
293 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
294 | 293 | | |
295 | | - | |
| 294 | + | |
| 295 | + | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
297 | 299 | | |
| 300 | + | |
298 | 301 | | |
299 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
300 | 306 | | |
301 | 307 | | |
302 | 308 | | |
| |||
312 | 318 | | |
313 | 319 | | |
314 | 320 | | |
| 321 | + | |
315 | 322 | | |
316 | 323 | | |
317 | 324 | | |
| |||
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
324 | | - | |
325 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
326 | 334 | | |
327 | 335 | | |
328 | 336 | | |
| |||
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | 443 | | |
440 | 444 | | |
441 | 445 | | |
| |||
0 commit comments