Project

General

Profile

Bug #5817

change type of arcs_size from uint64_t to refcount_t

Added by Matthew Ahrens over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
zfs - Zettabyte File System
Start date:
2015-04-09
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

As a way to make it more difficult to introduce bugs into the ARC, and to make it easier to diagnose issues when bugs do creep in, it would be beneficial to change the type of the arc_state_t's arcs_size field to be a refcount_t instead of a uint64_t. This would allow us to make stricter checks when incrementing and decrementing the value with debugging enabled, but still fallback to simple, fast atomic operations when debugging is disabled.

This patch changes the type for arcs_size within the arc_state_t
structure from a uint64_t to a refcount_t. This will allows stricter
checks to occur when incrementing and decrementing the size (on DEBUG
builds), and hopefully allow us to track down regressions more quickly.
On non-DEBUG builds, this should not have an impact to performance
since the refcount_t operations devolve into simple atomic operations
(i.e. the same as what we're doing now).

Some future work remains to convert the arcs_lsize field within the
arc_state_t to use refcount_t's as well.

History

#1

Updated by Electric Monk over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 2fd872a734cf486007a8dba532cec52bfb4d40e5

commit  2fd872a734cf486007a8dba532cec52bfb4d40e5
Author: Prakash Surya <prakash.surya@delphix.com>
Date:   2015-04-11T18:36:27.000Z

    5817 change type of arcs_size from uint64_t to refcount_t
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
    Reviewed by: Adam Leventhal <ahl@delphix.com>
    Reviewed by: Alex Reece <alex@delphix.com>
    Reviewed by: Richard Elling <richard.elling@richardelling.com>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF