why do we have kfree_s() at all?

From: Tigran Aivazian (tigran@veritas.com)
Date: Wed May 03 2000 - 12:05:43 EST


Hi,

The common sense tells me that if I supply more information to a function
then it will do its job faster. So, I always thought that things like
kfree_s() existed alongside kfree() because sometimes the size of the
object in question is known in advance and thus we can speed up freeing by
giving the allocator this extra bit of information. However, looking at
SLAB implementation I see that kfree_s() is actually *slower* than
kfree(), i.e. it is exactly the same but it does an extra check of size <=
cachep->c_org_size.

So, why not go through the entire kernel sources and eliminate all uses of
kfree_s(), replacing it with kfree() - making the whole thing a little bit
faster? I see apm and some sound drivers are using kfree_s()..

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:12 EST