BjoKaSH / maczfs-archive

Legacy MacZFS - Archived here due Google-code shutdown. Automatically exported from code.google.com/p/maczfs -- Do Not Use! Use https://openzfsonosx.org/
Other
1 stars 0 forks source link

Commented out references to atomic_add_64 in arc.c #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There's a bunch of refs to atomci_add_64 in the arc.c that are commented out 
with an #ifndef 
__APPLE__. There doesn't appear to be a reason why we shouldn't use the 
built-in atomic add in 
this case. 

Original issue reported on code.google.com by alex.ble...@gmail.com on 20 Feb 2010 at 2:47

GoogleCodeExporter commented 9 years ago
There's an emulated OSAtomicAdd64 in zfs_context.c. This doesn't work on PPC 
systems, since the kernel runs in 32-bit mode (even if it's on a 64-bit PPC). 
However, there's relatively few of those left, and there's no point in having 
extra cruft around for the x86 platforms.

The emulated one does the low-end bits atomically, but the high-end bits may 
not be atomic for that platform. Putting in a mutex in The emulated layer would 
be a possible work around if that was deemed necessary.

This will have no effect on x86 or x86_64 platforms.

Fixed in 9b50db1e39762735494a18026961ef2f9cbfe1a9

Original comment by alex.ble...@gmail.com on 17 Jul 2010 at 9:34