Messages in this thread |  | | From | Shakeel Butt <> | Date | Tue, 23 Feb 2021 08:39:51 -0800 | Subject | Re: [PATCH v2] memcg: charge before adding to swapcache on swapin |
| |
On Mon, Feb 22, 2021 at 9:55 PM Shakeel Butt <shakeelb@google.com> wrote: [snip] > --- 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; > +} > +
|  |