Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2012-04-11 Thread YAMAMOTO Takashi
> 
> On Apr 11, 2012, at 7:34 PM, YAMAMOTO Takashi wrote:
> 
>> hi,
>> 
>>> Module Name:src
>>> Committed By:   matt
>>> Date:   Thu Apr 12 01:40:27 UTC 2012
>>> 
>>> Modified Files:
>>> src/sys/uvm [matt-nb5-mips64]: uvm_extern.h uvm_fault.c uvm_km.c
>>> uvm_meter.c uvm_pdaemon.c uvm_pdaemon.h uvm_pdpolicy.h
>>> uvm_pdpolicy_clock.c uvm_stat.c
>>> 
>>> Log Message:
>>> Separate object-less anon pages out of the active list if there is no swap
>>> device.  Make uvm_reclaimable and uvm.*estimatable understand colors and
>>> kmem allocations.
>> 
>> i like the idea.
>> 
>> - why the queue is inside the pdpolicy?
>> 
>> - why don't you use PQ_SWAPBACKED?
> 
> that's only set when a swap slot has been allocated for it.  Since there's no 
> swap, it'll never be set.

the availability of swap slots doesn't affect PQ_SWAPBACKED.
it's always set for anon/aobj pages.

YAMAMOTO Takashi

> 
> The problem I'm attacking is memory exhaustion.  Making sure that's pdaemon 
> isn't consuming too many resources when it can't do anything.  the pdaemon 
> would spin continuously with dirty reactivations and the above was an attempt 
> to stop that.
> 
> It's still a work-in-progress.


Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2012-04-11 Thread Matt Thomas

On Apr 11, 2012, at 7:34 PM, YAMAMOTO Takashi wrote:

> hi,
> 
>> Module Name: src
>> Committed By:matt
>> Date:Thu Apr 12 01:40:27 UTC 2012
>> 
>> Modified Files:
>>  src/sys/uvm [matt-nb5-mips64]: uvm_extern.h uvm_fault.c uvm_km.c
>>  uvm_meter.c uvm_pdaemon.c uvm_pdaemon.h uvm_pdpolicy.h
>>  uvm_pdpolicy_clock.c uvm_stat.c
>> 
>> Log Message:
>> Separate object-less anon pages out of the active list if there is no swap
>> device.  Make uvm_reclaimable and uvm.*estimatable understand colors and
>> kmem allocations.
> 
> i like the idea.
> 
> - why the queue is inside the pdpolicy?
> 
> - why don't you use PQ_SWAPBACKED?

that's only set when a swap slot has been allocated for it.  Since there's no 
swap, it'll never be set.

The problem I'm attacking is memory exhaustion.  Making sure that's pdaemon 
isn't consuming too many resources when it can't do anything.  the pdaemon 
would spin continuously with dirty reactivations and the above was an attempt 
to stop that.

It's still a work-in-progress.

Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2012-04-11 Thread YAMAMOTO Takashi
hi,

> Module Name:  src
> Committed By: matt
> Date: Thu Apr 12 01:40:27 UTC 2012
> 
> Modified Files:
>   src/sys/uvm [matt-nb5-mips64]: uvm_extern.h uvm_fault.c uvm_km.c
>   uvm_meter.c uvm_pdaemon.c uvm_pdaemon.h uvm_pdpolicy.h
>   uvm_pdpolicy_clock.c uvm_stat.c
> 
> Log Message:
> Separate object-less anon pages out of the active list if there is no swap
> device.  Make uvm_reclaimable and uvm.*estimatable understand colors and
> kmem allocations.

i like the idea.

- why the queue is inside the pdpolicy?

- why don't you use PQ_SWAPBACKED?

YAMAMOTO Takashi

> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.148.4.2.4.5 -r1.148.4.2.4.6 src/sys/uvm/uvm_extern.h
> cvs rdiff -u -r1.125.6.1.4.4 -r1.125.6.1.4.5 src/sys/uvm/uvm_fault.c
> cvs rdiff -u -r1.101.4.2.4.9 -r1.101.4.2.4.10 src/sys/uvm/uvm_km.c
> cvs rdiff -u -r1.49.16.3 -r1.49.16.4 src/sys/uvm/uvm_meter.c
> cvs rdiff -u -r1.93.4.2.4.8 -r1.93.4.2.4.9 src/sys/uvm/uvm_pdaemon.c
> cvs rdiff -u -r1.15 -r1.15.28.1 src/sys/uvm/uvm_pdaemon.h
> cvs rdiff -u -r1.3.62.1 -r1.3.62.2 src/sys/uvm/uvm_pdpolicy.h
> cvs rdiff -u -r1.12.16.4 -r1.12.16.5 src/sys/uvm/uvm_pdpolicy_clock.c
> cvs rdiff -u -r1.31.12.3 -r1.31.12.4 src/sys/uvm/uvm_stat.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.


