]> www.infradead.org Git - users/willy/linux.git/commit
lib/show_mem.c: drop pgdat_resize_lock in show_mem()
authorWei Yang <richard.weiyang@gmail.com>
Wed, 5 Dec 2018 00:13:57 +0000 (11:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2018 00:13:57 +0000 (11:13 +1100)
commit9c7d1a2b17b0ca4e84c201f3035d0df2d2017060
tree04306e7b07e1d0d6c3afdc3d4a76aa8592bcd131
parent16c666f2b0b64d77ae8ed93643ed9a8bef4378ac
lib/show_mem.c: drop pgdat_resize_lock in show_mem()

Function show_mem() is used to print system memory status when user
requires or fail to allocate memory.  Generally, this is a best effort
information so any races with memory hotplug (or very theoretically an
early initialization) should be tolerable and the worst that could happen
is to print an imprecise node state.

Drop the resize lock because this is the only place which might hold the
lock from the interrupt context and so all other callers might use a
simple spinlock.  Even though this doesn't solve any real issue it makes
the code easier to follow and tiny more effective.

Link: http://lkml.kernel.org/r/20181129235532.9328-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
lib/show_mem.c