About Internal Fragmentation

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

 



I have a question about internal fragmentation after allocating pagesmany times.As my understanding, Linux is using buddy system to avoid externalfragmentation.
Hereunder is my problem:
At kernel init, pages are grouped into 10 lists of blocks thatcontains groups of 1, 2, 4, … 512 contiguous page frames,respectively.
Therefore, the lists has 4K, 8K,…, 4096K (page file size is 4K).
Here is the lists after system initialize: (after calls mem_init() ):
     1*4kB   2*8kB    0*16kB    1*32kB   2*64kB    1*128kB    0*256kB  1*512kB    1*1024kB    2*2048kB    0*4096kB    =  5940kB
After driver init and some application init, the lists become:
    43*4kB  21*8kB    16*16kB    2*32kB   0*64kB    0*128kB    0*256kB   0*512kB    0*1024kB    0*2048kB    0*4096kB    =  660kB
At this point, some program _kmalloc_ 64kB and it fails because systemdoes not have 64kB contiguous memory.
As we can see, the available physical memory (669kB) is more than adequate.
However, the memory is fragmented internally.
(As I read from the book, Linux uses slab allocator to avoid internalfragmentation. If so, why does it still happen.)
Is there any garbage collection or memory compaction under this situation?OrIs there any solution to avoid this problem?
Many Thanks.ÿòž®w¥?ì‰ëÿéiy§!¢Ø^®Wš®v›¢ëm…ââžìdz¹Þ—ð+r¯{øm¶Ÿÿþf¢—ùåþX§»è®äz¹Þ–w°n'¬üPþm§ÿÿ‘êçzYÞÁ¸ž³ú+ƒ÷Ú


[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