lkml.org 
[lkml]   [2002]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] 2.5.21 - list.h cleanup

    > And while I'd like to avoid #include hell, I'm not willing to replace
    > inline functions with #define's to avoid it ;^p


    A more real example from blk.h:


    extern inline struct request *elv_next_request(request_queue_t *q)
    {
    struct request *rq;

    while ((rq = __elv_next_request(q))) {
    rq->flags |= REQ_STARTED;

    if (&rq->queuelist == q->last_merge)
    q->last_merge = NULL;

    if ((rq->flags & REQ_DONTPREP) || !q->prep_rq_fn)
    break;

    /*
    * all ok, break and return it
    */
    if (!q->prep_rq_fn(q, rq))
    break;

    /*
    * prep said no-go, kill it
    */
    blkdev_dequeue_request(rq);
    if (end_that_request_first(rq, 0, rq->nr_sectors))
    BUG();

    end_that_request_last(rq);
    }

    return rq;
    }

    The only thing this achvies is kernel bload, since
    elv_next_request is:

    1. Calling tons of functions, which could be inlined as well.

    2. Not precisely on any ultra fast path.

    3. Bound by the device speed.

    4. Increasing the pressure on branch prediction due
    to the while construct.

    -
    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 13:26    [W:0.025 / U:123.212 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site