Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Huang, Ying
Dave Hansen writes: > On 07/09/2018 11:53 PM, Huang, Ying wrote: >> Dave Hansen writes: +#ifdef CONFIG_THP_SWAP +static inline int cluster_swapcount(struct swap_cluster_info *ci) +{ + if (!ci || !cluster_is_huge(ci)) + return 0; + + return

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Huang, Ying
Dave Hansen writes: > On 07/09/2018 11:53 PM, Huang, Ying wrote: >> Dave Hansen writes: +#ifdef CONFIG_THP_SWAP +static inline int cluster_swapcount(struct swap_cluster_info *ci) +{ + if (!ci || !cluster_is_huge(ci)) + return 0; + + return

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Dave Hansen
On 07/09/2018 11:53 PM, Huang, Ying wrote: > Dave Hansen writes: >>> +#ifdef CONFIG_THP_SWAP >>> +static inline int cluster_swapcount(struct swap_cluster_info *ci) >>> +{ >>> + if (!ci || !cluster_is_huge(ci)) >>> + return 0; >>> + >>> + return cluster_count(ci) - SWAPFILE_CLUSTER;

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Dave Hansen
On 07/09/2018 11:53 PM, Huang, Ying wrote: > Dave Hansen writes: >>> +#ifdef CONFIG_THP_SWAP >>> +static inline int cluster_swapcount(struct swap_cluster_info *ci) >>> +{ >>> + if (!ci || !cluster_is_huge(ci)) >>> + return 0; >>> + >>> + return cluster_count(ci) - SWAPFILE_CLUSTER;

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Huang, Ying
Dave Hansen writes: >> +#ifdef CONFIG_THP_SWAP >> +static inline int cluster_swapcount(struct swap_cluster_info *ci) >> +{ >> +if (!ci || !cluster_is_huge(ci)) >> +return 0; >> + >> +return cluster_count(ci) - SWAPFILE_CLUSTER; >> +} >> +#else >> +#define

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-10 Thread Huang, Ying
Dave Hansen writes: >> +#ifdef CONFIG_THP_SWAP >> +static inline int cluster_swapcount(struct swap_cluster_info *ci) >> +{ >> +if (!ci || !cluster_is_huge(ci)) >> +return 0; >> + >> +return cluster_count(ci) - SWAPFILE_CLUSTER; >> +} >> +#else >> +#define

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-09 Thread Dave Hansen
> +#ifdef CONFIG_THP_SWAP > +static inline int cluster_swapcount(struct swap_cluster_info *ci) > +{ > + if (!ci || !cluster_is_huge(ci)) > + return 0; > + > + return cluster_count(ci) - SWAPFILE_CLUSTER; > +} > +#else > +#define cluster_swapcount(ci)0 >

Re: [PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-07-09 Thread Dave Hansen
> +#ifdef CONFIG_THP_SWAP > +static inline int cluster_swapcount(struct swap_cluster_info *ci) > +{ > + if (!ci || !cluster_is_huge(ci)) > + return 0; > + > + return cluster_count(ci) - SWAPFILE_CLUSTER; > +} > +#else > +#define cluster_swapcount(ci)0 >

[PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-06-21 Thread Huang, Ying
From: Huang Ying Previously, during swapout, all PMD page mapping will be split and replaced with PTE swap mapping. And when clearing the SWAP_HAS_CACHE flag for the huge swap cluster in swapcache_free_cluster(), the huge swap cluster will be split. Now, during swapout, the PMD page mapping

[PATCH -mm -v4 04/21] mm, THP, swap: Support PMD swap mapping in swapcache_free_cluster()

2018-06-21 Thread Huang, Ying
From: Huang Ying Previously, during swapout, all PMD page mapping will be split and replaced with PTE swap mapping. And when clearing the SWAP_HAS_CACHE flag for the huge swap cluster in swapcache_free_cluster(), the huge swap cluster will be split. Now, during swapout, the PMD page mapping