From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<linmiaohe@huawei.com>
Subject: [PATCH 2/5] mm/swap: remove unused local variable nr_shadows
Date: Tue, 18 May 2021 21:53:49 +0800 [thread overview]
Message-ID: <20210518135352.3705306-3-linmiaohe@huawei.com> (raw)
In-Reply-To: <20210518135352.3705306-1-linmiaohe@huawei.com>
Since commit 55c653b71e8c ("mm: stop accounting shadow entries"),
nr_shadows is not used anymore.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/swap_state.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/mm/swap_state.c b/mm/swap_state.c
index df5405384520..bab386c7b655 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -114,7 +114,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
SetPageSwapCache(page);
do {
- unsigned long nr_shadows = 0;
xas_lock_irq(&xas);
xas_create_range(&xas);
@@ -124,7 +123,6 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
VM_BUG_ON_PAGE(xas.xa_index != idx + i, page);
old = xas_load(&xas);
if (xa_is_value(old)) {
- nr_shadows++;
if (shadowp)
*shadowp = old;
}
@@ -260,7 +258,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
void *old;
for (;;) {
- unsigned long nr_shadows = 0;
swp_entry_t entry = swp_entry(type, curr);
struct address_space *address_space = swap_address_space(entry);
XA_STATE(xas, &address_space->i_pages, curr);
@@ -270,7 +267,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
if (!xa_is_value(old))
continue;
xas_store(&xas, NULL);
- nr_shadows++;
}
xa_unlock_irq(&address_space->i_pages);
--
2.23.0
next prev parent reply other threads:[~2021-05-18 13:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-18 13:53 [PATCH 0/5] Cleanups for swap Miaohe Lin
2021-05-18 13:53 ` [PATCH 1/5] mm/swapfile: move get_swap_page_of_type() under CONFIG_HIBERNATION Miaohe Lin
2021-05-18 13:53 ` Miaohe Lin [this message]
2021-05-18 14:37 ` [PATCH 2/5] mm/swap: remove unused local variable nr_shadows Matthew Wilcox
2021-05-19 1:37 ` Miaohe Lin
2021-05-18 13:53 ` [PATCH 3/5] mm/swap_slots.c: delete meaningless forward declarations Miaohe Lin
2021-05-18 13:53 ` [PATCH 4/5] mm/swap: remove unused global variable nr_swapper_spaces Miaohe Lin
2021-05-18 13:53 ` [PATCH 5/5] mm/swap: simplify the code of find_get_incore_page() Miaohe Lin
2021-05-18 14:33 ` Matthew Wilcox
2021-05-18 21:13 ` Andrew Morton
2021-05-18 21:34 ` Matthew Wilcox
2021-05-19 1:39 ` 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=20210518135352.3705306-3-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--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