lkml.org 
[lkml]   [2004]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] cpumask 5/10 rewrite cpumask.h - single bitmap based implementation
    > Where do we stand wrt pass-by-reference?

    I haven't found any place yet that I noticed this to be a problem.

    Of course it's not a problem in the internals of the cpumask
    implementation, because the very first layer of implementation, the
    #define's, converts pass by value to pass by reference (and adds the
    NR_CPUS where that helps). Then the bitmap ops in the next layer down
    convert right back to single word operations by value, in the usual
    NR_CPUS <= BITS_PER_LONG case, all within the scope of the compiler
    code-generator.

    If there was a place where it was important to pass a cpumask argument
    by reference for efficiency, then I would claim that this should be done
    by explicitly making the argument in question a (cpumask_t *) pointer,
    instead of a cpumask_t value. This is the usual technique when passing
    potentially large structures, when a local private copy is not needed.

    If further such a place was in generic kernel code, where the vast
    majority running on more reasonably sized hardware would object to
    such, either because of esthetics, or efficiency (wasting a pointer
    dereference) then ... cross that bridge when the water rises.

    Hopefully, localized solutions could be developed for such needs,
    without dragging back in all the complexity of the generalized
    variability we had before.

    --
    I won't rest till it's the best ...
    Programmer, Linux Scalability
    Paul Jackson <pj@sgi.com> 1.650.933.1373
    -
    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: 2005-03-22 14:03    [W:4.582 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site