Re: memory consumed by kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Arun,

Il 01/10/2010 10.41, Arun KS wrote:
On Fri, Oct 1, 2010 at 5:01 PM, luca ellero<lroluk@xxxxxxxxx>  wrote:
Il 01/10/2010 9.51, Arun KS wrote:

Hello,

kmalloc() memory is reserved or not?

No, kmalloc memory is not reserved. The buddy allocator, which is eventually
used by kmalloc, use only pages NOT reserved and don't mark the pages
"reserved" when these are allocated.

If reserved is not  set, how kernel knows that these pages are swappable or not?
AFAIK kernel memory is non-swappable. So  we have to mark it reserved.
Or there is another mechanism to  attain this?

I don't think swapping code looks at "reserved" bit, swappable pages belong only to user space, so kernel memory (reserved or "kmalloced") are never swapped out.

The problem here is what memory is to be considered "kernel memory" and this is a "philosophic" problem. What can be considered kernel memory? Even page cache (memory not used for any other thing and dedicated to disk caching) can be considered kernel memory. Even user space memory can be considered kernel memory (the kernel eventually allocates memory for user space). So, at this end, ALL memory is kernel memory. At the other end, one can consider kernel memory only text+data+bss segments of bzImage.

I hope I was clear enough and didn't cause more confusion in you.

Best regards
Luca Ellero



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux