From owner-freebsd-geom@FreeBSD.ORG Thu Mar 5 09:46:35 2009 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B49C1065672 for ; Thu, 5 Mar 2009 09:46:35 +0000 (UTC) (envelope-from jespasac@minibofh.org) Received: from smtp02.cdmon.com (smtp02.cdmon.com [212.36.74.229]) by mx1.freebsd.org (Postfix) with ESMTP id 0DCF58FC1C for ; Thu, 5 Mar 2009 09:46:34 +0000 (UTC) (envelope-from jespasac@minibofh.org) Received: from jespasac.cdmon.com (62.Red-217-126-43.staticIP.rima-tde.net [217.126.43.62]) by smtp02.cdmon.com (Postfix) with ESMTP id 0AFC8496A4; Thu, 5 Mar 2009 10:30:58 +0100 (CET) Message-ID: <49AF9B6C.8090908@minibofh.org> Date: Thu, 05 Mar 2009 10:29:16 +0100 From: Jordi Espasa Clofent User-Agent: Thunderbird 2.0.0.19 (X11/20090107) MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: gmirror(8): round-robin vs. load algorithm X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2009 09:46:35 -0000 Hi all, It's supposed that 'round-robin' algorithm has the best performance in gmirror(8). However, looking directly at code (1) I see that the only difference between 'round-robin' and 'load' algorithm is: [...] binuptime(&curtime); /* * Find a disk which the smallest load. */ disk = NULL; LIST_FOREACH(dp, &sc->sc_disks, d_next) { if (dp->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; /* If disk wasn't used for more than 2 sec, use it. */ if (curtime.sec - dp->d_last_used.sec >= 2) { disk = dp; break; } if (disk == NULL || bintime_cmp(&dp->d_delay, &disk->d_delay) < 0) { disk = dp; } } [...] The key is in "/* If disk wasn't used for more than 2 sec, use it. */", but, for the rest, 'load' algorithm implementation seems the same as round-robin. If I'm right, my question is ¿where is the use of 'load' recommended? I understand that 'load' will be good in servers with a lot of disk activity (large disk I/O could provoque that gmirror expulses a mirror member or even reboot or panics the system) because it try always the low-loaded disk. (1) http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/geom/mirror/g_mirror.c?rev=1.93.6.1;content-type=text%2Fplain -- Thanks, Jordi Espasa Clofent