Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement
Linux 2.0 Obsolete Patches (Xspeedup.patch)

X Speedup Fix

Kevin Buhr (buhr@stat.wisc.edu)
Fri Nov 8 22:35:00 1996

[Home] [Linux 2.0] [Linux 2.1] [Information] [Distributions] [Links]

Xspeedup.patch

This patch has been included in Linux 2.0.25

> Interesting. These only change the size of some fields. It may be a field
> size issue. Note that you dont want to run with that sock.h patch reversed
> as it lets people crash your machine..

Well, Alan, when you're right, you're right. ;)

The problem had nothing to do with the size of the "struct sock" or breaking cache lines or anything of the sort.

Note that:

"unsigned short" - "int"
is a signed operation, while:
"unsigned int" - "int"
is an *unsigned* operation.

We have all sorts of comparisons and other binary operations on "sk->sndbuf" and "sk->wmem_alloc" all over the place, and the latter is of type "atomic_t" (which is "int" for the "i386" architecture).

In 2.0.23, these are signed operations, but in 2.0.24, they become *unsigned*. One result is that "datagram_select" raises many false alarms for sockets with "sk->prot==NULL", telling the process it can write when there's actually no room. This is completely consistent with the kernel profiles we've seen so far.

The most reasonable patch (which follows) seems to be to simply change the "sndbuf" and "rcvbuf" members to (signed) "int"s. Does this break anything else?




[Home] [Up] [Search] [FeedBack]


For information regarding copying and distribution of this material see the COPYING document.
Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.