[<prev] [next>] [day] [month] [year] [list]
Message-ID: <573b3fbd5927c643920e1364230c296b23e7584d.camel@perches.com>
Date: Tue, 09 Jun 2020 15:50:42 -0700
From: Joe Perches <joe@...ches.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: RFC: Allow kfree to free all types of allocations ?
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?
Powered by blists - more mailing lists