Skip to contentSkip to conversation

mm/vmscan: remove prefetch_prev_lru_page

PATCH Applied Alex Shi 5 participants 8 messages Jan 14, 2020 – Jan 16, 2020

Subsystems (3)
lore
Share & tools
lore

Alex Shi

author
#0 lore raw

PATCH 1/1 mm/vmscan: remove prefetch_prev_lru_page

This macro are never used in git history. So better to remove.

---
 mm/vmscan.c | 14 --------------
 1 file changed, 14 deletions(-)
mm/vmscan.c +0 -14
index 4e699ed3501e..033e7145061b 100644
@@ -146,20 +146,6 @@ struct scan_control {
 	struct reclaim_state reclaim_state;
 };
 
-#ifdef ARCH_HAS_PREFETCH
-#define prefetch_prev_lru_page(_page, _base, _field)			\
-	do {								\
-		if ((_page)->lru.prev != _base) {			\
-			struct page *prev;				\
-									\
-			prev = lru_to_page(&(_page->lru));		\
-			prefetch(&prev->_field);			\
-		}							\
-	} while (0)
-#else
-#define prefetch_prev_lru_page(_page, _base, _field) do { } while (0)
-#endif
-
 #ifdef ARCH_HAS_PREFETCHW
 #define prefetchw_prev_lru_page(_page, _base, _field)			\
 	do {								\
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

author
#2 lore raw
Quoted 8 lines · Qian Cai
Quoted 5 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

Thanks fore reminder, Qian!

This macro was introduced in 1da177e4c3f4 Linux-2.6.12-rc2, no author or commiter could be found.

Thanks
Alex

#3 lore raw
Quoted 11 lines · Alex Shi



Quoted 5 lines · Qian Cai
Quoted 4 lines
Quoted 3 lines · Alex Shi
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

Thanks fore reminder, Qian!

This macro was introduced in 1da177e4c3f4 Linux-2.6.12-rc2, no author or commiter could be found.

Looks a bit deeper for this, and I am not sure if it is necessary to remove it especially this does not cause any complication warning noise, because the macro looks like a part of API design to have a pair of both read and write version, even though only the write version is used at the moment.

In theory, there could be users for the read version in the future, and then it needs to be added back.

maintainer
#4 lore raw
Quoted 16 lines · On Thu, 16 Jan 2020 07:26:23 -0500 Qian Cai <[email protected]> wrote:
Quoted 16 lines · Alex Shi



Quoted 9 lines · Qian Cai
Quoted 5 lines
Quoted 3 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

Quoted 7 lines
Quoted 3 lines

Thanks fore reminder, Qian!

This macro was introduced in 1da177e4c3f4 Linux-2.6.12-rc2, no author or commiter could be found.

Looks a bit deeper for this, and I am not sure if it is necessary to remove it especially this does not cause any complication warning noise, because the macro looks like a part of API design to have a pair of both read and write version, even though only the write version is used at the moment.

In theory, there could be users for the read version in the future, and then it needs to be added back.

Sure. A problem with leaving it in place is that this leads people to assume it is tested, which it presumably is not.

I don't think there's any particular downside either way, really. But it's presently cruft so I'm inclined to remove it. If someone has a need then they can add it back (presumbly reimplement it, actually) and test it then.

#5 lore raw
In reply to Alex Shi
Quoted 9 lines · Alex Shi
Quoted 5 lines · Qian Cai
Quoted 3 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

Thanks fore reminder, Qian!

This macro was introduced in 1da177e4c3f4 Linux-2.6.12-rc2, no author or commiter could be found.

FYI, seems it was introduced in commit 3aa1dc7725 [PATCH] multithread page reclaim in history tree.

Thanks,
Guoqing

#6 lore raw
In reply to Qian Cai
Quoted 7 lines · Qian Cai
Quoted 5 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

No, it isn't. It is at best nice to have, but for a trivial macro really doesn't matter.

#7 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Qian Cai
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines · Alex Shi

This macro are never used in git history. So better to remove.

When removing unused thingy, it is important to figure out which commit introduced it in the first place and Cc the relevant people in that commit.

No, it isn't. It is at best nice to have, but for a trivial macro really doesn't matter.

A more of personal taste what the trivial macro is. I’d rather be on the caution side when removing code especially nowaday developers may not even compile test the patch properly given how many arches we have here which will only waste time on other people when things goes wrong.