Subject: Re: bug in wired accounting [[was Re: Can't lock even 4GB on system
To: None <jonathan@dsg.stanford.edu>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 01/17/2006 20:32:32
> >there is no cheap way to calculate "lockdelta" there, afaik.
> 
> Then maybe the current test should be removed, because it's  wrong?

although it might be considered wrong, it still makes some sense
as a kind of upperlimit...

> >maybe we can check the limit on fault_wire path instead.
> >in this way, i think we can also fix "threads vs rlimit" problem.
> 
> Sorry, I don't see how that helps, nor do I see the threads problem.
> Comments in uvm_map_pageable seems to say that uvm_fault_wire() is
> called for each page being wired. Does it have sufficient state to
> check the limits and return an appropriate error code back to userland?

you need to pass down necessary states, of course.

> Or am I missing something to do with threads?  If we need to enforce
> per-process-rlimits against per-thread calls, then surely we must give
> those uvm operations serialized semantics across all threads in a
> process, no?

"multiple threads vs process global rlimit" has the same problem as
your "multiple processes vs system global limit".

YAMAMOTO Takashi