* [merged] mm-workingset-define-macro-workingset_shift.patch removed from -mm tree
@ 2021-07-06 19:18 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-06 19:18 UTC (permalink / raw)
To: hannes, linmiaohe, mm-commits
The patch titled
Subject: mm: workingset: define macro WORKINGSET_SHIFT
has been removed from the -mm tree. Its filename was
mm-workingset-define-macro-workingset_shift.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm: workingset: define macro WORKINGSET_SHIFT
The magic number 1 is used in several places in workingset.c. Define a
macro WORKINGSET_SHIFT for it to improve code readability.
Link: https://lkml.kernel.org/r/20210624122307.1759342-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/workingset.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- a/mm/workingset.c~mm-workingset-define-macro-workingset_shift
+++ a/mm/workingset.c
@@ -168,8 +168,10 @@
* refault distance will immediately activate the refaulting page.
*/
+#define WORKINGSET_SHIFT 1
#define EVICTION_SHIFT ((BITS_PER_LONG - BITS_PER_XA_VALUE) + \
- 1 + NODES_SHIFT + MEM_CGROUP_ID_SHIFT)
+ WORKINGSET_SHIFT + NODES_SHIFT + \
+ MEM_CGROUP_ID_SHIFT)
#define EVICTION_MASK (~0UL >> EVICTION_SHIFT)
/*
@@ -189,7 +191,7 @@ static void *pack_shadow(int memcgid, pg
eviction &= EVICTION_MASK;
eviction = (eviction << MEM_CGROUP_ID_SHIFT) | memcgid;
eviction = (eviction << NODES_SHIFT) | pgdat->node_id;
- eviction = (eviction << 1) | workingset;
+ eviction = (eviction << WORKINGSET_SHIFT) | workingset;
return xa_mk_value(eviction);
}
@@ -201,8 +203,8 @@ static void unpack_shadow(void *shadow,
int memcgid, nid;
bool workingset;
- workingset = entry & 1;
- entry >>= 1;
+ workingset = entry & ((1UL << WORKINGSET_SHIFT) - 1);
+ entry >>= WORKINGSET_SHIFT;
nid = entry & ((1UL << NODES_SHIFT) - 1);
entry >>= NODES_SHIFT;
memcgid = entry & ((1UL << MEM_CGROUP_ID_SHIFT) - 1);
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
mm-zsmallocc-combine-two-atomic-ops-in-zs_pool_dec_isolated.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-06 19:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 19:18 [merged] mm-workingset-define-macro-workingset_shift.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.