Re: Is there a reason we don't have kvfree_rcu()?

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

 



> There was a recent proposal to do just that, but current patches in -rcu
> use kfree_bulk().  It doesn't look to me that this works for kfvree()
> under the covers in its current form.  Could it be upgraded to handle
> this case?

It would take a bit more fiddling, but nothing too difficult.

// from include/linux/mm.h
static inline bool is_vmalloc_addr(const void *x)
{
	unsigned long addr = (unsigned long)x;

	return addr >= VMALLOC_START && addr < VMALLOC_END;
}
// ... which could also be written as (addr - VMALLOC_START) < VMALLOC_TOTAL

// from mm/util.c
void kvfree(const void *addr)
{
	if (is_vmalloc_addr(addr))
		vfree(addr);
	else
		kfree(addr);
}

... so you could easily do the filtering yourself while forming the
kfree_bulk array.

vfree(p) itself is a wrapper around __vunmap(p, 1).  After some 
error-checking, it checks if it's called in interrupt context,
If not, it does the __vunmap synchronously.  If it *is* in interrupt
context, the freed object is put on a linked list and a work queue
does the __vunmap later.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux