DragonFly kernel List (threaded) for 2008-01
DragonFly BSD
DragonFly kernel List (threaded) for 2008-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

should we use atomic instructions to manipulate vmstats.v_wire_count?


From: Rick Macklem <rick@xxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 Jan 2008 10:30:26 -0500 (EST)

> I noticed that vmstats.v_wire_count is incremented and decremented w/o
> protection.  In contrast, atomic instructions (from <atomic.h>) are
> used in freebsd.
> 
> Is it a bug in dfly or is it intentional?

If it is just stats and not used for anything else (I have no idea if this
is the case, just going by the name), why bother. Without SMP protection
there is a miniscule likelyhood the value will be out by one, but if that
doesn't break any code, is it worth the overhead of SMP locking just to
ensure that?

In my NFS code, I've used a macro so the adopters can decide if the
overhead is worth it. (Personally, I don't think so, but??)

rick



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]