a little improvement for vmalloc
From: Zhonglin Zhang
Date: Wed Jan 05 2005 - 22:22:15 EST
Hello,
In FUNCTION __vmalloc ,
There is a statement;
if (!size || (size >> PAGE_SHIFT) > num_physpages)
return NULL;
I think the condition (num_phypages >>PAGE_SHIFT) > num_physpages
is not very accurate. As we all know, linux kernel and other stuff
occupy some memory,so it is better to express like below, I think.
if (!size || size > max_vmalloc_size)
return NULL;
max_vmalloc_size = (num_physpages >> PAGE_SHIFT) - kernel_size
-reserved_space_for_emergence_use
BTW, I would like to know whether there are reserved physical memory for
emergence use.
Thanks in advance!
Milo
-
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/