Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 May 2012 03:03:56 GMT
From:      Mark Linimon <linimon@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/168213: [kernel] why is the type of ub_cnt signed in uma_int.h?
Message-ID:  <201205220303.q4M33uGe066825@freefall.freebsd.org>
Resent-Message-ID: <201205220310.q4M3A2ns067674@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         168213
>Category:       kern
>Synopsis:       [kernel] why is the type of ub_cnt signed in uma_int.h?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 22 03:10:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Mark Linimon
>Release:        FreeBSD 9.0-STABLE i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD freefall.freebsd.org 9.0-STABLE FreeBSD 9.0-STABLE #6 r235139: Tue May 8 21:19:03 UTC 2012 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386
>Description:
While looking at a problem for a customer, I was confused by the outputs
of number of free items and number of entries in uma_int.h.  Shouldn't
these two entities be unsigned instead of signed?
>How-To-Repeat:
>Fix:
This isn't a fix, as much as grounds for discussion.

Index: uma_int.h
===================================================================
RCS file: /home/FreeBSD/ncvs/src/sys/vm/uma_int.h,v
retrieving revision 1.46
diff -u -r1.46 uma_int.h
--- uma_int.h	21 May 2011 17:43:43 -0000	1.46
+++ uma_int.h	13 Apr 2012 17:06:48 -0000
@@ -174,8 +174,8 @@
 
 struct uma_bucket {
 	LIST_ENTRY(uma_bucket)	ub_link;	/* Link into the zone */
-	int16_t	ub_cnt;				/* Count of free items. */
-	int16_t	ub_entries;			/* Max items. */
+	u_int16_t	ub_cnt;			/* Count of free items. *//* XXX MCL was int64_t? */
+	u_int16_t	ub_entries;		/* Max items. *//* XXX MCL was int64_t? */
 	void	*ub_bucket[];			/* actual allocation storage */
 };
 
>Release-Note:
>Audit-Trail:
>Unformatted:



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