lkml.org 
[lkml]   [2007]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: lguest, Re: -mm merge plans for 2.6.23
    From
    Date
    On Wed, 2007-07-11 at 19:28 -0700, David Miller wrote:
    > From: Rusty Russell <rusty@rustcorp.com.au>
    > Date: Thu, 12 Jul 2007 11:21:51 +1000
    >
    > > To do inter-guest (ie. inter-process) I/O you really have to make sure
    > > the other side doesn't go away.
    >
    > You should just let it exit and when it does you receive some kind of
    > exit notification that resets your virtual device channel.
    >
    > I think the reference counting approach is error and deadlock prone.
    > Be more loose and let the events reset the virtual devices when
    > guests go splat.

    There are two places where we grab task refcnt. One might be avoidable
    (will test and get back) but the deferred wakeup isn't really:

    /* We cache one process to wakeup: helps for batching & wakes outside locks. */
    void set_wakeup_process(struct lguest *lg, struct task_struct *p)
    {
    if (p == lg->wake)
    return;

    if (lg->wake) {
    wake_up_process(lg->wake);
    put_task_struct(lg->wake);
    }
    lg->wake = p;
    if (lg->wake)
    get_task_struct(lg->wake);
    }

    We drop the lock after I/O, and then do this wakeup. Meanwhile the
    other task might have exited.

    I could get rid of it, but I don't think there's anything wrong with the
    code...

    Cheers,
    Rusty.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-07-12 04:51    [W:0.027 / U:30.752 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site