lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRE: [RFC PATCH 5/5] locking/rwsem: Remove reader optimistic spinning
    Date
    From: Waiman Long
    > Sent: 19 November 2020 18:40
    ...
    > My own testing also show not too much performance difference when
    > removing reader spinning except in the lightly loaded cases.

    I'm confused.

    I got massive performance improvements from changing a driver
    we have to use mutex instead of the old semaphores (the driver
    was written a long time ago).

    While these weren't 'rw' the same issue will apply.

    The problem was that the semaphore/mutex was typically only held over
    a few instructions (eg to add an item to a list).
    But with semaphore if you got contention the process always slept.
    OTOH mutex spin 'for a while' before sleeping so the code rarely slept.

    So I really expect that readers need to spin (for a while) if
    a rwsem (etc) is locked for writing.

    Clearly you really need a CBU (Crystal Ball Unit) to work out
    whether to spin or not.

    David

    -
    Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
    Registration No: 1397386 (Wales)
    \
     
     \ /
      Last update: 2020-11-20 14:12    [W:4.243 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site