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

Commit b2b755b5 authored by David Rientjes's avatar David Rientjes Committed by Linus Torvalds
Browse files

lib, arch: add filter argument to show_mem and fix private implementations



Commit ddd588b5 ("oom: suppress nodes that are not allowed from
meminfo on oom kill") moved lib/show_mem.o out of lib/lib.a, which
resulted in build warnings on all architectures that implement their own
versions of show_mem():

	lib/lib.a(show_mem.o): In function `show_mem':
	show_mem.c:(.text+0x1f4): multiple definition of `show_mem'
	arch/sparc/mm/built-in.o:(.text+0xd70): first defined here

The fix is to remove __show_mem() and add its argument to show_mem() in
all implementations to prevent this breakage.

Architectures that implement their own show_mem() actually don't do
anything with the argument yet, but they could be made to filter nodes
that aren't allowed in the current context in the future just like the
generic implementation.

Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Reported-by: default avatarJames Bottomley <James.Bottomley@hansenpartnership.com>
Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e285c174
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ __tagtable(ATAG_INITRD2, parse_tag_initrd2);
 */
struct meminfo meminfo;

void show_mem(void)
void show_mem(unsigned int filter)
{
	int free = 0, total = 0, reserved = 0;
	int shared = 0, cached = 0, slab = 0, i;
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static unsigned long max_gap;
 * Shows a simple page count of reserved and used pages in the system.
 * For discontig machines, it does this on a per-pgdat basis.
 */
void show_mem(void)
void show_mem(unsigned int filter)
{
	int i, total_reserved = 0;
	int total_shared = 0, total_cached = 0;
+1 −1
Original line number Diff line number Diff line
@@ -614,7 +614,7 @@ void __cpuinit *per_cpu_init(void)
 * Shows a simple page count of reserved and used pages in the system.
 * For discontig machines, it does this on a per-pgdat basis.
 */
void show_mem(void)
void show_mem(unsigned int filter)
{
	int i, total_reserved = 0;
	int total_shared = 0, total_cached = 0;
+1 −1
Original line number Diff line number Diff line
@@ -544,7 +544,7 @@ void __init mem_init(void)
unsigned long *empty_zero_page __read_mostly;
EXPORT_SYMBOL(empty_zero_page);

void show_mem(void)
void show_mem(unsigned int filter)
{
	int i,free = 0,total = 0,reserved = 0;
	int shared = 0, cached = 0;
+1 −1
Original line number Diff line number Diff line
@@ -821,7 +821,7 @@ cmds(struct pt_regs *excp)
				memzcan();
				break;
			case 'i':
				show_mem();
				show_mem(0);
				break;
			default:
				termch = cmd;
Loading