summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2021-04-29 22:55:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-30 11:20:36 -0700
commit8e9b16c47680f6e7d6e5864a37f313f905a91cf5 (patch)
tree808c4e3b1e920e4a0c570f2eab9deec1ff14bb83 /security
parent608b5d668c8ea6734594a401c9adab4093ad9847 (diff)
downloadlinux-stable-8e9b16c47680f6e7d6e5864a37f313f905a91cf5.tar.gz
linux-stable-8e9b16c47680f6e7d6e5864a37f313f905a91cf5.tar.bz2
linux-stable-8e9b16c47680f6e7d6e5864a37f313f905a91cf5.zip
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/20210402115342.1463781-1-slyfox@gentoo.org Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Juri Lelli <juri.lelli@redhat.com> Cc: Vincent Guittot <vincent.guittot@linaro.org> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Ben Segall <bsegall@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Daniel Bristot de Oliveira <bristot@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions