On 2/17/2023 3:19 AM, Matthew Wilcox wrote: > On Fri, Feb 17, 2023 at 12:05:28AM +0800, Yin Fengwei wrote: >> zero_user_folio_segments() has same function as zero_user_segments(). >> but take folio as parameter. Update folio_zero_segments(), >> folio_zero_segment() and folio_zero_range() to use it. > > If we were going to do something like this, then it should be > folio_zero_segments(), not zero_user_folio_segments(). > > But I don't understand the advantage to adding this right now. > We're adding a new function that does exactly the same thing > as zero_user_segments() for no real benefit that I can see. > > My plan was always to eventually kill off zero_user_segment() > zero_user_segments() and zero_user(), and then move the > implementation of zero_user_segments() to be the implementation > of folio_zero_segments(). But we still have ~100 calls to > those three functions, so we can't do that yet. > > > If you're looking for something to do, how about batching calls to > page_remove_rmap() in try_to_unmap_one()? That's a pretty hairy > function, but I think that you'll see similar gains to the ones > you saw with page_add_file_rmap() since it's manipulating the > same counters. Yes. I am trying to make some change base on folio to get to know about folio's API. Thanks a lot for the suggestion and I will check how to batched page_remove_rmap() in try_to_unmap_one(). Regards Yin, Fengwei