Messages in this thread | | | Subject | RFC: Allow kfree to free all types of allocations ? | From | Joe Perches <> | Date | Tue, 09 Jun 2020 15:50:42 -0700 |
| |
There are a lot of patches trying to match various [kv].alloc allocations to specific frees.
But are there frees in a fast path?
Why not convert kfree to add a few extra tests and add #defines for existing uses
Something like:
void kfree(const void *addr) { if (is_kernel_rodata((unsigned long)addr)) return;
if (is_vmalloc_addr(addr)) _vfree(addr); else _kfree(addr); }
And add defines like:
#define kvfree kfree #define vfree kfree #define kfree_const kfree
Does 4 extra tests really matter?
| |