Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2007 10:54:58 +0800
From:      LI Xin <delphij@delphij.net>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   [PATCH] wakeup keg if zone_max is altered
Message-ID:  <46E75502.50803@delphij.net>

next in thread | raw e-mail | index | archive | help
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 <delphij@delphij.net>	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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46E75502.50803>