On Thu, 25 Apr 2024 14:06:43 +0200 Florian Westphal <fw@xxxxxxxxx> wrote: > The existing code uses iter->type to figure out what data is needed, the > live copy (READ) or clone (UPDATE). > > Without pending updates, priv->clone and priv->match will point to > different memory locations, but they have identical content. > > Future patch will make priv->clone == NULL if there are no pending changes, > in this case we must copy the live data for the UPDATE case. > > Currently this would require GFP_ATOMIC allocation. Split the walk > function in two parts: one that does the walk and one that decides which > data is needed. > > In the UPDATE case, callers hold the transaction mutex so we do not need > the rcu read lock. This allows to use GFP_KERNEL allocation while > cloning. > > Signed-off-by: Florian Westphal <fw@xxxxxxxxx> Reviewed-by: Stefano Brivio <sbrivio@xxxxxxxxxx> -- Stefano