Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-19 Thread Justus Winter
Hello James :)

Quoting James Clarke (2015-07-15 22:20:57)
 I had a look today at what's happening, and it's that the *file*
 pager is trying to read from disk. Any thoughts?

There is another thing I forgot.  libpager is special, it has its own
demuxer (see libpager/demuxer.c) that writes requests into a queue,
and a pool of workers that process requests from said queue.

The thing is, when we inhibit the pager RPCs, we merely prevent new
ones from being enqueued, but we don't prevent the workers from
processing already enqueued requests.  So we indeed need to add
functions to inhibit and restart paging to libpager that know about
the queue.

Justus



Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-19 Thread James Clarke
Yeah, I tried inhibiting both buckets, but the paging RPCs still got through, 
so my guess was that libports's inhibit/resume methods weren't able to deal 
with libpager's own threads. The thing is I don't think we currently keep track 
of any reference to the main/worker threads, as pager_start_workers just takes 
a bucket and returns void. Is there a way we can instead make the main thread 
and/or workers able to block ports_inhibit_X_rpcs like normal RPC handlers and 
be cancelled etc? If possible I think that would be a cleaner solution.

James

 On 19 Jul 2015, at 13:50, Justus Winter 4win...@informatik.uni-hamburg.de 
 wrote:
 
 Hello James :)
 
 Quoting James Clarke (2015-07-15 22:20:57)
 I had a look today at what's happening, and it's that the *file*
 pager is trying to read from disk. Any thoughts?
 
 There is another thing I forgot.  libpager is special, it has its own
 demuxer (see libpager/demuxer.c) that writes requests into a queue,
 and a pool of workers that process requests from said queue.
 
 The thing is, when we inhibit the pager RPCs, we merely prevent new
 ones from being enqueued, but we don't prevent the workers from
 processing already enqueued requests.  So we indeed need to add
 functions to inhibit and restart paging to libpager that know about
 the queue.
 
 Justus



Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-19 Thread Richard Braun
On Sun, Jul 19, 2015 at 02:25:14PM +0100, James Clarke wrote:
 Yeah, I tried inhibiting both buckets, but the paging RPCs still got through, 
 so my guess was that libports's inhibit/resume methods weren't able to deal 
 with libpager's own threads. The thing is I don't think we currently keep 
 track of any reference to the main/worker threads, as pager_start_workers 
 just takes a bucket and returns void. Is there a way we can instead make the 
 main thread and/or workers able to block ports_inhibit_X_rpcs like normal RPC 
 handlers and be cancelled etc? If possible I think that would be a cleaner 
 solution.

To continue our discussion on IRC:

No, it would definitely not be a cleaner solution, just an ugly hack.
Since paging doesn't occur as part of an RPC, you just can't use RPC
stuff to manage it. I suggest building rwlock-based synrchonization
functions specific to the pager workers.

-- 
Richard Braun