[PATCH 1/2] maple_tree: Fix status setup on restore to active
Wei Yang
richard.weiyang at gmail.com
Tue Jun 24 18:11:44 PDT 2025
On Tue, Jun 24, 2025 at 11:48:22AM -0400, Liam R. Howlett wrote:
>During the initial call with a maple state, an error status may be set
>before a valid node is populated into the maple state node. Subsequent
>calls with the maple state may restore the state into an active state
>with no node set. This was masked by the mas_walk() always resetting
>the status to ma_state and result in an extra walk in this rare
^^^
Nit
s/ma_state/ma_start/
>scenario.
>
>Don't restore the state to active unless there is a value in the structs
>node. This also allows mas_walk() to be fixed to use the active state
>without exposing an issue.
>
>User visible results are marginal performance improvements when an
>active state can be restored and used instead of rewalking the tree.
>
>Stable is not Cc'ed because the existing code is stable and the
>performance gains are not worth the risk.
>
>Link: https://lore.kernel.org/all/20250611011253.19515-1-richard.weiyang@gmail.com/
>Link: https://lore.kernel.org/all/20250407231354.11771-1-richard.weiyang@gmail.com/
>Link: https://lore.kernel.org/all/202506191556.6bfc7b93-lkp@intel.com/
>Fixes: a8091f039c1e ("maple_tree: add MAS_UNDERFLOW and MAS_OVERFLOW states")
>Reported-by: Wei Yang <richard.weiyang at gmail.com>
>Reported-by: kernel test robot <oliver.sang at intel.com>
>Closes: https://lore.kernel.org/oe-lkp/202506191556.6bfc7b93-lkp@intel.com
>Signed-off-by: Liam R. Howlett <Liam.Howlett at oracle.com>
Reviewed-by: Wei Yang <richard.weiyang at gmail.com>
--
Wei Yang
Help you, Help me
More information about the maple-tree
mailing list