Date: Thu, 6 Jun 2013 10:25:58 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251464 - stable/8/sys/geom Message-ID: <201306061025.r56APwA6097885@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Thu Jun 6 10:25:58 2013 New Revision: 251464 URL: http://svnweb.freebsd.org/changeset/base/251464 Log: MFC r249930: Added a sysctl to control the maximum size of a delete request Modified: stable/8/sys/geom/geom_dev.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Thu Jun 6 10:09:20 2013 (r251463) +++ stable/8/sys/geom/geom_dev.c Thu Jun 6 10:25:58 2013 (r251464) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/disk.h> #include <sys/fcntl.h> #include <sys/limits.h> +#include <sys/sysctl.h> #include <geom/geom.h> #include <geom/geom_int.h> @@ -80,6 +81,19 @@ static struct g_class g_dev_class = { .orphan = g_dev_orphan, }; +/* + * We target 262144 (8 x 32768) sectors by default as this significantly + * increases the throughput on commonly used SSD's with a marginal + * increase in non-interruptible request latency. + */ +static uint64_t g_dev_del_max_sectors = 262144; +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, dev, CTLFLAG_RW, 0, "GEOM_DEV stuff"); +SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, delete_max_sectors, CTLFLAG_RW, + &g_dev_del_max_sectors, 0, "Maximum number of sectors in a single " + "delete request sent to the provider. Larger requests are chunked " + "so they can be interrupted. (0 = disable chunking)"); + void g_dev_print(void) { @@ -326,17 +340,20 @@ g_dev_ioctl(struct cdev *dev, u_long cmd } while (length > 0) { chunk = length; - if (chunk > 65536 * cp->provider->sectorsize) - chunk = 65536 * cp->provider->sectorsize; + if (g_dev_del_max_sectors != 0 && chunk > + g_dev_del_max_sectors * cp->provider->sectorsize) { + chunk = g_dev_del_max_sectors * + cp->provider->sectorsize; + } error = g_delete_data(cp, offset, chunk); length -= chunk; offset += chunk; if (error) break; /* - * Since the request size is unbounded, the service - * time is likewise. We make this ioctl interruptible - * by checking for signals for each bio. + * Since the request size can be large, the service + * time can be is likewise. We make this ioctl + * interruptible by checking for signals for each bio. */ if (SIGPENDING(td)) break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306061025.r56APwA6097885>