Files
Linux/include/linux
Sergei Trofimovich 8e9b16c476 mm: page_owner: detect page_owner recursion via task_struct
Before the change page_owner recursion was detected via fetching
backtrace and inspecting it for current instruction pointer.
It has a few problems:

 - it is slightly slow as it requires extra backtrace and a linear stack
   scan of the result

 - it is too late to check if backtrace fetching required memory
   allocation itself (ia64's unwinder requires it).

To simplify recursion tracking let's use page_owner recursion flag in
'struct task_struct'.

The change make page_owner=on work on ia64 by avoiding infinite
recursion in:
  kmalloc()
  -> __set_page_owner()
  -> save_stack()
  -> unwind() [ia64-specific]
  -> build_script()
  -> kmalloc()
  -> __set_page_owner() [we short-circuit here]
  -> save_stack()
  -> unwind() [recursion]

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Sergei Trofimovich <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Juri Lelli <[email protected]>
Cc: Vincent Guittot <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ben Segall <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Daniel Bristot de Oliveira <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2021-04-30 11:20:36 -07:00
..
2021-04-22 09:26:22 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-14 16:30:30 +03:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-02-26 09:41:03 -08:00
2021-04-08 16:04:20 -07:00
2021-02-17 14:07:48 +01:00
…
…
…
…
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-22 03:57:39 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-12 15:04:23 +02:00
2021-03-30 22:37:06 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-08 10:24:36 -06:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-08 16:04:20 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-22 04:23:14 +01:00
…
…
…
…
…
…
…
…
…
…
…
2021-02-17 14:12:42 +01:00
…
…
…
2021-02-26 09:41:02 -08:00
…
…
…
…
…
…
2021-02-26 09:41:03 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-13 11:27:30 -08:00
…
…
2021-04-08 16:04:20 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-06 08:34:39 +02:00
…
…
…
…
…
…
…
…
2021-02-17 13:17:49 -08:00
…
…
2021-04-21 10:24:41 -05:00
…
…
…
…
…
…
2021-02-26 09:40:59 -08:00
…
…
…
…
2021-03-10 09:34:06 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-06 12:40:22 +01:00
…
…
…
…
…
2021-02-26 09:41:03 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-22 02:45:52 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-02 17:25:46 -07:00
…
2021-02-20 10:13:32 -05:00
…
…
2021-03-17 15:51:17 +01:00
2021-03-25 17:39:33 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-03-10 09:34:06 +01:00
2021-04-15 10:32:17 +02:00
…
…
…
…
2021-03-30 17:06:49 -07:00
…
2021-04-26 22:55:12 +01:00
…
…
…
2021-04-09 16:00:00 +02:00
…
…
…
…
…
2021-03-22 15:02:14 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2021-04-16 15:31:02 -07:00
2021-03-30 13:42:33 -04:00
…
…
…
…
…
…
…
…
…
…