Re: [Patch v2] mm/swap_slots.c: assign|reset cache slot by value directly

From: Tim Chen
Date: Wed Mar 11 2020 - 12:10:48 EST


On 3/10/20 10:53 PM, Wei Yang wrote:
> Currently we use a tmp pointer, pentry, to transfer and reset swap cache
> slot, which is a little redundant. Swap cache slot stores the entry
> value directly, assign and reset it by value would be straight forward.
>
> Also this patch merges the else and if, since this is the only case we
> refill and repeat swap cache.
>
> Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxxxxxxxxxx>
> CC: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>

Acked-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>

>
> ---
> v2: keep the reset step after use, but remove the tmp pointer
> ---