Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [RFC/PATCH 2/5] mm/fs: add execute in place support | Date | Wed, 11 May 2005 19:31:09 +0200 |
| |
On Middeweken 11 Mai 2005 18:19, Carsten Otte wrote: > Badari Pulavarty wrote: > >you may want to look into some how eliminating few > >function pointer de-refs and checks for those who don't care. > >(#ifdef, unlikely(), or some arch & config magic). > > > > > I do agree that addidional pointer derefs would be a nightmare > from the performance perspective. But afaics the patch does not > add such, and for checks I did already add likeleyness for the non-xip > case. Could you be more precise and specify which code path(es) you > mean?
I guess what Badari means is that you could add a function like
#ifdef CONFIG_FS_XIP static inline int mapping_has_xip(struct address_space *mapping) { return __unlikely(mapping->a_ops->get_xip_page != NULL); } #else #define mapping_has_xip(x) (0) #endif
Using this in the hot path should result identical binary code to the current version as long as XIP is not enabled, while otherwise you need to access four data cache lines every time.
I wouldn't expect much benefit from this since all these cache lines should be pretty hot and the branch gets predicted correctly anyway, but it surely doesn't hurt to do the abstraction.
Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |