Skip to contentSkip to conversation

mm: remove redundant assignment of entry

PATCH In review Wei Yang 4 participants 5 messages Jul 8, 2019 – Sep 17, 2019

Subsystems (2)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 mm: remove redundant assignment of entry

Since ptent will not be changed after previous assignment of entry, it is not necessary to do the assignment again.

---
 mm/memory.c | 1 -
 1 file changed, 1 deletion(-)
mm/memory.c +0 -1
index ddf20bd0c317..d108bb979a08 100644
@@ -1127,7 +1127,6 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
 		if (unlikely(details))
 			continue;
 
-		entry = pte_to_swp_entry(ptent);
 		if (!non_swap_entry(entry))
 			rss[MM_SWAPENTS]--;
 		else if (is_migration_entry(entry)) {
Signature · 1 line
2.17.1
#2 lore raw
In reply to Wei Yang
Quoted 3 lines · Wei Yang

Since ptent will not be changed after previous assignment of entry, it is not necessary to do the assignment again.

Sounds this one is lost in the time line :-)

Quoted 19 lines

---
mm/memory.c | 1 -

1 file changed, 1 deletion(-)
mm/memory.c +0 -1
index ddf20bd0c317..d108bb979a08 100644
@@ -1127,7 +1127,6 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
 		if (unlikely(details))
 			continue;
 
-		entry = pte_to_swp_entry(ptent);
 		if (!non_swap_entry(entry))
 			rss[MM_SWAPENTS]--;
 		else if (is_migration_entry(entry)) {
Signature · 1 line
2.17.1
Signature · 2 lines
Wei Yang
Help you, Help me
author
#4 lore raw
Quoted 10 lines · Will Deacon
Quoted 6 lines · Wei Yang
Quoted 3 lines · Wei Yang

Since ptent will not be changed after previous assignment of entry, it is not necessary to do the assignment again.

Sounds this one is lost in the time line :-)

Don't think so -- looks like it's in linux-next [1] via akpm to me.

Ah, thanks. I may miss some message.

Quoted 3 lines

Will

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=b47011719e5c05aa9dc78fe76a7e46075f422a45

Signature · 2 lines
Wei Yang
Help you, Help me