From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 12 00:36:32 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 424D5204 for ; Mon, 12 Nov 2012 00:36:32 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id D7A888FC0C for ; Mon, 12 Nov 2012 00:36:31 +0000 (UTC) Received: (qmail 18890 invoked by uid 0); 12 Nov 2012 00:32:15 -0000 Received: from 67.206.184.26 by rms-us014 with HTTP Content-Type: text/plain; charset="utf-8" Date: Sun, 11 Nov 2012 19:32:13 -0500 From: "Dieter BSD" Message-ID: <20121112003215.238950@gmx.com> MIME-Version: 1.0 Subject: Re: Memory reserves or lack thereof To: freebsd-hackers@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: 2CbScDM83zOlNR3dAHAh3Xh+IGRvb8DR X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 00:36:32 -0000 Alan writes: > In conclusion, I think it's time that we change M_NOWAIT so that it doesn't > dig any deeper into the cache/free page queues than M_WAITOK does and > reintroduce a M_USE_RESERVE-like flag that says dig deep into the > cache/free page queues.  The trouble is that we then need to identify all > of those places that are implicitly depending on the current behavior of > M_NOWAIT also digging deep into the cache/free page queues so that we can > add an explicit M_USE_RESERVE. find /usr/src/sys | xargs grep M_NOWAIT | wc -l 2101 Sounds like a lot of work that would need to happen atomically. Would this work: M_NO_WAIT       do not sleep, do not dig deep unless M_USE_RESERVE also set M_USE_RESERVE   dig deep M_NOWAIT        M_NO_WAIT | M_USE_RESERVE (deprecated) New code avoids using M_NOWAIT. Existing code continues working the same way. As time permits, old code is converted to new flags. Eventually M_NOWAIT goes away. Pro: the amount of code that needs to change atomically is much smaller. Con: (1) Have to remember (or look up) difference between M_NOWAIT and M_NO_WAIT. Maybe calling the new flag M_NO_SLEEP would help? (2) Would M_NOWAIT really ever go away? The spl() calls haven't, even after some cage rattling.