Thread (4 messages) 4 messages, 2 authors, 2021-02-23

Re: [PATCH v2] memcg: charge before adding to swapcache on swapin

From: Shakeel Butt <hidden>
Date: 2021-02-23 16:40:55
Also in: linux-mm, lkml

On Mon, Feb 22, 2021 at 9:55 PM Shakeel Butt [off-list ref] wrote:
[snip]
quoted hunk ↗ jump to hunk
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -596,6 +596,9 @@ static inline bool mem_cgroup_below_min(struct mem_cgroup *memcg)
 }

 int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask);
+int mem_cgroup_charge_swapin_page(struct page *page, struct mm_struct *mm,
+                                 gfp_t gfp, swp_entry_t entry);
+void mem_cgroup_finish_swapin_page(struct page *page, swp_entry_t entry);

 void mem_cgroup_uncharge(struct page *page);
 void mem_cgroup_uncharge_list(struct list_head *page_list);
@@ -1141,6 +1144,17 @@ static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
        return 0;
 }

+static inline int mem_cgroup_charge_swapin_page(struct page *page,
+                       struct mm_struct *mm, gfp_t gfp, swp_entry_t entry);
I didn't build-test the !CONFIG_MEMCG config and missed this
semicolon. Andrew, let me know if you want me to send a new version.
+{
+       return 0;
+}
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help