[<prev] [next>] [day] [month] [year] [list]
Message-ID: <16636ab4ebb746b4ba0a14eec8225cbc@huawei.com>
Date: Mon, 26 Oct 2020 03:03:10 +0000
From: linmiaohe <linmiaohe@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH] mm: swap: Use memset to fill the swap_map with
SWAP_HAS_CACHE
Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Mon, 21 Sep 2020 08:22:24 -0400 Miaohe Lin <linmiaohe@...wei.com> wrote:
>
>> We could use helper memset to fill the swap_map with SWAP_HAS_CACHE
>> instead of a direct loop here to simplify the code. Also we can remove
>> the local variable i and map this way.
>> *slot = swp_entry(si->type, offset);
>
>I suppose so. But it does assume that the ->swapmap array has the type char. If we ever change that, breakage will ensue.
>
The origin code already assumes that the ->swap_map array has the type char. So, this change is ok. ;)
And if we change the type of ->swap_map, each place uses the swap_map should be fixed accordingly.;(
Many thanks.
Powered by blists - more mailing lists