From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 12 20:45:26 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 0C074106566C for ; Tue, 12 Jun 2012 20:45:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6088FC15 for ; Tue, 12 Jun 2012 20:45:25 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q5CKj9a0033142; Tue, 12 Jun 2012 23:45:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q5CKj9DT002025; Tue, 12 Jun 2012 23:45:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q5CKj8AH002024; Tue, 12 Jun 2012 23:45:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 Jun 2012 23:45:08 +0300 From: Konstantin Belousov To: Ian Lepore Message-ID: <20120612204508.GP2337@deviant.kiev.zoral.com.ua> References: <1339259223.36051.328.camel@revolution.hippie.lan> <20120609165217.GO85127@deviant.kiev.zoral.com.ua> <1339512694.36051.362.camel@revolution.hippie.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="e2bLSPRkEYxxSNev" Content-Disposition: inline In-Reply-To: <1339512694.36051.362.camel@revolution.hippie.lan> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Wojciech Puchar , freebsd-hackers@freebsd.org Subject: Re: wired memory - again! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 20:45:26 -0000 --e2bLSPRkEYxxSNev Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 12, 2012 at 08:51:34AM -0600, Ian Lepore wrote: > On Sat, 2012-06-09 at 22:45 +0200, Wojciech Puchar wrote: > > > > > > First, all memory allocated by UMA and consequently malloc(9) is > > > wired. In other words, almost all memory used by kernel is accounted > > > as wired. > > > > > yes i understand this. still i found no way how to find out what alloca= ted=20 > > that much. > >=20 > >=20 > > > Second, the buffer cache wires the pages which are inserted into VMIO > > > buffers. So your observation is basically right, cached buffers means > >=20 > > what are exactly "VMIO" buffers. i understand that page must be wired W= HEN=20 > > doing I/O. > > But i have too much wired memory even when doing no I/O at all. >=20 > I agree, this is The Big Question for me. Why does the system keep > wired writable mappings of the buffers in kva after the IO operations > are completed? =20 Read about buffer cache, e.g. in the Design and Implementation of the FreeBSD OS book. >=20 > If it did not do so, it would fix the instruction-cache-disabled bug > that kills performance on VIVT cache architectures (arm and mips) and it > would reduce the amount of wired memory (that apparently doesn't need to > be wired, unless I've missed the implications of a previous reply in > this thread). I have no idea what is the bug you are talking about. If my guess is right, and it specifically references unability of some processors to correctly handle several mappings of the same physical page into different virtual addresses due to cache tagging using virtual address instead of physical, then this is a hardware bug, not software. AFAIR, at least HP PA and MIPS have different instantiation of this problem. Our kernel uses multi-mapping quite often, and buffers is only one example. Also, why do you think that the pages entered into buffers shall not be wired, it is completely beyond my understanding. --e2bLSPRkEYxxSNev Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/XqlQACgkQC3+MBN1Mb4hfmQCgw2WXceltqeFrbY82uc618BzJ dtMAoPOXqmUsBncvW6A+QzJKX/bDOo6I =0UY6 -----END PGP SIGNATURE----- --e2bLSPRkEYxxSNev--