Date: Thu, 29 Oct 2009 23:05:08 +0300 (MSK) From: Artemiev Igor <ai@kliksys.ru> To: FreeBSD-gnats-submit@FreeBSD.org Cc: gibbs@FreeBSD.org, ken@FreeBSD.org Subject: kern/140091: [PATCH] allow for da(4) large block transfer than DFLTPHYS Message-ID: <200910292005.n9TK58rJ013670@one.kliksys.ru> Resent-Message-ID: <200910292050.n9TKo2Is093772@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 140091 >Category: kern >Synopsis: [PATCH] allow for da(4) large block transfer than DFLTPHYS >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 29 20:50:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Artemiev Igor >Release: FreeBSD 7.2-STABLE i386 >Organization: KlikSys >Environment: System: FreeBSD one.kliksys.ru 7.2-STABLE FreeBSD 7.2-STABLE #7: Sun May 17 14:54:10 MSD 2009 root@one.kliksys.ru:/usr/obj/usr/src.7/sys/KERNEL i386 >Description: By default, one transfer of data block limiting to DFLTPHYS for da(4), but modern controllers allow operate up to 128K per one DMA transaction, i.e. 3ware devices. This patch via loader.conf tunable allow scale d_maxsize by multiple DFLTPHYS. >How-To-Repeat: On my typical load (~4K active connections) Before: #iostat -dt da da0 KB/t tps MB/s 61.38 1731 56.31 # netstat -I igb0 -hw1 input (igb0) output packets errs bytes packets errs bytes colls 41K 0 10M 30K 0 68M 0 41K 0 11M 31K 0 68M 0 42K 0 11M 31K 0 68M 0 42K 0 11M 31K 0 68M 0 42K 0 9.2M 31K 0 68M 0 42K 0 9.8M 30K 0 59M 0 42K 0 11M 30K 0 60M 0 42K 0 11M 31K 0 68M 0 42K 0 11M 31K 0 68M 0 After: #iostat -dt da da0 KB/t tps MB/s 127.29 827 80.18 # netstat -I igb0 -hw1 input (igb0) output packets errs bytes packets errs bytes colls 46K 0 16M 69K 0 95M 0 47K 0 18M 70K 0 95M 0 48K 0 18M 71K 0 97M 0 44K 0 13M 70K 0 98M 0 40K 0 9.2M 68K 0 95M 0 50K 0 21M 74K 0 100M 0 49K 0 21M 71K 0 97M 0 46K 0 16M 72K 0 99M 0 51K 0 22M 75K 0 101M 0 >Fix: Apply this patch and reboot with kern.cam.da.max_size="2" in loader.conf --- sys/cam/scsi/scsi_da.c.orig 2009-10-28 14:53:43.000000000 +0100 +++ sys/cam/scsi/scsi_da.c 2009-10-28 15:16:26.000000000 +0100 @@ -515,12 +515,16 @@ static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; +static int da_max_size = 1; SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, &da_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.da.retry_count", &da_retry_count); +TUNABLE_INT("kern.cam.da.max_size", &da_max_size); +SYSCTL_INT(_kern_cam_da, OID_AUTO, max_size, CTLFLAG_RD, + &da_max_size, 0, "DFLTPHYS scale"); SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW, &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); TUNABLE_INT("kern.cam.da.default_timeout", &da_default_timeout); @@ -1201,7 +1205,10 @@ softc->disk->d_dump = dadump; softc->disk->d_name = "da"; softc->disk->d_drv1 = periph; - softc->disk->d_maxsize = DFLTPHYS; /* XXX: probably not arbitrary */ + + if(da_max_size > 2) + da_max_size = 1; + softc->disk->d_maxsize = da_max_size*DFLTPHYS; /* XXX: probably not arbitrary */ softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_NEEDSGIANT; disk_create(softc->disk, DISK_VERSION); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910292005.n9TK58rJ013670>