Pekka J Enberg wrote:
On Wed, 26 Apr 2006, Kyle Moffett wrote:Here's code that I've found works as well as can be expected under both GCC 3 and GCC 4. If xp is a known-NULL constant the whole function will be optimized out completely. If xp is known-not-NULL, then it will optimize to a kfree function without the null check. Otherwise it optimizes to call the out-of-line version.Wouldn't it be better to simply remove calls to kfree() with known NULL constant?
Yes, but this will optimise away the check for known non-NULL. At the cost of icache footprint. I think unmeasurable micro-optimisations that go against historic CPU trends (eg. size for speed) aren't worth wasting too much sleep over. If it is a 0.0001% speedup today, it'll be a 0.0001% slowdown tomorrow :) -- SUSE Labs, Novell Inc.Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Hua Zhong <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: "Pekka Enberg" <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Pekka J Enberg <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Jörn Engel <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Pekka J Enberg <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Jörn Engel <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Bart Hartgers <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Bart Hartgers <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Kyle Moffett <[email protected]>
- Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- From: Pekka J Enberg <[email protected]>
- [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- Prev by Date: Re: [Lse-tech] Re: [Patch 5/8] taskstats interface
- Next by Date: Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- Previous by thread: Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- Next by thread: Re: [PATCH] likely cleanup: remove unlikely for kfree(NULL)
- Index(es):