lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/3] mm/swapfile.c: count won't be bigger than SWAP_MAP_MAX
Date
Wei Yang <richard.weiyang@gmail.com> writes:

> On Fri, May 01, 2020 at 03:48:53PM -0700, Andrew Morton wrote:
>>On Fri, 1 May 2020 01:52:59 +0000 Wei Yang <richard.weiyang@gmail.com> 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, (SWAP_MAP_MAX &
>>COUNT_CONTINUED) is zero. I guess it meant "|"?
>
> Oops, you are right. It should be (SWAP_MAP_MAX | COUNT_CONTINUED).
>
> Sorry for the confusion.
>
>>
>>Also, the return value documentation says we return EINVAL for migration
>>entries. Where's that happening, or is the comment out of date?
>>
>
> Not paid attention to this.
>
> Take look into the code, I don't find a relationship between the swap count
> and migration. Seems we just make a migration entry but not duplicate it.
> If my understanding is correct.

Per my understanding, one functionality of the error path is to catch
the behavior that shouldn't happen at all. For example, if
__swap_duplicate() is called for the migration entry because of some
race condition.

Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2020-05-06 10:23    [W:0.075 / U:1.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site