Re: [PATCH v5 05/10] mm/swap: charge the page when adding to the swap cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri,  3 Apr 2020 14:40:43 +0900 Joonsoo Kim wrote:
> 
> @@ -153,11 +165,16 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry,
>  		xas_unlock_irq(&xas);
>  	} while (xas_nomem(&xas, gfp));
>  
> -	if (!xas_error(&xas))
> +	if (!xas_error(&xas)) {
> +		mem_cgroup_commit_charge(page, memcg, false, compound);

Add a tp 
		trace_mm_add_to_swap_cache(page);

>  		return 0;
> +	}
> +
> +	mem_cgroup_cancel_charge(page, memcg, compound);
>  
>  	ClearPageSwapCache(page);
>  	page_ref_sub(page, nr);
> +
>  	return xas_error(&xas);
>  }





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux