[lkml]   [2001]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] rw_semaphores, optimisations try #3

    On Mon, 23 Apr 2001, D.W.Howells wrote:
    > Linus, you suggested that the generic list handling stuff would be faster (2
    > unconditional stores) than mine (1 unconditional store and 1 conditional
    > store and branch to jump round it). You are both right and wrong. The generic
    > code does two stores per _process_ woken up (list_del) mine does the 1 or 2
    > stores per _batch_ of processes woken up. So the generic way is better when
    > the queue is an even mixture of readers or writers and my way is better when
    > there are far greater numbers of waiting readers. However, that said, there
    > is not much in it either way, so I've reverted it to the generic list stuff.

    Note that the generic list structure already has support for "batching".
    It only does it for multiple adds right now (see the "list_splice"
    merging code), but there is nothing to stop people from doing it for
    multiple deletions too. The code is something like

    static inline void list_remove_between(x,y)
    n->next = y;
    y->prev = x;

    and notice how it's still just two unconditional stores for _any_ number
    of deleted entries.

    Anyway, I've already applied your #2, how about a patch relative to that?


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:27    [W:0.040 / U:43.144 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site