lkml.org 
[lkml]   [2007]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] Thread Migration Preemption
    On Fri, Jul 06, 2007 at 04:12:10PM +1000, Nick Piggin wrote:
    > Mathieu Desnoyers wrote:
    > >Thread Migration Preemption
    > >
    > >This patch adds the ability to protect critical sections from migration to
    > >another CPU without disabling preemption.
    > >
    > >This will be useful to minimize the amount of preemption disabling for the
    > >-rt
    > >patch. It will help leveraging improvements brought by the local_t types in
    > >asm/local.h (see Documentation/local_ops.txt). Note that the updates done
    > >to
    > >variables protected by migration_disable must be either atomic or
    > >protected from
    > >concurrent updates done by other threads.
    > >
    > >Typical use:
    > >
    > >migration_disable();
    > >local_inc(&__get_cpu_var(&my_local_t_var));
    > >migration_enable();
    > >
    > >Which will increment the variable atomically wrt the local CPU.
    > >
    > >Comments (such as how to integrate this in the already almost full
    > >preempt_count) are welcome.
    >
    > This seems like way too much stuff to add just for this type of thing. Why
    > not just disable and reenable preempt? Surely local_inc is not going to take
    > so long that disabling preemption matters.

    I like this patch a lot. Even if we don't add the underlying mechanism
    right now, adding migration_disable as an alias for preempt_disable
    will much better document quite a number of the users.

    > The task struct is not something we should just be carefree putting crap
    > into because it is seemingly free :(

    Sadly, it is free at the moment. We can only fit 3 task_structs in an order-1 SLAB,
    with lots of slop.

    --
    Mathematics is the supreme nostalgia of our time.
    -
    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-11 01:43    [W:0.025 / U:0.112 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site