@@ -7297,6 +7297,9 @@ void mem_cgroup_uncharge_swap(swp_entry_
struct mem_cgroup *memcg;
unsigned short id;
+ if (mem_cgroup_disabled())
+ return;
+
id = swap_cgroup_record(entry, 0, nr_pages);
rcu_read_lock();
memcg = mem_cgroup_from_id(id);
@@ -3784,6 +3784,9 @@ void cgroup_throttle_swaprate(struct pag
struct swap_info_struct *si, *next;
int nid = page_to_nid(page);
+ if (mem_cgroup_disabled())
+ return;
+
if (!(gfp_mask & __GFP_IO))
return;
@@ -240,7 +240,12 @@ static void vmpressure_work_fn(struct wo
void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
unsigned long scanned, unsigned long reclaimed)
{
- struct vmpressure *vmpr = memcg_to_vmpressure(memcg);
+ struct vmpressure *vmpr;
+
+ if (mem_cgroup_disabled())
+ return;
+
+ vmpr = memcg_to_vmpressure(memcg);
/*
* Here we only want to account pressure that userland is able to