Subject: kern/17391: kernel may silently adjust nbuf without saying why....
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 06/25/2002 13:35:29
>Number:         17391
>Category:       kern
>Synopsis:       kernel may silently adjust nbuf without saying why....
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 25 11:54:12 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        NetBSD-current 2002/06/23
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:

	under some conditions the kernel may re-adjust nbuf, but it
	won't tell you why....

>How-To-Repeat:

>Fix:

	add a couple of printf's to warn of this adjustment:

Index: kern_allocsys.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/syssrc/sys/kern/kern_allocsys.c,v
retrieving revision 1.18
diff -c -c -r1.18 kern_allocsys.c
*** kern_allocsys.c	12 Nov 2001 15:25:05 -0000	1.18
--- kern_allocsys.c	25 Jun 2002 17:32:26 -0000
***************
*** 206,213 ****
  	 * XXX stopgap measure to prevent wasting too much KVM on
  	 * the sparsely filled buffer cache.
  	 */
! 	if (nbuf * MAXBSIZE > VM_MAX_KERNEL_BUF)
  		nbuf = VM_MAX_KERNEL_BUF / MAXBSIZE;
  #endif
  
  	/*
--- 206,216 ----
  	 * XXX stopgap measure to prevent wasting too much KVM on
  	 * the sparsely filled buffer cache.
  	 */
! 	if (nbuf * MAXBSIZE > VM_MAX_KERNEL_BUF) {
! 		printf("nbuf at %d is too large for VM_MAX_KERNEL_BUF... ", nbuf);
  		nbuf = VM_MAX_KERNEL_BUF / MAXBSIZE;
+ 		printf("adjusted to %d\n", nbuf);
+ 	}
  #endif
  
  	/*
>Release-Note:
>Audit-Trail:
>Unformatted: