Re: [patch] longstanding chksum patch

Artur Skawina (skawina@geocities.com)
Fri, 10 Sep 1999 02:23:41 +0200


Andrea Arcangeli wrote:
>
> On Fri, 10 Sep 1999, Artur Skawina wrote:
>
> >"minor performance improvement" is apparently a relative term -
> >IIRC your patch slows the checksum by 44% for the perfectly legal
> >(even if uncommon) case of 2-byte aligned buffer...
>
> That's not the same result about the test I did. Trusting you I guess the
> benchmark I was using is completly broken (I was using an hacked
> checksum-helper from Dave). Also my numbers are posted on l-k.

iirc, so were mine. anyway, see below.

> So the below _new_ patch has no performances objects at all. I am only
> fixing the buffer overflow with it. Please complain about this patch.

:)
allright, i tried a few quick and dirty benchmarks and got the
same 44% slowdown as last time (iackk with every buffer access offset
by 2).

Bottom line: there's no point in fixing an imaginary bug while
penalizing certain other legal cases. You always have to compromize,
choose between cache footprint vs raw speed, speed vs cpu resources
used (not only cached, but also btbs etc) etc etc.
If you can show a case where the so called bug is triggered _from_
_user_ _space_ (or by net traffic)... [1]

artur

[1] and, even then, it's better to fix the cause, not the symptoms.

[normal times]
153192 32354 32920 150148 674080 : 6a4b csum_partial_cdumb16
27446 7978 9753 22143 197600 : 6a4b csum_partial_std
18074 4699 5658 17120 154687 : 6a4b csum_partial_686
18024 4360 5234 17120 154362 : 6a4b csum_partial_686copy
17700 3916 4906 17054 153415 : 6a4b csum_partial_686as1s
17006 3945 4655 16438 149189 : 6a4b csum_partial_686as1xl
17933 5858 6810 16604 189974 : 6a4b csum_partial_rjas
17837 3946 5035 17164 194418 : 6a4b csum_partial_686aa
17953 4334 5125 17142 194536 : 6a4b csum_partial_686aa2 [<- your new patch]
19685 9531 10418 16905 190872 : 6a4b csum_partial_rj

[times with buffers offset by 2]
154017 31518 31250 150484 671408 : b694 csum_partial_cdumb16
29809 22164 23938 22333 198261 : b694 csum_partial_std
20286 9088 9088 17442 154388 : b694 csum_partial_686
19579 7536 7537 17486 154347 : b694 csum_partial_686copy
20217 8645 8645 17508 153451 : b694 csum_partial_686as1s
19639 9235 9236 16826 148640 : b694 csum_partial_686as1xl
25871 9011 10354 24783 190236 : b694 csum_partial_rjas
25450 5984 6428 25221 193963 : b694 csum_partial_686aa
25762 6095 6428 25198 193995 : b694 csum_partial_686aa2
27484 11083 12745 24916 191396 : b694 csum_partial_rj

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/