freebsd-dev/sys
Luigi Rizzo 01faf54bb0 For i386 architecture, remove an expensive m_devget() (and the
underlying unaligned bcopy) on incoming packets that are already
available (albeit unaligned) in a buffer.
The performance improvement varies, depending on CPU and memory
speed, but can be quite large especially on slow CPUs. I have seen
over 50% increase on forwarding speed on the sis driver for the
486/133 (embedded systems), which does exactly the same thing.

The behaviour is controlled by a sysctl variable, hw.dc_quick which
defaults to 1. Set it to 0 to restore the old behaviour.

After running a few experiments (in userland, though) I am convinced
that doing the m_devget() is detrimental to performance in almost
all cases.

Even if your CPU has degraded performance with misaligned data,
the bcopy() in the driver has the same overhead due to misaligment
as the one that you save in the uiomove(), plus you do one extra
copy and pollute the cache.

But more often than not, you do not even have to touch the payload,
e.g. when you are forwarding packets, and even in the often-cited
case of NFS, you often end up passing a pointer to the payload to
the disk controller.

In any case, you can play with the sysctl variable to toggle between
the two behaviours, and see if it makes a difference.

MFC-after: 3 days
2001-11-29 22:46:48 +00:00
..
alpha fix DIAGNOSTIC panic caused by proc/thread typo 2001-11-29 15:33:46 +00:00
amd64 MFS: I was confused. This code wasn't in -current after all. 2001-11-26 21:25:03 +00:00
arm Remove funky right justification. 2001-10-23 00:42:15 +00:00
boot Waits for a keypress before rebooting on panic. 2001-11-28 14:00:36 +00:00
cam Bring the probe inquiry code in line with the SCSI spec. 2001-11-27 03:34:22 +00:00
coda Change the vnode list under the mount point from a LIST to a TAILQ 2001-10-23 01:21:29 +00:00
compat Revert incorrect KSEfication: realitexpire expects a struct proc *, not a 2001-11-24 14:09:50 +00:00
conf Change to using my custom sparc64 binutils. 2001-11-28 02:35:02 +00:00
contrib Merge local changes. 2001-11-28 04:34:52 +00:00
crypto fixed the cast128 calculation with a short cipher key length. 2001-11-27 14:11:47 +00:00
ddb Implement a "kill" DDB command which is an interface to psignal() that 2001-11-27 19:56:28 +00:00
dev For i386 architecture, remove an expensive m_devget() (and the 2001-11-29 22:46:48 +00:00
fs Fix indentation after removing GEMDOS support. Whitespace changes only. 2001-11-28 18:29:16 +00:00
geom Return EOPNOTSUPP for unknown module events. 2001-11-17 00:46:08 +00:00
gnu Change constraints to use "+" in inline asm instead of mapping input 2001-11-12 21:58:27 +00:00
i4b fix kvprintf panic in attach routine 2001-10-24 14:12:47 +00:00
i386 Whitespace fixes so thre 386 versoion of __uint8_swap_uint32 is easier to 2001-11-28 17:10:57 +00:00
ia64 Minor tweaks to the TLB handling code - avoid movl instructions and add 2001-11-27 09:49:53 +00:00
isa Some fix for the recent apm module changes. 2001-11-01 16:34:07 +00:00
isofs/cd9660 Fix mounting root from a ISO9660 filesystem on a SCSI CDROM. 2001-11-27 03:55:43 +00:00
kern o Cache req->td->td_proc->p_ucred->cr_prison in pr to improve 2001-11-28 21:22:05 +00:00
libkern rcsid[]->__FBSDID 2001-11-07 19:55:16 +00:00
modules Remove ciss from the modules build until the build issues are resolved. 2001-11-28 17:08:51 +00:00
net Fix a typo in a comment 2001-11-28 16:15:52 +00:00
netatalk Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
netatm Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
netgraph When a socket is not connected, allow the peer "struct sockaddr" 2001-11-28 19:39:58 +00:00
netinet ipfw_modevent(): Don't use an unnatural block to define a variable 2001-11-27 20:32:47 +00:00
netinet6 fixed the cast128 calculation with a short cipher key length. 2001-11-27 14:11:47 +00:00
netipx Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
netkey Fixed the behavior when there is no inbound policy for the ipsec 2001-11-06 22:45:29 +00:00
netnatm Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
netncp Change the kernel's ucred API as follows: 2001-10-11 23:38:17 +00:00
netns Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
netsmb Map errdos:67 to the ENOENT. 2001-08-21 09:16:57 +00:00
nfs Unwind some more macros. NFSMADV() was kinda silly since it was right 2001-09-28 04:37:08 +00:00
nfsclient o Modify nfslockdans() to accept a thread reference instead of a proc 2001-11-14 18:20:45 +00:00
nfsserver Give struct socket structures a ref counting interface similar to 2001-11-17 03:07:11 +00:00
pc98 Split the sio driver for pc98 into bus front end and back end. 2001-11-26 12:29:53 +00:00
pccard Better error message when cardtype is not recognized 2001-11-13 06:46:19 +00:00
pci For i386 architecture, remove an expensive m_devget() (and the 2001-11-29 22:46:48 +00:00
posix4 KSE Milestone 2 2001-09-12 08:38:13 +00:00
powerpc The interrupt nesting level is per-thread not per-CPU on FreeBSD. 2001-11-14 01:00:40 +00:00
rpc
security/lomac Return a POSIX-compliant error for write(2) failure. 2001-11-28 23:02:33 +00:00
sparc64 Add a structure defintion for the id prom contents. 2001-11-18 20:50:11 +00:00
svr4
sys Return a more meaningful errno when the length of the interpreter 2001-11-28 03:26:58 +00:00
tools Move from using PCCARD_ symbols gereated from this file to using PCMCIA_ 2001-11-11 20:15:06 +00:00
ufs When mkdir()-ing, the parent dir gets is linkcount increased. 2001-11-22 15:33:12 +00:00
vm When laying out objects in a ZONE_INTERRUPT zone, allow them to cross 2001-11-17 00:40:48 +00:00
Makefile