Re: [RFC] mm: generic adaptive large memory allocation APIs

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

 



Hi

> void *kvmalloc(size_t size)
> {
> 	void *ptr;
> 
> 	if (size < PAGE_SIZE)
> 		return kmalloc(PAGE_SIZE, GFP_KERNEL);
> 	ptr = alloc_pages_exact(size, GFP_KERNEL | __GFP_NOWARN);

low order GFP_KERNEL allocation never fail. then, this doesn't works
as you expected.

> 	if (ptr != NULL)
> 		return ptr;
> 
> 	return vmalloc(size);

On x86, vmalloc area is only 128MB address space. it is very rare 
resource than physical ram. vmalloc fallback is not good idea.


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux