From eugen@grosbein.pp.ru  Tue Jul 17 11:47:36 2007
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AA7DB16A407
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2007 11:47:36 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166])
	by mx1.freebsd.org (Postfix) with ESMTP id 0979213C4BB
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2007 11:47:34 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (localhost [127.0.0.1])
	by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l6HBlW0Y001528
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 17 Jul 2007 19:47:32 +0800 (KRAST)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from eugen@localhost)
	by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l6HBlVgX001527;
	Tue, 17 Jul 2007 19:47:31 +0800 (KRAST)
	(envelope-from eugen)
Message-Id: <200707171147.l6HBlVgX001527@grosbein.pp.ru>
Date: Tue, 17 Jul 2007 19:47:31 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] make vm_page_max_wired tunnable at run time
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         114654
>Category:       kern
>Synopsis:       [vm] [patch] make vm_page_max_wired tunnable at run time
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    alc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 17 11:50:02 GMT 2007
>Closed-Date:    Sun May 25 07:39:34 UTC 2008
>Last-Modified:  Sun May 25 07:40:01 UTC 2008
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Svyaz-Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-STABLE FreeBSD 6.2-STABLE #0: Tue Jul 17 19:23:09 KRAST 2007 eu@grosbein.pp.ru:/usr/obj/usr/local/src/sys/DADV i386

>Description:
	The kernel limits number of pages mlock()'ed by a process
	to one third of vm.stats.vm.v_free_count to prevent damage
	from broken processes. However, sometimes there is a need to allow
	a process to mlock() more than half of free pages pool,
	one example is /usr/ports/sysutils/memtest.
	Let's make vm_page_max_wired tunnable at run time.

>How-To-Repeat:
	I've installed second 1Gb memory module to my system and
	want to quick-check (most part of) it. I've raised kern.maxdsize
	but the kernel still does not allow memtest to mlock() so many pages.

	Yes, I know the best method is to boot the system from floppy
	of CD with special memory tester. But I'd glad to see this
	way allowed too.
>Fix:

	Running kernel with the following patch, I may increase
	sysctl vm.max_wired value upto, say, 1.5Gb
	for the system having 2Gb RAM and still run memtest from X.org's
	xterm session (top shows "1802M Free" here).

--- sys/vm/vm_pageout.c.orig	Tue Jul 17 19:18:56 2007
+++ sys/vm/vm_pageout.c	Tue Jul 17 19:33:52 2007
@@ -203,6 +203,8 @@
 int vm_pageout_page_count = VM_PAGEOUT_PAGE_COUNT;
 
 int vm_page_max_wired;		/* XXX max # of wired pages system-wide */
+SYSCTL_INT(_vm, OID_AUTO, max_wired,
+	CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count");
 
 #if !defined(NO_SWAPPING)
 static void vm_pageout_map_deactivate_pages(vm_map_t, long);


Eugene Grosbein
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->alc 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Fri Nov 16 08:02:20 UTC 2007 
Responsible-Changed-Why:  

This seems reasonable to me. 
alc - please let me know what you think, and close if you think it is 
simply a bad idea. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=114654 
State-Changed-From-To: open->patched 
State-Changed-By: alc 
State-Changed-When: Fri Nov 23 00:31:21 UTC 2007 
State-Changed-Why:  
Patch applied to HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=114654 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/114654: commit references a PR
Date: Fri, 23 Nov 2007 04:39:00 +0000 (UTC)

 alc         2007-11-23 00:30:19 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/vm               vm_pageout.c 
   Log:
   Add a read/write sysctl for reconfiguring the maximum number of physical
   pages that can be wired.
   
   Submitted by:   Eugene Grosbein
   PR:             114654
   MFC after:      6 weeks
   
   Revision  Changes    Path
   1.293     +2 -0      src/sys/vm/vm_pageout.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/114654: commit references a PR
Date: Sun, 25 May 2008 07:00:17 +0000 (UTC)

 alc         2008-05-25 07:00:07 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/vm               vm_pageout.c 
   Log:
   MFC revision 1.293
     Add a read/write sysctl for reconfiguring the maximum number of physical
     pages that can be wired.
   
   PR: 114654
   
   Revision   Changes    Path
   1.292.2.1  +2 -0      src/sys/vm/vm_pageout.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: alc 
State-Changed-When: Sun May 25 07:38:45 UTC 2008 
State-Changed-Why:  
Patch applied to RELENG_7 and RELENG_6. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=114654 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/114654: commit references a PR
Date: Sun, 25 May 2008 07:38:16 +0000 (UTC)

 alc         2008-05-25 07:38:09 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/vm               vm_pageout.c 
   Log:
   MFC revision 1.293
     Add a read/write sysctl for reconfiguring the maximum number of physical
     pages that can be wired.
   
   PR: 114654
   
   Revision   Changes    Path
   1.268.2.5  +2 -0      src/sys/vm/vm_pageout.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
