@@ -599,12 +599,14 @@ static inline unsigned int rds_ib_flush_goal(struct rds_ib_mr_pool *pool, int fr
599
599
/*
600
600
* given an xlist of mrs, put them all into the list_head for more processing
601
601
*/
602
- static void xlist_append_to_list (struct xlist_head * xlist , struct list_head * list )
602
+ static int xlist_append_to_list (struct xlist_head * xlist ,
603
+ struct list_head * list )
603
604
{
604
605
struct rds_ib_mr * ibmr ;
605
606
struct xlist_head splice ;
606
607
struct xlist_head * cur ;
607
608
struct xlist_head * next ;
609
+ int count = 0 ;
608
610
609
611
splice .next = NULL ;
610
612
xlist_splice (xlist , & splice );
@@ -614,7 +616,9 @@ static void xlist_append_to_list(struct xlist_head *xlist, struct list_head *lis
614
616
ibmr = list_entry (cur , struct rds_ib_mr , xlist );
615
617
list_add_tail (& ibmr -> unmap_list , list );
616
618
cur = next ;
619
+ count ++ ;
617
620
}
621
+ return count ;
618
622
}
619
623
620
624
/*
@@ -654,7 +658,7 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
654
658
LIST_HEAD (unmap_list );
655
659
LIST_HEAD (fmr_list );
656
660
unsigned long unpinned = 0 ;
657
- unsigned int nfreed = 0 , ncleaned = 0 , free_goal ;
661
+ unsigned int nfreed = 0 , dirty_to_clean = 0 , free_goal ;
658
662
int ret = 0 ;
659
663
660
664
if (pool -> pool_type == RDS_IB_MR_8K_POOL )
@@ -699,8 +703,8 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
699
703
/* Get the list of all MRs to be dropped. Ordering matters -
700
704
* we want to put drop_list ahead of free_list.
701
705
*/
702
- xlist_append_to_list (& pool -> drop_list , & unmap_list );
703
- xlist_append_to_list (& pool -> free_list , & unmap_list );
706
+ dirty_to_clean = xlist_append_to_list (& pool -> drop_list , & unmap_list );
707
+ dirty_to_clean += xlist_append_to_list (& pool -> free_list , & unmap_list );
704
708
if (free_all )
705
709
xlist_append_to_list (& pool -> clean_list , & unmap_list );
706
710
@@ -731,7 +735,6 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
731
735
kfree (ibmr );
732
736
nfreed ++ ;
733
737
}
734
- ncleaned ++ ;
735
738
}
736
739
737
740
if (!list_empty (& unmap_list )) {
@@ -757,7 +760,7 @@ static int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool,
757
760
}
758
761
759
762
atomic_sub (unpinned , & pool -> free_pinned );
760
- atomic_sub (ncleaned , & pool -> dirty_count );
763
+ atomic_sub (dirty_to_clean , & pool -> dirty_count );
761
764
atomic_sub (nfreed , & pool -> item_count );
762
765
763
766
out :
0 commit comments