From owner-cvs-all Sat Nov 2 3: 9:38 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B05CE37B401; Sat, 2 Nov 2002 03:09:37 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 787C043E75; Sat, 2 Nov 2002 03:09:37 -0800 (PST) (envelope-from phk@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gA2B87mV020730; Sat, 2 Nov 2002 03:08:07 -0800 (PST) (envelope-from phk@repoman.freebsd.org) Received: (from phk@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gA2B87QO020729; Sat, 2 Nov 2002 03:08:07 -0800 (PST) Message-Id: <200211021108.gA2B87QO020729@repoman.freebsd.org> From: Poul-Henning Kamp Date: Sat, 2 Nov 2002 03:08:07 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/geom geom_io.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG phk 2002/11/02 03:08:07 PST Modified files: sys/geom geom_io.c Log: malloc(9) with M_NOWAIT seems to return NULL a lot more than I would have expected under -current. This is a problem for GEOM because the up/down threads cannot sleep waiting for memory to become free. The reason they cannot sleep is that paging things out to disk may be the only way we can clear up some RAM. Nice catch-22 there. Implement a rudimentary ENOMEM recovery strategy: If an I/O request fails with an error code of ENOMEM, schedule it for a retry, and tell the down-thread to sleep hz/10 to get other parts of the system a chance to free up some memory, in particular the up-path in GEOM. All caches should probably start to monitor malloc(9) failures using the new malloc_last_fail() function, and release when it indicates congestion. Sponsored by: DARPA & NAI Labs. Revision Changes Path 1.19 +14 -0 src/sys/geom/geom_io.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message