[lkml]   [2005]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 1/12]: MUTEX: Implement mutexes
    On Sat, Dec 17, 2005 at 10:30:41PM -0800, Linus Torvalds wrote:
    > An interrupt can never change the value without changing it back, except
    > for the old-fashioned use of "up()" as a completion (which I don't think
    > we do any more - we used to do it for IO completion a looong time ago).

    I doubt you can guarantee that statement, or has the kernel source
    been audited for this recently?

    However, the real consideration is stability - if a semaphore was
    used for a completion and it was merged, would it be found and
    fixed? Probably not, because it won't cause any problems on
    architectures where semaphores have atomic properties. Unless
    of course sparse can be extended to detect the use of unbalanced
    semaphores in interrupt contexts.

    > (Of course, maybe it's not worth it. It might not be a big performance
    > issue).

    Balancing the elimination of 4 instructions per semaphore operation,
    totalling about 4 to 6 cycles, vs stability I'd go for stability
    unless we can prove the above assertion via (eg) sparse.

    Russell King
    Linux kernel 2.6 ARM Linux -
    maintainer of: 2.6 Serial core
    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-12-18 10:29    [W:0.021 / U:41.524 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site