Got it. Thanks a lot for your help. Zhu Yanjun On Sun, Mar 21, 2021 at 11:52 PM Jason Gunthorpe <jgg@xxxxxxxxxx> wrote: > > On Sun, Mar 21, 2021 at 10:38:45PM +0800, Zhu Yanjun wrote: > > > No. You suppose n_pages is very big, then prv->length will increase to > > reach max_segment. > > If n_pages is very small, for example, we suppose n_pages is 1, then > > prv->length will > > not reach max_segment. > > > > In fact, in my test case, n_pages is very small. > > n_pages is an *input* it is the number of pages in the VA range, if it > is very small it is not a problem with this algorithm > > Jason