lkml.org 
[lkml]   [2008]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] RWSEM: Rewrite rwsem.c and rwsem-spinlock.c more simply.
    > i'm not sure what this means -- which of the transformations in that
    > patch is considered unsafe? here's a typical simplification:

    It is not unsafe, just generates slight worse code.

    current is inline assembler and the compiler doesn't know that it could
    cache it in a register because it is not marked pure
    for various reasons. That is why current is often cached explicitely
    in a local variable to tell the compiler that.

    Before you run off and do that everywhere: it is also not a large
    win, just a small one unless current is used very often.

    -Andi


    \
     
     \ /
      Last update: 2008-03-25 13:35    [W:4.117 / U:0.632 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site