git: d53927b0bae4 - main - uma: Don't allow a limit to be set in a warm zone

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 30 Mar 2022 19:59:40 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=d53927b0bae45bf5b4b206b2dddf37bab319a1b3

commit d53927b0bae45bf5b4b206b2dddf37bab319a1b3
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-03-30 19:42:18 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-03-30 19:42:18 +0000

    uma: Don't allow a limit to be set in a warm zone
    
    The limit accounting in UMA does not tolerate this.
    
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
---
 sys/vm/uma_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index f179e87d87ac..958442fe73e2 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -4880,6 +4880,8 @@ uma_zone_set_max(uma_zone_t zone, int nitems)
 	 * way to clear a limit.
 	 */
 	ZONE_LOCK(zone);
+	if (zone->uz_max_items == 0)
+		ZONE_ASSERT_COLD(zone);
 	zone->uz_max_items = nitems;
 	zone->uz_flags |= UMA_ZFLAG_LIMIT;
 	zone_update_caches(zone);