Michael Chan wrote:
This patch adds the basic function pointers to do register accesses in
the fast path. This was suggested by David Miller. The idea is that
various register access methods for different hardware errata can easily
be implemented with these function pointers and performance will not be
degraded on chips that use normal register access methods.


Is this theory, or it has been actually measured?

In x86-based CPUs at least (the largest tg3 platform), branch prediction often prefers

        if (...)
                direct_func_1()
        else
                direct_func_2()

to

        tp->func()

For hot paths, branch prediction will almost always predict the correct path, without any need for deferenced, indirect jumps.

The latter example may look more clean, but the former is probably faster in Real Life(tm).

        Jeff


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to