--- In "naturalwatt" <> wrote:
>
> Hi Jesse.
>
> So I was right but for the wrong reason. I thought there was a risk that
> stuff might get paged out. I had forgotten about demand paging in.
>
> Would it be safe to move reservemem out of sbus_lock and call it once during
> program initialisation? That would ensure that every page has been paged in.
>
reservemem() is only called once. At the first sbuslock() call before it
acquires the semaphore.
>
> Is there any way that pages would get actually paged during the execution of
> a program running in the default Debian distribution (no swap configured)?
Yes. When memory pressure is high the kernel will drop file-backed pages first
such that pages that have loaded will get dropped again. The mlockall() call
in reservemem() defeats this.
> However it strikes me that every program that is running needs to have all
> its pages loaded.
>
> Scenario:
>
> * process 1 call sbus_lock
> * kernel switches to process 2
> * process 2 needs to demand-page or do anything with sbus
>
> Deadlock.
No. Continuing on from above scenario:
* process 2 is put to sleep pending NBD IO completion.
* sdctl (NBD server) becomes runnable, gets IO req on socket.
* sdctl attempts to acquire sbus lock and is put to sleep.
* kernel switches back to process 1
* process 1 eventually releases lock from sbuspreempt()/sbusunlock()
* sdctl (NBD server) acquires the sbuslock
* sdctl satisfys demand-page for process 2 and releases sbus lock
* process 2 wakes up and continues as normal.
//Jesse Off
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|