Re: get_vmalloc_info() and /proc/meminfo insanely expensive
From: Linus Torvalds
Date: Thu Aug 13 2015 - 01:53:07 EST
On Wed, Aug 12, 2015 at 9:00 PM, Andrew Morton
> Do your /proc/meminfo vmalloc numbers actually change during that build?
> Mine don't. Perhaps we can cache the most recent vmalloc_info and
> invalidate that cache whenever someone does a vmalloc/vfree/etc.
Sure, that works too.
Looking at that mm/vmalloc.c file, the locking is pretty odd. It looks
pretty strange in setup_vmalloc_vm(), for example. If that newly
allocated "va" that we haven't even exposed to anybody yet has its
address or size changed, we're screwed in so many ways.
I get the feeling this file should be rewritten. But that's not going
to happen. The "let's just cache the last value for one jiffy" seemed
to be the minimal fixup to it.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/