Files
Linux/include/linux
Michal Hocko 1f5307b1e0 mm, vmalloc: properly track vmalloc users
__vmalloc_node_flags used to be static inline but this has changed by
"mm: introduce kv[mz]alloc helpers" because kvmalloc_node needs to use
it as well and the code is outside of the vmalloc proper.  I haven't
realized that changing this will lead to a subtle bug though.  The
function is responsible to track the caller as well.  This caller is
then printed by /proc/vmallocinfo.  If __vmalloc_node_flags is not
inline then we would get only direct users of __vmalloc_node_flags as
callers (e.g.  v[mz]alloc) which reduces usefulness of this debugging
feature considerably.  It simply doesn't help to see that the given
range belongs to vmalloc as a caller:

  0xffffc90002c79000-0xffffc90002c7d000   16384 vmalloc+0x16/0x18 pages=3 vmalloc N0=3
  0xffffc90002c81000-0xffffc90002c85000   16384 vmalloc+0x16/0x18 pages=3 vmalloc N1=3
  0xffffc90002c8d000-0xffffc90002c91000   16384 vmalloc+0x16/0x18 pages=3 vmalloc N1=3
  0xffffc90002c95000-0xffffc90002c99000   16384 vmalloc+0x16/0x18 pages=3 vmalloc N1=3

We really want to catch the _caller_ of the vmalloc function.  Fix this
issue by making __vmalloc_node_flags static inline again.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Michal Hocko <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2017-05-08 17:15:12 -07:00
..
…
…
2017-03-07 14:30:38 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-04-28 18:09:59 -04:00
…
…
…
…
…
…
…
…
…
2017-05-01 14:09:21 -07:00
…
…
…
…
…
…
2017-04-11 14:38:43 -04:00
…
…
…
…
…
2017-03-30 09:37:20 +02:00
…
…
…
…
…
…
2017-04-18 20:41:12 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-04-10 17:15:02 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-05-03 15:52:10 -07:00
…
…
…
…
…
…
2017-03-21 10:15:47 +02:00
…
…
…
…
…
2017-04-05 18:11:48 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-03-22 16:16:17 +01:00
…
…
…
…
…
2017-05-08 17:15:12 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-04-04 14:10:12 -07:00
…
…
…
…
…
…
…
2017-05-03 15:52:10 -07:00
…
…
2017-05-08 17:15:12 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-05-08 17:15:12 -07:00
…
…
…
…
…
2017-04-24 14:30:46 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-03-07 14:01:02 -08:00
…
…
…
…
…
2017-04-19 14:21:23 +02:00
…
…
…
2017-03-28 08:54:48 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-05-03 15:52:10 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-05-08 17:15:12 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-03-26 15:09:45 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-03-22 12:15:15 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…