lkml.org 
[lkml]   [2007]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/1] hotplug cpu: migrate a task within its cpuset
    On 08/24, Cliff Wickman wrote:
    > --- linus.070821.orig/kernel/cpuset.c
    > +++ linus.070821/kernel/cpuset.c
    > @@ -2333,6 +2333,25 @@ cpumask_t cpuset_cpus_allowed(struct tas
    > return mask;
    > }
    >
    > +/**
    > + * cpuset_cpus_allowed_lock - return cpus_allowed mask from a tasks cpuset.
    > + * @tsk: pointer to task_struct from which to obtain cpuset->cpus_allowed.
    > + *
    > + * Description: Same as cpuset_cpus_allowed, but called with callback_mutex
    > + * already held.
    > + **/
    > +
    > +cpumask_t cpuset_cpus_allowed_lock(struct task_struct *tsk)
    > +{
    > + cpumask_t mask;
    > +
    > + task_lock(tsk);
    > + guarantee_online_cpus(tsk->cpuset, &mask);
    > + task_unlock(tsk);
    > +
    > + return mask;
    > +}

    Very minor nit, perhaps it makes sense to use this function in cpuset_cpus_allowed()
    to avoid the code duplication. Its name is a bit confusing, imho. How about
    cpuset_cpus_allowed_locked() or __cpuset_cpus_allowed() ?

    Oleg.

    -
    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-08-25 11:59    [W:0.021 / U:0.268 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site