Skip to contentSkip to conversation

mm: optimize lru_note_cost() by adding lru_note_cost_unlock_irq() fix

PATCH New Hugh Dickins 1 participant 1 message Jul 15, 2025 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: optimize lru_note_cost() by adding lru_note_cost_unlock_irq() fix

Delete the comment from above the deleted spin_lock_irq(): it was all to justify the first iteration's spin_lock_irq(), none suitable for moving down to where the parent's spin_lock_irq() is now done.

---
Thank you all for the warm reception! Sorry, I missed this deletion.

 mm/swap.c | 7 -------
 1 file changed, 7 deletions(-)
mm/swap.c +0 -7
index 37053f222a6e..3632dd061beb 100644
@@ -259,13 +259,6 @@ void lru_note_cost_unlock_irq(struct lruvec *lruvec, bool file,
 	for (;;) {
 		unsigned long lrusize;
 
-		/*
-		 * Hold lruvec->lru_lock is safe here, since
-		 * 1) The pinned lruvec in reclaim, or
-		 * 2) From a pre-LRU page during refault (which also holds the
-		 *    rcu lock, so would be safe even if the page was on the LRU
-		 *    and could move simultaneously to a new lruvec).
-		 */
 		/* Record cost event */
 		if (file)
 			lruvec->file_cost += cost;
Signature · 1 line
2.43.0