From owner-freebsd-current Tue Jun 19 22: 1:57 2001 Delivered-To: freebsd-current@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 7A47F37B406 for ; Tue, 19 Jun 2001 22:01:53 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.3/8.11.2) id f5K51kU05828; Tue, 19 Jun 2001 22:01:46 -0700 (PDT) (envelope-from dillon) Date: Tue, 19 Jun 2001 22:01:46 -0700 (PDT) From: Matt Dillon Message-Id: <200106200501.f5K51kU05828@earth.backplane.com> To: Mikhail Teterin Cc: phk@critter.freebsd.dk, current@FreeBSD.ORG Subject: Re: mdconfig and _virtual_ memory References: <200106200257.f5K2vS628250@aldan.algebra.com> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :So, Matt, any comments? : :On 7 Jun, Poul-Henning Kamp wrote: :> In message <200106061419.f56EJYN18798@aldan.algebra.com>, :> Mikhail Teterin writes: :> :... :> :> The swap backing in md(4) is a straight copy of the code which lived :> in vn(4). I'm not terribly familiar with that code, but I would expect :> that it would work with no swap space as well. :> :> Your man is probably Matt Dillon... : : -mi You can create an MD partition with wired memory - no swap backing at all, if you want. Obviously you can make such a partition as large as you might otherwise want to make it. - The swap-backed VN device did not cache the data in memory per-say, it simply treated the swap device as the backing device for the data. So in that respect MD works the same as VN when used with swap backing store. I think it is possible to get an effect similar to MFS in regards to trying to keep as much in ram as possible. We would have to turn off write_behind for the specific MD case (not too hard, clustering is already controlled by the backing device so we just need to add a flag for write_behind), we would have to make MAP_NOSYNC the default for mmap'd data (for such devices), turn on softupdates, and we might also want to make write() release the buffer (leaving the pages in the VM PAGE cache) rather then writing it out... though that would be a lot more work. -- There are a few things you can do right now as a temporary workaround. It isn't perfect... the data eventually gets written out, but the writes will be rather severely decoupled. * turn off write_behind (this is a global setting unfortunately) sysctl -w vfs.write_behind=0 * Create the MD/VN filesystem. Either turn on softupdates or mount it async. * Turn on vmiodirenable sysctl -w vfs.vmiodirenable=1 Note that the performance one saw with MFS was mainly due to MFS trying to cache everything in ram - to the detriment of other resources in the system and also to safety (the MFS filesystem would be completely lost in a crash). I know people who used MFS filesystems as mail queues but I would never do that sort of thing myself. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message