re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-08-18 Thread matthew green

> 
> On Aug 18, 2010, at 6:11 PM, matthew green wrote:
> 
> > 
> >> Module Name:   src
> >> Committed By:  matt
> >> Date:  Wed Aug 18 18:19:11 UTC 2010
> >> 
> >> Modified Files:
> >>src/sys/uvm [matt-nb5-mips64]: uvm_map.c
> >> 
> >> Log Message:
> >> Add a hook so that MD code has handle the change in address space limits
> >> when an exec happens.
> >> Add a routine to turn on/off UX when an address space changes due to an 
> >> exec
> >> (N32 execing a N64 for instance).
> > 
> > could you do this with #ifdef __HAVE_CPU_VMSPACE_EXEC?
> 
> I could.  I just wanted something quick & dirty.  Going to use it for sparc?

i just don't like seeing "#if defined(__mips__) && _LP64" in MI code
if is easily avoidable.  thanks.


.mrg.


Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-08-18 Thread Matt Thomas

On Aug 18, 2010, at 6:11 PM, matthew green wrote:

> 
>> Module Name: src
>> Committed By:matt
>> Date:Wed Aug 18 18:19:11 UTC 2010
>> 
>> Modified Files:
>>  src/sys/uvm [matt-nb5-mips64]: uvm_map.c
>> 
>> Log Message:
>> Add a hook so that MD code has handle the change in address space limits
>> when an exec happens.
>> Add a routine to turn on/off UX when an address space changes due to an exec
>> (N32 execing a N64 for instance).
> 
> could you do this with #ifdef __HAVE_CPU_VMSPACE_EXEC?

I could.  I just wanted something quick & dirty.  Going to use it for sparc?

re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-08-18 Thread matthew green

> Module Name:  src
> Committed By: matt
> Date: Wed Aug 18 18:19:11 UTC 2010
> 
> Modified Files:
>   src/sys/uvm [matt-nb5-mips64]: uvm_map.c
> 
> Log Message:
> Add a hook so that MD code has handle the change in address space limits
> when an exec happens.
> Add a routine to turn on/off UX when an address space changes due to an exec
> (N32 execing a N64 for instance).

could you do this with #ifdef __HAVE_CPU_VMSPACE_EXEC?

thanks.


CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Jan 27 07:45:19 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_page.c

Log Message:
Remove JRT two line comment about cache interference since the
change specifically addresses general VIPT cache issue.  Need more
throughout comment cleanup about uvmexp.ncolor intent and significance.


To generate a diff of this commit:
cvs rdiff -u -r1.140.6.3.4.2 -r1.140.6.3.4.3 src/sys/uvm/uvm_page.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 21:26:28 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_extern.h uvm_fault.c uvm_km.c
uvm_page.c

Log Message:
Pass hints to uvm_pagealloc* to get it to use the right page color rather
than guess the right page color.


To generate a diff of this commit:
cvs rdiff -u -r1.148.4.2 -r1.148.4.2.4.1 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.125.6.1 -r1.125.6.1.4.1 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.101.4.2.4.1 -r1.101.4.2.4.2 src/sys/uvm/uvm_km.c
cvs rdiff -u -r1.140.6.3.4.1 -r1.140.6.3.4.2 src/sys/uvm/uvm_page.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jan 23 20:03:28 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c

Log Message:
Use roundup2 instead of roundup when doing alignment rounding since all
alignments must be a power of 2. (thanks to rmind for suggesting it).


To generate a diff of this commit:
cvs rdiff -u -r1.42.16.4 -r1.42.16.5 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jan 23 19:54:04 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_page.h uvm_pglist.c

Log Message:
Add a start_hint to vm_physseg so when allocating pages, we can skip
forward over pages that are probably still allocated.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.55.14.1 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.42.16.3 -r1.42.16.4 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 08:54:41 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c

Log Message:
Remove some optimizations since they actually don't do the right thing.
We never want to test the starting page first since it doesn't really give
use any good information that we can use for the next pass.


