From owner-freebsd-current@FreeBSD.ORG Wed Sep 12 02:55:37 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61F7C16A418 for ; Wed, 12 Sep 2007 02:55:37 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.freebsd.org (Postfix) with ESMTP id A893613C4A5 for ; Wed, 12 Sep 2007 02:55:30 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id 04CEEEB5B6C; Wed, 12 Sep 2007 10:55:31 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id SHm63Ab5fEoY; Wed, 12 Sep 2007 10:55:22 +0800 (CST) Received: from LI-Xins-MacBook.local (sina152-194.staff.sina.com.cn [61.135.152.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 63C13EB9950; Wed, 12 Sep 2007 10:55:22 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:x-enigmail-version:openpgp:content-type; b=qP3GbYWGso/kZ1TbBx0qGi8Zujx3TuttrI2urm8pLuVgl0IkCD4olcv8D+OROhDiV g6g865i7zNChmcbr3yL/w== Message-ID: <46E75502.50803@delphij.net> Date: Wed, 12 Sep 2007 10:54:58 +0800 From: LI Xin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: FreeBSD Current X-Enigmail-Version: 0.95.3 OpenPGP: url=http://www.delphij.net/delphij.asc Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigECD2F4CEC49117670D73874B" Subject: [PATCH] wakeup keg if zone_max is altered X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 02:55:37 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigECD2F4CEC49117670D73874B Content-Type: multipart/mixed; boundary="------------060100000105060302050304" This is a multi-part message in MIME format. --------------060100000105060302050304 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Here is a patch that wakes up keg if zone_max is altered when necessay. Objections? Cheers, --=20 Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! --------------060100000105060302050304 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="uma_core.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="uma_core.c.diff" Index: uma_core.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/vm/uma_core.c,v retrieving revision 1.147 diff -u -p -r1.147 uma_core.c --- uma_core.c 31 May 2007 22:52:14 -0000 1.147 +++ uma_core.c 12 Sep 2007 02:53:43 -0000 @@ -2514,6 +2514,18 @@ uma_zone_set_max(uma_zone_t zone, int ni if (keg->uk_maxpages * keg->uk_ipers < nitems) keg->uk_maxpages++; =20 + if (keg->uk_flags & UMA_ZFLAG_FULL) { + if (keg->uk_pages < keg->uk_maxpages) + keg->uk_flags &=3D ~UMA_ZFLAG_FULL; + + /*=20 + * We can handle one more allocation. Since we're clearing ZFLAG_FULL,= + * wake up all procs blocked on pages. This should be uncommon, so=20 + * keeping this simple for now (rather than adding count of blocked=20 + * threads etc). + */ + wakeup(keg); + } ZONE_UNLOCK(zone); } =20 --------------060100000105060302050304-- --------------enigECD2F4CEC49117670D73874B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG51UCOfuToMruuMARClGBAJ9WjBxNWv7YGAiAIqs7+AZcNSNkGgCbBPsx DKzniFMRBOxoXXB4WGdBZSk= =aUP7 -----END PGP SIGNATURE----- --------------enigECD2F4CEC49117670D73874B--