Re: [PATCH v3 4/8] swap: Unify normal/huge code path in swap_page_trans_huge_swapped()

2018-07-19 Thread Huang, Ying
Christoph Hellwig writes: >> static inline bool cluster_is_huge(struct swap_cluster_info *info) >> { >> -return info->flags & CLUSTER_FLAG_HUGE; >> +if (IS_ENABLED(CONFIG_THP_SWAP)) >> +return info->flags & CLUSTER_FLAG_HUGE; >> +else >> +return false; > > Ni

Re: [PATCH v3 4/8] swap: Unify normal/huge code path in swap_page_trans_huge_swapped()

2018-07-19 Thread Christoph Hellwig
> static inline bool cluster_is_huge(struct swap_cluster_info *info) > { > - return info->flags & CLUSTER_FLAG_HUGE; > + if (IS_ENABLED(CONFIG_THP_SWAP)) > + return info->flags & CLUSTER_FLAG_HUGE; > + else > + return false; Nitpick: no need for an else after

[PATCH v3 4/8] swap: Unify normal/huge code path in swap_page_trans_huge_swapped()

2018-07-19 Thread Huang Ying
As suggested by Dave, we should unify the code path for normal and huge swap support if possible to avoid duplicated code, bugs, etc. and make it easier to review code. In this patch, the normal/huge code path in swap_page_trans_huge_swapped() is unified, the added and removed lines are same. And