To generate a diff of this commit:
cvs rdiff -u -r1.42.16.2 -r1.42.16.3 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-22 Thread enami tsugutomo
> >> To generate a diff of this commit:
> >> cvs rdiff -u -r1.42 -r1.42.16.1 src/sys/uvm/uvm_pglist.c
> >
> >>   /*
> >>* Test both the ending and starting pages to see if =
> they are
> >>* both free.  If the ending and starting pages are =
> same page,
> >>* we only test one of them.  If the pages aren't free, =
> there
> >>* is no reason to continue this iteration so advance =
> to the
> >>* next address and try again.
> >>*/
> >>   if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0
> >>   || end - 1 == tryidx + skip
> >>   || VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
> >>   try += roundup(num, align);
> >>   skip = 0;
> >>   continue;
> >>   }
> >
> > I guess this part can be improved and/or fixed as below.
> 
> I initially did something like that but realized it didn't really buy me
> anything since the compiler will actually do something like that
> anyways.

Ah, you're missing my point.  Let me rephrase again.

1) If `VM_PAGE_IS_FREE(&pgs[end - 1]) == 0' is false and `end - 1 ==
   tryidx + skip' is true, above code skips the region but actually we
   found the enough space.

2) If `VM_PAGE_IS_FREE(&pgs[end - 1]) == 0' is false and `end - 1 ==
   tryidx + skip' is false but `VM_PAGE_IS_FREE(&pgs[tryidx + skip])
   == 0' is true, it is better to advance the `try' by roundup(skip +
   1, align) instead of roundup(num, align).

enami.


Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-22 Thread Matt Thomas

On Jan 22, 2010, at 12:28 AM, enami tsugutomo wrote:

>> Module Name: src
>> Committed By:matt
>> Date:Fri Jan 22 05:17:32 UTC 2010
>> 
>> Modified Files:
>>  src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c
>> 
>> Log Message:
>> Rework the algorithm to allocate contiguous pages to be much much faster.
>> (read the comments if you want to know how it's done).
>> 
>> 
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.42 -r1.42.16.1 src/sys/uvm/uvm_pglist.c
> 
>>   /*
>>* Test both the ending and starting pages to see if they are
>>* both free.  If the ending and starting pages are same page,
>>* we only test one of them.  If the pages aren't free, there
>>* is no reason to continue this iteration so advance to the
>>* next address and try again.
>>*/
>>   if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0
>>   || end - 1 == tryidx + skip
>>   || VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
>>   try += roundup(num, align);
>>   skip = 0;
>>   continue;
>>   }
> 
> I guess this part can be improved and/or fixed as below.

I initially did something like that but realized it didn't really buy me 
anything since the compiler will actually do something like that anyways.

Re: CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-22 Thread enami tsugutomo
> Module Name:  src
> Committed By: matt
> Date: Fri Jan 22 05:17:32 UTC 2010
> 
> Modified Files:
>   src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c
> 
> Log Message:
> Rework the algorithm to allocate contiguous pages to be much much faster.
> (read the comments if you want to know how it's done).
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.42 -r1.42.16.1 src/sys/uvm/uvm_pglist.c

>/*
> * Test both the ending and starting pages to see if they are
> * both free.  If the ending and starting pages are same page,
> * we only test one of them.  If the pages aren't free, there
> * is no reason to continue this iteration so advance to the
> * next address and try again.
> */
>if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0
>|| end - 1 == tryidx + skip
>|| VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
>try += roundup(num, align);
>skip = 0;
>continue;
>}

I guess this part can be improved and/or fixed as below.

enami.

/*
 * If the last page is not free, skip entire region.
 */
if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0) {
try += roundup(num, align);
skip = 0;
continue;
}

/*
 * If the last page is the only page to check,
 * we found enough space.
 */
if (end - 1 == tryidx + skip) {
while (skip-- > 0) {
KDASSERT(VM_PAGE_IS_FREE(&pgs[tryidx + skip]));
}
#ifdef PGALLOC_VERBOSE
printf(": ok\n");
#endif
break;
}

/*
 * If the start page is not free, start from next boundary
 * to the start page.
 */
if (VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
try += roundup(skip + 1, align);
skip = 0;
continue;
}


CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jan 22 06:05:16 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c

Log Message:
Fix a couple comment typos.


To generate a diff of this commit:
cvs rdiff -u -r1.42.16.1 -r1.42.16.2 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 05:17:32 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c

Log Message:
Rework the algorithm to allocate contiguous pages to be much much faster.
(read the comments if you want to know how it's done).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.16.1 src/sys/uvm/uvm_pglist.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 04:03:22 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_stat.c

Log Message:
Print out colors in uvmexp_print


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.12.1 src/sys/uvm/uvm_stat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [matt-nb5-mips64] src/sys/uvm

2010-01-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jan  9 05:54:40 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_km.c

Log Message:
If PMAP_ALLOC_POOLPAGE is defined use it instead of uvm_pagealloc


To generate a diff of this commit:
cvs rdiff -u -r1.101.4.2 -r1.101.4.2.4.1 src/sys/uvm/uvm_km.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.