Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-10-01 Thread Daniel Jordan
On Sat, Sep 29, 2018 at 08:50:29AM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > The error handling in __swap_duplicate (before this series) still leaves > > something to be desired IMHO. Why all the different returns when callers > > ignore them or only specifically check for -ENOMEM or

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-28 Thread Huang, Ying
Daniel Jordan writes: > On Fri, Sep 28, 2018 at 04:19:03PM +0800, Huang, Ying wrote: >> Daniel Jordan writes: >> > One way is to change >> > copy_one_pte's return to int so we can just pass the error code back to >> > copy_pte_range so it knows whether to try adding the continuation. >> >> Ther

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-28 Thread Daniel Jordan
On Fri, Sep 28, 2018 at 04:19:03PM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > One way is to change > > copy_one_pte's return to int so we can just pass the error code back to > > copy_pte_range so it knows whether to try adding the continuation. > > There may be even more problems. Af

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-28 Thread Huang, Ying
Daniel Jordan writes: > On Thu, Sep 27, 2018 at 09:34:36AM +0800, Huang, Ying wrote: >> Daniel Jordan writes: >> > On Wed, Sep 26, 2018 at 08:55:59PM +0800, Huang, Ying wrote: >> >> Daniel Jordan writes: >> >> > On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: >> >> >> /* >> >> >>

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-27 Thread Daniel Jordan
On Thu, Sep 27, 2018 at 09:34:36AM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > On Wed, Sep 26, 2018 at 08:55:59PM +0800, Huang, Ying wrote: > >> Daniel Jordan writes: > >> > On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: > >> >> /* > >> >> * Increase reference count of s

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-26 Thread Huang, Ying
Daniel Jordan writes: > On Wed, Sep 26, 2018 at 08:55:59PM +0800, Huang, Ying wrote: >> Daniel Jordan writes: >> > On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: >> >> /* >> >> * Increase reference count of swap entry by 1. >> >> - * Returns 0 for success, or -ENOMEM if a swap_co

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-26 Thread Daniel Jordan
On Wed, Sep 26, 2018 at 08:55:59PM +0800, Huang, Ying wrote: > Daniel Jordan writes: > > On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: > >> /* > >> * Increase reference count of swap entry by 1. > >> - * Returns 0 for success, or -ENOMEM if a swap_count_continuation is > >> requi

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-26 Thread Huang, Ying
Daniel Jordan writes: > On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: >> @@ -3487,35 +3521,66 @@ static int __swap_duplicate_locked(struct >> swap_info_struct *p, >> } >> >> /* >> - * Verify that a swap entry is valid and increment its swap map count. >> + * Verify that the swa

Re: [PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-25 Thread Daniel Jordan
On Tue, Sep 25, 2018 at 03:13:30PM +0800, Huang Ying wrote: > @@ -3487,35 +3521,66 @@ static int __swap_duplicate_locked(struct > swap_info_struct *p, > } > > /* > - * Verify that a swap entry is valid and increment its swap map count. > + * Verify that the swap entries from *entry is valid an

[PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-25 Thread Huang Ying
To support to swapin the THP in one piece, we need to create PMD swap mapping during swapout, and maintain PMD swap mapping count. This patch implements the support to increase the PMD swap mapping count (for swapout, fork, etc.) and set SWAP_HAS_CACHE flag (for swapin, etc.) for a huge swap clus

[PATCH -V5 RESEND 03/21] swap: Support PMD swap mapping in swap_duplicate()

2018-09-11 Thread Huang Ying
To support to swapin the THP in one piece, we need to create PMD swap mapping during swapout, and maintain PMD swap mapping count. This patch implements the support to increase the PMD swap mapping count (for swapout, fork, etc.) and set SWAP_HAS_CACHE flag (for swapin, etc.) for a huge swap clus