* [merged] mm-swap-use-memset-to-fill-the-swap_map-with-swap_has_cache.patch removed from -mm tree
@ 2020-12-15 23:17 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-12-15 23:17 UTC (permalink / raw)
To: hughd, linmiaohe, mm-commits
The patch titled
Subject: mm/swapfile.c: use memset to fill the swap_map with SWAP_HAS_CACHE
has been removed from the -mm tree. Its filename was
mm-swap-use-memset-to-fill-the-swap_map-with-swap_has_cache.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm/swapfile.c: use memset to fill the swap_map with SWAP_HAS_CACHE
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.
Link: https://lkml.kernel.org/r/20200921122224.7139-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/swapfile.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/mm/swapfile.c~mm-swap-use-memset-to-fill-the-swap_map-with-swap_has_cache
+++ a/mm/swapfile.c
@@ -975,8 +975,7 @@ static int swap_alloc_cluster(struct swa
{
unsigned long idx;
struct swap_cluster_info *ci;
- unsigned long offset, i;
- unsigned char *map;
+ unsigned long offset;
/*
* Should not even be attempting cluster allocations when huge
@@ -996,9 +995,7 @@ static int swap_alloc_cluster(struct swa
alloc_cluster(si, idx);
cluster_set_count_flag(ci, SWAPFILE_CLUSTER, CLUSTER_FLAG_HUGE);
- map = si->swap_map + offset;
- for (i = 0; i < SWAPFILE_CLUSTER; i++)
- map[i] = SWAP_HAS_CACHE;
+ memset(si->swap_map + offset, SWAP_HAS_CACHE, SWAPFILE_CLUSTER);
unlock_cluster(ci);
swap_range_alloc(si, offset, SWAPFILE_CLUSTER);
*slot = swp_entry(si->type, offset);
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-16 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 23:17 [merged] mm-swap-use-memset-to-fill-the-swap_map-with-swap_has_cache.patch removed from -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).