Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-08 Thread Wei Yang
On Fri, May 08, 2020 at 07:48:01AM +0800, Huang, Ying wrote: >Wei Yang writes: > >> On Wed, May 06, 2020 at 04:22:54PM +0800, Huang, Ying wrote: >>>Wei Yang writes: >>> On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: >On Fri, 1 May 2020 01:52:59 + Wei Yang

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-07 Thread Huang, Ying
Wei Yang writes: > On Wed, May 06, 2020 at 04:22:54PM +0800, Huang, Ying wrote: >>Wei Yang writes: >> >>> On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: On Fri, 1 May 2020 01:52:59 + Wei Yang wrote: > When the condition is true, there are two

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-07 Thread Wei Yang
On Wed, May 06, 2020 at 04:22:54PM +0800, Huang, Ying wrote: >Wei Yang writes: > >> On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: >>>On Fri, 1 May 2020 01:52:59 + Wei Yang >>>wrote: >>> When the condition is true, there are two possibilities: >>> >>>I'm struggling

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-06 Thread Huang, Ying
Wei Yang writes: > On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: >>On Fri, 1 May 2020 01:52:59 + Wei Yang wrote: >> >>> When the condition is true, there are two possibilities: >> >>I'm struggling with this one. >> >>>1. count == SWAP_MAP_BAD >>>2. count ==

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-02 Thread Wei Yang
On Sat, May 02, 2020 at 01:29:11PM +, Wei Yang wrote: >On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: >>On Fri, 1 May 2020 01:52:59 + Wei Yang wrote: >> >>> When the condition is true, there are two possibilities: >> >>I'm struggling with this one. >> >>>1. count ==

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-02 Thread Wei Yang
On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote: >On Fri, 1 May 2020 01:52:59 + Wei Yang wrote: > >> When the condition is true, there are two possibilities: > >I'm struggling with this one. > >>1. count == SWAP_MAP_BAD >>2. count == (SWAP_MAP_MAX & COUNT_CONTINUED) ==

Re: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-05-01 Thread Andrew Morton
On Fri, 1 May 2020 01:52:59 + Wei Yang wrote: > When the condition is true, there are two possibilities: I'm struggling with this one. >1. count == SWAP_MAP_BAD >2. count == (SWAP_MAP_MAX & COUNT_CONTINUED) == SWAP_MAP_SHMEM I'm not sure what 2. is trying to say. For a start,

[PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX

2020-04-30 Thread Wei Yang
When the condition is true, there are two possibilities: 1. count == SWAP_MAP_BAD 2. count == (SWAP_MAP_MAX & COUNT_CONTINUED) == SWAP_MAP_SHMEM The first case would be filtered by the first if in __swap_duplicate(). And the second case means this swap entry is for shmem. Since we never