By Jeremy Jones and Paul McWilliams.
Data sharing is one of the most powerful capabilities of Db2 for z/OS, allowing multiple Db2 members to share a single set of data while maintaining data integrity through a sophisticated global locking mechanism. Starting in function level 509, APAR PH69217 extends an existing algorithm improvement to dramatically reduce a specific class of locking overhead that can affect large page sets in data sharing environments.
Background: page P-locks and hash collisions
In a Db2 data sharing environment, global locks are negotiated between members through a Coupling Facility (CF) lock structure. The IRLM subsystem uses this lock structure as a global lookup table for lock availability. Each lock token—whether for a table, page, or row—is processed through a hash algorithm to determine its entry in the lookup table.
Hash collisions in this structure can represent two very different situations:
· Real contention — two members are genuinely competing to update the same data
· False contention — different data items hash to the same lookup table entry, causing unnecessary delays even though there is no actual conflict
False page P-lock contention is the second type. When page locks for unrelated data collide in the hash table, members must serialize on lock acquisition even though no real conflict exists. For large page sets, and particularly those with a large DSSIZE, this false contention can become a measurable source of overhead.
What PH69217 delivers in function level 509
In an earlier enhancement, Db2 13 introduced a new hash algorithm (page P-lock hash algorithm 2) specifically for partition-by-range table spaces with relative page numbering (PBR RPN) table spaces. That improved algorithm reduces the probability of hash collisions for that object type.
PH69217, available at function level 509, extends this improved hash algorithm to all UTS page sets that meet the following size criteria:
· DSSIZE greater than 64 GB with a 4 KB page size
· DSSIZE greater than 128 GB with an 8 KB page size
Note that larger page sizes (16 KB, 32 KB) are not listed because the reduced page count at those sizes keeps hash collision risk below the threshold where the improved algorithm is beneficial.
This coverage is intentionally broad. It includes user-created objects as well as catalog and directory objects. The catalog and directory inclusion is particularly relevant because those objects might grow substantially when you use the REORG TABLESPACE CONVERTUTS process available in function level 509 to convert catalog table spaces from deprecated non-UTS types to partition-by-growth universal table spaces (PBG UTS).
Activating the improvement for existing page sets
New page sets created after you activate function level 509 automatically use the improved hash algorithm, and no additional action is required.
For existing page sets that qualify under the size thresholds, the new algorithm takes effect after you reformat the page set. You can do this by running any of the following utilities on the page set after activating function level 509:
· REORG TABLESPACE
· REORG INDEX
· REBUILD INDEX
· LOAD REPLACE
However, running these utilities proactively across all qualifying page sets is not the recommended approach. False page P-lock contention is probabilistic — the improved algorithm reduces the likelihood of hash collisions, but it does not eliminate contention entirely, and not every qualifying page set will actually experience problematic false contention in your environment. The most practical approach is to monitor your data sharing environment and reformat specific objects when you observe elevated P-lock suspension rates or CF lock structure contention that points to a particular page set.
Planning considerations
When planning your approach, consider the following points:
Monitor before acting. Use your existing monitoring data — P-lock suspension rates, CF lock structure utilization, and IRLM statistics — to identify which specific page sets are experiencing false contention. Target those objects for reformatting rather than treating all qualifying page sets as candidates.
Sequence with catalog UTS conversion. If you are also converting catalog and directory table spaces to PBG UTS using the REORG TABLESPACE CONVERTUTS option (also available in function level 509), be aware that those converted page sets might grow beyond the size thresholds covered by PH69217. If you subsequently observe false contention on those objects, reformatting them will apply the improved hash algorithm.
Getting started
- Apply the PTF for APAR PH70028 (the function level 509 activation APAR) on each Db2 subsystem or data sharing member. This PTF prereqs the PTFs for PH69217 and all other required APARs, so applying it is sufficient to satisfy the prerequisites for this enhancement.
- Activate function level 509 using the -ACTIVATE FUNCTION LEVEL (V13R1M509) command.
- Monitor your data sharing environment for elevated P-lock suspension rates or CF lock structure contention. Use IRLM statistics and performance monitoring tools to identify specific page sets that are experiencing false contention.
- For page sets where false contention is observed, verify that they exceed the size thresholds (DSSIZE > 64 GB at 4 KB page size, or DSSIZE > 128 GB at 8 KB page size) by querying SYSIBM.SYSTABLESPACE and SYSIBM.SYSTABLESPACESTATS.
- Run REORG TABLESPACE, REORG INDEX, REBUILD INDEX, or LOAD REPLACE on the affected page sets to reformat them with the improved hash algorithm, then monitor to confirm the improvement.
For more information about function level 509 and all the enhancements it delivers, see V13R1M509 (function level 509) in the Db2 for z/OS documentation.
#Db2forz/OS