On Fri, Mar 25, 2022 at 09:34:08PM +0800, zhangfei.gao@xxxxxxxxxxx wrote: > > + iopt->iova_alignment = new_iova_alignment; > > + xa_store(&iopt->domains, iopt->next_domain_id, domain, GFP_KERNEL); > > + iopt->next_domain_id++; > Not understand here. > > Do we get the domain = xa_load(&iopt->domains, iopt->next_domain_id-1)? > Then how to get the domain if next_domain_id++. > For example, iopt_table_add_domain 3 times with 3 domains, > how to know which next_domain_id is the correct one. There is no "correct one" this is just a simple list of domains, the alorithms either need to pick any single domain or iterate over every domain. Basically this bit of code is building a vector with the operations 'push_back', 'front', 'erase' and 'for each' Jason