Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9af744d7 authored by Michal Hocko's avatar Michal Hocko Committed by Linus Torvalds
Browse files

lib/show_mem.c: teach show_mem to work with the given nodemask

show_mem() allows to filter out node specific data which is irrelevant
to the allocation request via SHOW_MEM_FILTER_NODES.  The filtering is
done in skip_free_areas_node which skips all nodes which are not in the
mems_allowed of the current process.  This works most of the time as
expected because the nodemask shouldn't be outside of the allocating
task but there are some exceptions.  E.g.  memory hotplug might want to
request allocations from outside of the allowed nodes (see
new_node_page).

Get rid of this hardcoded behavior and push the allocation mask down the
show_mem path and use it instead of cpuset_current_mems_allowed.  NULL
nodemask is interpreted as cpuset_current_mems_allowed.

[akpm@linux-foundation.org: coding-style fixes]
Link: http://lkml.kernel.org/r/20170117091543.25850-5-mhocko@kernel.org


Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarMel Gorman <mgorman@suse.de>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6d23f8a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -916,7 +916,7 @@ cmds(struct pt_regs *excp)
				memzcan();
				break;
			case 'i':
				show_mem(0);
				show_mem(0, NULL);
				break;
			default:
				termch = cmd;
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static void prom_sync_me(void)
			     "nop\n\t" : : "r" (&trapbase));

	prom_printf("PROM SYNC COMMAND...\n");
	show_free_areas(0);
	show_free_areas(0, NULL);
	if (!is_idle_task(current)) {
		local_irq_enable();
		sys_sync();
+1 −1
Original line number Diff line number Diff line
@@ -914,7 +914,7 @@ static void ioc3_alloc_rings(struct net_device *dev)

			skb = ioc3_alloc_skb(RX_BUF_ALLOC_SIZE, GFP_ATOMIC);
			if (!skb) {
				show_free_areas(0);
				show_free_areas(0, NULL);
				continue;
			}

+1 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = {

static void sysrq_handle_showmem(int key)
{
	show_mem(0);
	show_mem(0, NULL);
}
static struct sysrq_key_op sysrq_showmem_op = {
	.handler	= sysrq_handle_showmem,
+1 −1
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ static void fn_scroll_back(struct vc_data *vc)

static void fn_show_mem(struct vc_data *vc)
{
	show_mem(0);
	show_mem(0, NULL);
}

static void fn_show_state(struct vc_data *vc)
Loading