]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/list_lru: remove list_lru_putback()
authorChengming Zhou <zhouchengming@bytedance.com>
Sun, 28 Jan 2024 13:28:51 +0000 (13:28 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:42 +0000 (10:24 -0800)
Since the only user zswap_lru_putback() has gone, remove
list_lru_putback() too.

Link: https://lkml.kernel.org/r/20240126-zswap-writeback-race-v2-3-b10479847099@bytedance.com
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Acked-by: Yosry Ahmed <yosryahmed@google.com>
Cc: Chris Li <chriscli@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/list_lru.h
mm/list_lru.c
mm/zswap.c

index c679e6b293c4c49b67ca33a4fc9568c7bb67c3e2..f2882a82069027649a8228f3288335223a1fa02f 100644 (file)
@@ -168,22 +168,6 @@ static inline unsigned long list_lru_count(struct list_lru *lru)
 void list_lru_isolate(struct list_lru_one *list, struct list_head *item);
 void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
                           struct list_head *head);
-/**
- * list_lru_putback: undo list_lru_isolate
- * @lru: the lru pointer.
- * @item: the item to put back.
- * @nid: the node id of the sublist to put the item back to.
- * @memcg: the cgroup of the sublist to put the item back to.
- *
- * Put back an isolated item into its original LRU. Note that unlike
- * list_lru_add, this does not increment the node LRU count (as
- * list_lru_isolate does not originally decrement this count).
- *
- * Since we might have dropped the LRU lock in between, recompute list_lru_one
- * from the node's id and memcg.
- */
-void list_lru_putback(struct list_lru *lru, struct list_head *item, int nid,
-                     struct mem_cgroup *memcg);
 
 typedef enum lru_status (*list_lru_walk_cb)(struct list_head *item,
                struct list_lru_one *list, spinlock_t *lock, void *cb_arg);
index 158781d1d3c215d3fdbe7a4586f6c48e5fa880bf..61f3b6b1134fbe6bda2753dd809d2823f85ad309 100644 (file)
@@ -162,20 +162,6 @@ void list_lru_isolate_move(struct list_lru_one *list, struct list_head *item,
 }
 EXPORT_SYMBOL_GPL(list_lru_isolate_move);
 
-void list_lru_putback(struct list_lru *lru, struct list_head *item, int nid,
-                     struct mem_cgroup *memcg)
-{
-       struct list_lru_one *list =
-               list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg));
-
-       if (list_empty(item)) {
-               list_add_tail(item, &list->list);
-               if (!list->nr_items++)
-                       set_shrinker_bit(memcg, nid, lru_shrinker_id(lru));
-       }
-}
-EXPORT_SYMBOL_GPL(list_lru_putback);
-
 unsigned long list_lru_count_one(struct list_lru *lru,
                                 int nid, struct mem_cgroup *memcg)
 {
index ddc8f930d3434e0e600782ae15e5797b0cec6784..2d7f594e6d07fa11f9259b277c93e5d1d94dbf24 100644 (file)
@@ -410,7 +410,7 @@ static void zswap_lru_add(struct list_lru *list_lru, struct zswap_entry *entry)
         * 2. list_lru_add() is called after memcg->kmemcg_id is updated. The
         *    new entry will be added directly to memcg's parent's list_lru.
         *
-        * Similar reasoning holds for list_lru_del() and list_lru_putback().
+        * Similar reasoning holds for list_lru_del().
         */
        rcu_read_lock();
        memcg = mem_cgroup_from_entry(entry);