Date: Sun, 7 Jun 2009 23:47:06 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r193669 - user/kmacy/releng_7_2_fcs/sys/net Message-ID: <200906072347.n57Nl6kB009534@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Sun Jun 7 23:47:06 2009 New Revision: 193669 URL: http://svn.freebsd.org/changeset/base/193669 Log: pre-fetch collision entries Modified: user/kmacy/releng_7_2_fcs/sys/net/flowtable.c Modified: user/kmacy/releng_7_2_fcs/sys/net/flowtable.c ============================================================================== --- user/kmacy/releng_7_2_fcs/sys/net/flowtable.c Sun Jun 7 23:46:29 2009 (r193668) +++ user/kmacy/releng_7_2_fcs/sys/net/flowtable.c Sun Jun 7 23:47:06 2009 (r193669) @@ -177,6 +177,20 @@ static struct cv flowclean_cv; static struct mtx flowclean_lock; static uint64_t flowclean_cycles; +#if defined(__i386__) || defined(__amd64__) +static __inline +void prefetch(void *x) +{ + __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); +} +#else +static __inline +void prefetch(void *x) +{ + ; +} +#endif + /* * TODO: * - Make flowtable stats per-cpu, aggregated at sysctl call time, @@ -613,7 +627,10 @@ flowtable_lookup(struct flowtable *ft, s FL_ENTRY_UNLOCK(ft, hash); goto uncached; } -keycheck: +keycheck: + if (fle->f_next != NULL) + prefetch(fle->f_next); + rt = __DEVOLATILE(struct rtentry *, fle->f_rt); lle = __DEVOLATILE(struct llentry *, fle->f_lle); if ((rt != NULL)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906072347.n57Nl6kB009534>