Re: [PATCH] mm: avoid possible multiple call to swap_node()

2020-09-17 Thread linmiaohe
Matthew Wilcox wrote: > On Thu, Sep 17, 2020 at 07:44:49AM -0400, Miaohe Lin wrote: >> Cache the swap_node() in a local variable to avoid possible multiple >> call to swap_node(), though compiler may do this for us. > >Why don't you find out? Compare the assembly before and after, see what the

Re: [PATCH] mm: avoid possible multiple call to swap_node()

2020-09-17 Thread Matthew Wilcox
On Thu, Sep 17, 2020 at 07:44:49AM -0400, Miaohe Lin wrote: > Cache the swap_node() in a local variable to avoid possible multiple call > to swap_node(), though compiler may do this for us. Why don't you find out? Compare the assembly before and after, see what the compiler did.