From owner-cvs-src-old@FreeBSD.ORG Sun Apr 10 15:41:05 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58621065793 for ; Sun, 10 Apr 2011 15:41:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7E2648FC14 for ; Sun, 10 Apr 2011 15:41:05 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p3AFf5Xb091225 for ; Sun, 10 Apr 2011 15:41:05 GMT (envelope-from trociny@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p3AFf5WA091224 for cvs-src-old@freebsd.org; Sun, 10 Apr 2011 15:41:05 GMT (envelope-from trociny@repoman.freebsd.org) Message-Id: <201104101541.p3AFf5WA091224@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to trociny@repoman.freebsd.org using -f From: Mikolaj Golub Date: Sun, 10 Apr 2011 15:40:57 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 Subject: cvs commit: src/sys/geom/gate g_gate.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 15:41:06 -0000 trociny 2011-04-10 15:40:57 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) sys/geom/gate g_gate.c Log: SVN rev 220524 on 2011-04-10 15:40:57Z by trociny MFC r220264: r220264 (pjd): GEOM has an internal mechanism to deal with ENOMEM errors returned via g_io_deliver(). In such case it increases 'pace' counter on each ENOMEM and reschedules the request. The 'pace' counter is decreased for each request going down, but until 'pace' is greater than zero, GEOM will handle at most 10 requests per second. For GEOM GATE users that are proxy to local GEOM providers (like ggatel(8) and HAST) we can end up with almost permanent slow down of GEOM down queue. This is because once we reach GEOM GATE queue limit, we return ENOMEM to the GEOM. This means that we have, eg. 1024 I/O requests in the GEOM GATE queue. To make room in the queue and stop returning ENOMEM we need to proceed the requests of course, but those requests are handled by userland daemons that handle them by reading/writing also from/to local GEOM providers. For example with HAST, a new requests comes to /dev/hast/data, which is GEOM GATE provider. GEOM GATE passes the request to hastd(8) and hastd(8) reads/writes from/to /dev/da0. Once we reach GEOM GATE queue limit, to free up a slot in GEOM GATE queue, hastd(8) has to read/write from/to /dev/da0, but this request will also be very slow, because GEOM now slows down all the requests. We end up with full queue that we can unload at the speed of 10 requests per second. This simply looks like a deadlock. Fix it by allowing userland daemons that work with both GEOM GATE and local GEOM providers to specify unlimited queue size, so GEOM GATE will never return ENOMEM to the GEOM. Approved by: pjd (mentor) Revision Changes Path 1.26.10.6 +1 -1 src/sys/geom/gate/g_gate.c