Subject: RE: UBC on a no swap system
To: 'Vasant Kanchan' <v_kanchan@yahoo.com>
From: Huy Vu <hvu@hyperchip.com>
List: tech-embed
Date: 06/17/2003 14:53:45
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C33501.C7C32400
Content-Type: text/plain;
	charset="iso-8859-1"

We had the same problem, this is how we 'work-around' the problem :-)

--------------
Index: uvm_fault.c
===================================================================
RCS file: /cvsroot/netbsd-current/netbsd1.6/sys/uvm/uvm_fault.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -r1.2 -r1.3
538c538,541
<       vaddr_t startva, objaddr, currva, offset;
---
> #ifdef NEW_ALGORITHM
>     int t;
> #endif
>     vaddr_t startva, objaddr, currva, offset;
1163c1166,1174
<                       if (anon == NULL || uvmexp.swpgonly ==
uvmexp.swpages) {
---
>
> #ifdef NEW_ALGORITHM
>             t = uvmexp.active + uvmexp.inactive + uvmexp.free;
>                       if (anon == NULL || (uvmexp.swpgonly ==
uvmexp.swpages &&
>                 uvmexp.filepages <= ((t * uvmexp.filemin) >> 8) &&
>                 uvmexp.execpages <= ((t * uvmexp.execmin) >> 8))) {
> #else
>                       if (anon == NULL || (uvmexp.swpgonly ==
uvmexp.swpages)) {
> #endif
1579c1590,1598
<                       if (anon == NULL || uvmexp.swpgonly ==
uvmexp.swpages) {
---
>
> #ifdef NEW_ALGORITHM
>             t = uvmexp.active + uvmexp.inactive + uvmexp.free;
>                       if (anon == NULL || (uvmexp.swpgonly ==
uvmexp.swpages &&
>                 uvmexp.filepages <= ((t * uvmexp.filemin) >> 8) &&
>                 uvmexp.execpages <= ((t * uvmexp.execmin) >> 8))) {
> #else 
>                       if (anon == NULL || (uvmexp.swpgonly ==
uvmexp.swpages)) {
> #endif

------_=_NextPart_001_01C33501.C7C32400
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: UBC on a no swap system</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>We had the same problem, this is how we 'work-around' =
the problem :-)</FONT>
</P>

<P><FONT SIZE=3D2>--------------</FONT>
<BR><FONT SIZE=3D2>Index: uvm_fault.c</FONT>
<BR><FONT =
SIZE=3D2>=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</FONT=
>
<BR><FONT SIZE=3D2>RCS file: =
/cvsroot/netbsd-current/netbsd1.6/sys/uvm/uvm_fault.c,v</FONT>
<BR><FONT SIZE=3D2>retrieving revision 1.2</FONT>
<BR><FONT SIZE=3D2>retrieving revision 1.3</FONT>
<BR><FONT SIZE=3D2>diff -r1.2 -r1.3</FONT>
<BR><FONT SIZE=3D2>538c538,541</FONT>
<BR><FONT SIZE=3D2>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vaddr_t =
startva, objaddr, currva, offset;</FONT>
<BR><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>&gt; #ifdef NEW_ALGORITHM</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; int t;</FONT>
<BR><FONT SIZE=3D2>&gt; #endif</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; vaddr_t startva, =
objaddr, currva, offset;</FONT>
<BR><FONT SIZE=3D2>1163c1166,1174</FONT>
<BR><FONT =
SIZE=3D2>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || uvmexp.swpgonly =3D=3D uvmexp.swpages) =
{</FONT>
<BR><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; #ifdef NEW_ALGORITHM</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; t =3D uvmexp.active + uvmexp.inactive + =
uvmexp.free;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || (uvmexp.swpgonly =3D=3D uvmexp.swpages =
&amp;&amp;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uvmexp.filepages &lt;=3D ((t * =
uvmexp.filemin) &gt;&gt; 8) &amp;&amp;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uvmexp.execpages &lt;=3D ((t * =
uvmexp.execmin) &gt;&gt; 8))) {</FONT>
<BR><FONT SIZE=3D2>&gt; #else</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || (uvmexp.swpgonly =3D=3D uvmexp.swpages)) =
{</FONT>
<BR><FONT SIZE=3D2>&gt; #endif</FONT>
<BR><FONT SIZE=3D2>1579c1590,1598</FONT>
<BR><FONT =
SIZE=3D2>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || uvmexp.swpgonly =3D=3D uvmexp.swpages) =
{</FONT>
<BR><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; #ifdef NEW_ALGORITHM</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; t =3D uvmexp.active + uvmexp.inactive + =
uvmexp.free;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || (uvmexp.swpgonly =3D=3D uvmexp.swpages =
&amp;&amp;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uvmexp.filepages &lt;=3D ((t * =
uvmexp.filemin) &gt;&gt; 8) &amp;&amp;</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uvmexp.execpages &lt;=3D ((t * =
uvmexp.execmin) &gt;&gt; 8))) {</FONT>
<BR><FONT SIZE=3D2>&gt; #else </FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if (anon =3D=3D NULL || (uvmexp.swpgonly =3D=3D uvmexp.swpages)) =
{</FONT>
<BR><FONT SIZE=3D2>&gt; #endif</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C33501.C7C32400--