Re: [PATCH] Add locking to twe(4) so it no longer uses Giant

From: Mike Tancsa <mike_at_sentex.net>
Date: Fri, 10 Aug 2012 12:06:26 -0400
On 8/10/2012 10:05 AM, John Baldwin wrote:
> 
>   5972 tw_cli   CALL
> __sysctl(0x7fffffffd798,0x2,0x7fffffffd7a0,0x7fffffffd790,0x7fffffffd960,0x16)
>   5972 tw_cli   SCTL  "sysctl.name2oid"
>   5972 tw_cli   RET   __sysctl -1 errno 2 No such file or directory
>   5972 tw_cli   CALL  unlink(0x7fffffffd9d0)
>   5972 tw_cli   NAMI  "/dev/twe0"
>   5972 tw_cli   RET   unlink 0
> ...
> 
> Oh!  I moved the sysctl's for twe out of hw and under the device node.
> That seem to have broken tw_cli.  I will revert that and generate an
> updated patch.
> 
> Try http://www.FreeBSD.org/~jhb/patches/twe_locking2.patch
> 

Looks good! Both the tw_cli and 3dm2 web interface work now.

Doing some simple disk tests show everything to be pretty well the same.

new driver
0{offsite2}# dd if=/dev/zero of=/mnt/test bs=1024k count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 14.677410 secs (71441488 bytes/sec)
0{offsite2}# dd if=/mnt/test of=/dev/null bs=1024
1024000+0 records in
1024000+0 records out
1048576000 bytes transferred in 10.325622 secs (101550879 bytes/sec)
0{offsite2}# umount /mnt ; mount /dev/twed0 /mnt
0{offsite2}# dd if=/mnt/test of=/dev/null bs=2048
512000+0 records in
512000+0 records out
1048576000 bytes transferred in 10.347670 secs (101334503 bytes/sec)
0{offsite2}#

old driver

0{offsite2}# dd if=/dev/zero of=/mnt/test bs=1024k count=1000
1000+0 records in
1000+0 records out
1048576000 bytes transferred in 14.695589 secs (71353111 bytes/sec)
0{offsite2}# umount /mnt ; mount /dev/twed0 /mnt
0{offsite2}#  dd if=/mnt/test of=/dev/null bs=2048
512000+0 records in
512000+0 records out
1048576000 bytes transferred in 10.305835 secs (101745856 bytes/sec)
0{offsite2}#

I will do some more stress tests through the day





