/* Returns stocks cached in percpu to res_counter and reset cached information.  */
static void drain_stock(struct memcg_stock_pcp *stock)
/* Returns stocks cached in percpu to res_counter and reset cached information.  */
static void drain_stock(struct memcg_stock_pcp *stock)
{
	struct mem_cgroup *old = stock->cached;
	if (stock->charge) {
		res_counter_uncharge(&old->res, stock->charge);
		if (do_swap_account)
			res_counter_uncharge(&old->memsw, stock->charge);
	}
	stock->cached = NULL;
	stock->charge = 0;
}