lkml.org 
[lkml]   [2006]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: light weight counters: race free through local_t?
Given what you just said it seems that an atomic op is better than first 
reading the cacheline and then incrementing a value in it right? Because
if we first read then we acquire the cacheline in shared more. Later when
we write to it we have to acquire it again in exclusive mode. The fetchadd
would acquire the cacheline immediately in exclusive mode and thus save
the acquisition in shared mode.

> Yes, it is a one-direction barrier.
> However, if there is not too many stuff in the OzQ, it has not too much
> impact.

It serializes prior accesses and has a simiar effect as an unlock
operation. The processor cannot freely reorder instructions around the
increment. That must have some sort of an impact on performance.

> I still prefer the atomic operations.

Noted. Andi: It seems that we can fall back on ia64 to an atomic
operation without concern for performance.

-
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/

\
 
 \ /
  Last update: 2006-06-15 20:17    [W:0.037 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site