0{offsite2}# patch -p9 < twe_locking2.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- //depot/vendor/freebsd/src/sys/dev/twe/twe.c       2009-12-25
17:35:14.000000000 0000
|+++ //depot/user/jhb/cleanup/sys/dev/twe/twe.c 2012-08-03
04:00:49.000000000 0000
--------------------------
Patching file twe.c using Plan A...
Hunk #1 succeeded at 151.
Hunk #2 succeeded at 167.
Hunk #3 succeeded at 189.
Hunk #4 succeeded at 208.
Hunk #5 succeeded at 226.
Hunk #6 succeeded at 234.
Hunk #7 succeeded at 271.
Hunk #8 succeeded at 288.
Hunk #9 succeeded at 310.
Hunk #10 succeeded at 337.
Hunk #11 succeeded at 349.
Hunk #12 succeeded at 405.
Hunk #13 succeeded at 521.
Hunk #14 succeeded at 557.
Hunk #15 succeeded at 580.
Hunk #16 succeeded at 595.
Hunk #17 succeeded at 608.
Hunk #18 succeeded at 646.
Hunk #19 succeeded at 769.
Hunk #20 succeeded at 863.
Hunk #21 succeeded at 921.
Hunk #22 succeeded at 952.
Hunk #23 succeeded at 1038.
Hunk #24 succeeded at 1051.
Hunk #25 succeeded at 1082.
Hunk #26 succeeded at 1104.
Hunk #27 succeeded at 1140.
Hunk #28 succeeded at 1151.
Hunk #29 succeeded at 1177.
Hunk #30 succeeded at 1206.
Hunk #31 succeeded at 1309.
Hunk #32 succeeded at 1447.
Hunk #33 succeeded at 1469.
Hunk #34 succeeded at 1499.
Hunk #35 succeeded at 1513.
Hunk #36 succeeded at 1531.
Hunk #37 succeeded at 1554.
Hunk #38 succeeded at 1589.
Hunk #39 succeeded at 1618.
Hunk #40 succeeded at 1644.
Hunk #41 succeeded at 1696.
Hunk #42 succeeded at 1778.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- //depot/vendor/freebsd/src/sys/dev/twe/twe_compat.h
2005-05-29 04:45:51.000000000 0000
|+++ //depot/user/jhb/cleanup/sys/dev/twe/twe_compat.h  2012-08-03
03:58:12.000000000 0000
--------------------------
Patching file twe_compat.h using Plan A...
Hunk #1 succeeded at 43.
Hunk #2 succeeded at 68.
Hunk #3 succeeded at 82.
Hunk #4 succeeded at 92.
Hunk #5 succeeded at 108.
Hunk #6 succeeded at 128.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- //depot/vendor/freebsd/src/sys/dev/twe/twe_freebsd.c
2012-03-12 08:05:24.000000000 0000
|+++ //depot/user/jhb/cleanup/sys/dev/twe/twe_freebsd.c 2012-08-10
14:04:10.000000000 0000
--------------------------
Patching file twe_freebsd.c using Plan A...
Hunk #1 succeeded at 69.
Hunk #2 succeeded at 83.
Hunk #3 succeeded at 101.
Hunk #4 succeeded at 179.
Hunk #5 succeeded at 189.
Hunk #6 succeeded at 218.
Hunk #7 succeeded at 248.
Hunk #8 succeeded at 299.
Hunk #9 succeeded at 421.
Hunk #10 succeeded at 432.
Hunk #11 succeeded at 468.
Hunk #12 succeeded at 503.
Hunk #13 succeeded at 525.
Hunk #14 succeeded at 540.
Hunk #15 succeeded at 573.
Hunk #16 succeeded at 592.
Hunk #17 succeeded at 611.
Hunk #18 succeeded at 687.
Hunk #19 succeeded at 736.
Hunk #20 succeeded at 841.
Hunk #21 succeeded at 864.
Hunk #22 succeeded at 883.
Hunk #23 succeeded at 1045.
Hunk #24 succeeded at 1104.
Hunk #25 succeeded at 1158.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- //depot/vendor/freebsd/src/sys/dev/twe/twevar.h    2009-12-25
17:35:14.000000000 0000
|+++ //depot/user/jhb/cleanup/sys/dev/twe/twevar.h      2012-08-03
04:00:49.000000000 0000
--------------------------
Patching file twevar.h using Plan A...
Hunk #1 succeeded at 134.
Hunk #2 succeeded at 210.
Hunk #3 succeeded at 255.
done
0{offsite2}#


Looks good!

//offsite2> show

Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
------------------------------------------------------------------------
c0    8006-2LP     2         2        1       0       3       -      -

c1    9650SE-2LP   2         2        1       0       1       1      -


//offsite2> /c0 show

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache
AVrfy
------------------------------------------------------------------------------
u0    RAID-0    OK             -       -       64K     931.521   ON
-

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCAYUEY18298

p1     OK               u0     465.76 GB   976773168     WD-WMAYUL256317


//offsite2> /c1 show

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache
AVrfy
------------------------------------------------------------------------------
u0    RAID-1    OK             -       -       -       465.651   RiW
ON

VPort Status         Unit Size      Type  Phy Encl-Slot    Model
------------------------------------------------------------------------------
p0    OK             u0   465.76 GB SATA  0   -            WDC
WD5002AALX-00J3
p1    OK             u0   465.76 GB SATA  1   -            WDC
WD5002AALX-00J3

//offsite2>



-- 
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, mike_at_sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/
Received on Fri Aug 10 2012 - 14:06:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:29 UTC