From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <hughd@google.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<linmiaohe@huawei.com>
Subject: [PATCH 3/4] ksm: remove dedicated macro KSM_FLAG_MASK
Date: Tue, 30 Mar 2021 10:02:27 -0400 [thread overview]
Message-ID: <20210330140228.45635-4-linmiaohe@huawei.com> (raw)
In-Reply-To: <20210330140228.45635-1-linmiaohe@huawei.com>
The macro KSM_FLAG_MASK is used in rmap_walk_ksm() only. So we can replace
~KSM_FLAG_MASK with PAGE_MASK to remove this dedicated macro and make code
more consistent because PAGE_MASK is used elsewhere in this file.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/ksm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/ksm.c b/mm/ksm.c
index 5650a282da3e..f9ca6d94bf7f 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -215,8 +215,6 @@ struct rmap_item {
#define SEQNR_MASK 0x0ff /* low bits of unstable tree seqnr */
#define UNSTABLE_FLAG 0x100 /* is a node of the unstable tree */
#define STABLE_FLAG 0x200 /* is listed from the stable tree */
-#define KSM_FLAG_MASK (SEQNR_MASK|UNSTABLE_FLAG|STABLE_FLAG)
- /* to mask all the flags */
/* The stable and unstable tree heads */
static struct rb_root one_stable_tree[1] = { RB_ROOT };
@@ -2631,7 +2629,7 @@ void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc)
vma = vmac->vma;
/* Ignore the stable/unstable/sqnr flags */
- addr = rmap_item->address & ~KSM_FLAG_MASK;
+ addr = rmap_item->address & PAGE_MASK;
if (addr < vma->vm_start || addr >= vma->vm_end)
continue;
--
2.19.1
next prev parent reply other threads:[~2021-03-30 14:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 14:02 [PATCH 0/4] Cleanup and fixup for ksm Miaohe Lin
2021-03-30 14:02 ` [PATCH 1/4] ksm: remove redundant VM_BUG_ON_PAGE() on stable_tree_search() Miaohe Lin
2021-03-30 14:02 ` [PATCH 2/4] ksm: use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree() Miaohe Lin
2021-03-30 14:02 ` Miaohe Lin [this message]
2021-03-30 14:02 ` [PATCH 4/4] ksm: fix potential missing rmap_item for stable_node Miaohe Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210330140228.45635-4-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®