* [merged mm-stable] mm-zswap-function-ordering-public-lru-api.patch removed from -mm tree
@ 2024-02-22 0:02 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-02-22 0:02 UTC (permalink / raw)
To: mm-commits, zhouchengming, yosryahmed, nphamcs, hannes, akpm
The quilt patch titled
Subject: mm: zswap: function ordering: public lru api
has been removed from the -mm tree. Its filename was
mm-zswap-function-ordering-public-lru-api.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Johannes Weiner <hannes@cmpxchg.org>
Subject: mm: zswap: function ordering: public lru api
Date: Mon, 29 Jan 2024 20:36:50 -0500
The zswap entry section sits awkwardly in the middle of LRU-related
functions. Group the external LRU API functions first.
Link: https://lkml.kernel.org/r/20240130014208.565554-15-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Cc: Chengming Zhou <zhouchengming@bytedance.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/zswap.c | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
--- a/mm/zswap.c~mm-zswap-function-ordering-public-lru-api
+++ a/mm/zswap.c
@@ -746,6 +746,10 @@ static int zswap_enabled_param_set(const
return ret;
}
+/*********************************
+* lru functions
+**********************************/
+
/* should be called under RCU */
#ifdef CONFIG_MEMCG
static inline struct mem_cgroup *mem_cgroup_from_entry(struct zswap_entry *entry)
@@ -764,6 +768,21 @@ static inline int entry_to_nid(struct zs
return page_to_nid(virt_to_page(entry));
}
+void zswap_lruvec_state_init(struct lruvec *lruvec)
+{
+ atomic_long_set(&lruvec->zswap_lruvec_state.nr_zswap_protected, 0);
+}
+
+void zswap_folio_swapin(struct folio *folio)
+{
+ struct lruvec *lruvec;
+
+ if (folio) {
+ lruvec = folio_lruvec(folio);
+ atomic_long_inc(&lruvec->zswap_lruvec_state.nr_zswap_protected);
+ }
+}
+
void zswap_memcg_offline_cleanup(struct mem_cgroup *memcg)
{
struct zswap_pool *pool;
@@ -799,23 +818,6 @@ static void zswap_entry_cache_free(struc
}
/*********************************
-* zswap lruvec functions
-**********************************/
-void zswap_lruvec_state_init(struct lruvec *lruvec)
-{
- atomic_long_set(&lruvec->zswap_lruvec_state.nr_zswap_protected, 0);
-}
-
-void zswap_folio_swapin(struct folio *folio)
-{
- struct lruvec *lruvec;
-
- VM_WARN_ON_ONCE(!folio_test_locked(folio));
- lruvec = folio_lruvec(folio);
- atomic_long_inc(&lruvec->zswap_lruvec_state.nr_zswap_protected);
-}
-
-/*********************************
* lru functions
**********************************/
static void zswap_lru_add(struct list_lru *list_lru, struct zswap_entry *entry)
_
Patches currently in -mm which might be from hannes@cmpxchg.org are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-22 0:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 0:02 [merged mm-stable] mm-zswap-function-ordering-public-lru-api.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.