Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11
-
None
Description
FSP_EXTENT_SIZE is not a compile-time constant. It expands to a runtime branch
on the global srv_page_size_shift:
#define FSP_EXTENT_SIZE (srv_page_size_shift < 14 ? \
|
(1048576U >> srv_page_size_shift) : 64U)
|
It is re-evaluated many times on hot extent-management paths,
including inside xdes_get_n_used() (loop bound over the descriptor
bitmap) and xdes_is_full() (which compares against it), as well as
in the surrounding callers via XDES_SIZE /
xdes_calc_descriptor_index() and hint % FSP_EXTENT_SIZE.
In fsp_traverse_extents() the page descriptor of each extent is
examined in a loop, and FSP_EXTENT_SIZE is evaluated multiple times
per iteration (in XDES_SIZE, in xdes_calc_descriptor_index(), and
again inside xdes_get_n_used()).
Most callers of xdes_get_n_used() and xdes_is_full() already compute
FSP_EXTENT_SIZE for other reasons (e.g. hint % FSP_EXTENT_SIZE,
descriptor index arithmetic), so the value is readily available at
the call site.