sys_sched_yield fast path

From: Mike Kravetz (mkravetz@sequent.com)
Date: Fri Mar 09 2001 - 19:47:41 EST

  • Next message: Anton Blanchard: "[PATCH]: allow notsc option for buggy cpus"

    Any thoughts about adding a 'fast path' to the SMP code in
    sys_sched_yield. Why not compare nr_pending to smp_num_cpus
    before examining the aligned_data structures? Something like,

    if (nr_pending > smp_num_cpus)
            goto set_resched_now;

    Where set_resched_now is a label placed just before the code
    that sets the need_resched field of the current process.
    This would eliminate touching all the aligned_data cache lines
    in the case where nr_pending can never be decremented to zero.

    Also, would it make sense to stop decrementing nr_pending to
    prevent it from going negative? OR Is the reasoning that in
    these cases there is so much 'scheduling' activity that we
    should force the reschedule?

    -- 
    Mike Kravetz                                 mkravetz@sequent.com
    IBM Linux Technology Center
    -
    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/
    



    This archive was generated by hypermail 2b29 : Fri Mar 09 2001 - 19:59:37 EST