On Fri, Apr 22, 2022 at 02:20:59AM +0000, Wei Yang wrote: > Just like the function pagevec_add_and_need_flush does, we can abstract > a function mlock_add_and_need_flush to decide whether it is necessary to > drain mlock_pvec. > > No functional change is expected. > > Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> > CC: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> > CC: Hugh Dickins <hughd@xxxxxxxxxx> > --- > mm/mlock.c | 27 +++++++++++++++++++++------ > 1 file changed, 21 insertions(+), 6 deletions(-) This seems like a needless abstraction to me that makes understanding the code flow harder, not simpler.