Some cache related optimizations
ClosedPublic

Authored by shurd on Sep 21 2017, 10:20 PM.

Details

Summary
  1. prefetch 128 bytes of mbufs.
  2. Re-order filling the pkt_info so cache stalls happen at the end
  3. Define empty prefetch2() macro when the function isn't present.

Provides small performance improvments on some hardware

Test Plan

Test on a wider range of hardware for regressions

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
shurd created this revision.Sep 21 2017, 10:20 PM

Is there a reason that we don't modify prefetch() instead of creating a new prefetch2() function?

Is there a reason that we don't modify prefetch() instead of creating a new prefetch2() function?

The majority of places prefetch() is used don't need the extra cacheline prefetched.

sbruno requested changes to this revision.Sep 27 2017, 6:47 PM

Ok, lets rename prefetch2() to something that indicates why there is a second function (being a bit pedantic here). something like prefetch_align() or whatever.

This revision now requires changes to proceed.Sep 27 2017, 6:47 PM
shurd added a comment.Oct 5 2017, 1:49 PM

Ok, lets rename prefetch2() to something that indicates why there is a second function (being a bit pedantic here). something like prefetch_align() or whatever.

Do you like prefetch2cachelines() better?

Ok, lets rename prefetch2() to something that indicates why there is a second function (being a bit pedantic here). something like prefetch_align() or whatever.

Do you like prefetch2cachelines() better?

I think that's fine. It at least explains what's up with this function.

shurd updated this revision to Diff 34259.Oct 23 2017, 5:55 PM

Rename prefecth2() to prefetch2cachelines()

sbruno accepted this revision.Oct 23 2017, 7:00 PM
This revision is now accepted and ready to land.Oct 23 2017, 7:00 PM
Closed by commit rS324937: Some cache related optimizations (authored by shurd, committed by ). · Explain WhyOct 23 2017, 8:50 PM
This revision was automatically updated to reflect the committed changes.