Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436AbbKWQSQ (ORCPT ); Mon, 23 Nov 2015 11:18:16 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:45370 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbbKWQSM (ORCPT ); Mon, 23 Nov 2015 11:18:12 -0500 Date: Mon, 23 Nov 2015 11:17:54 -0500 From: Johannes Weiner To: Vladimir Davydov Cc: Andrew Morton , Michal Hocko , Tejun Heo , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] memcg: fix memory.high target Message-ID: <20151123161754.GA13000@cmpxchg.org> References: <1448281351-15103-1-git-send-email-vdavydov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448281351-15103-1-git-send-email-vdavydov@virtuozzo.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1054 Lines: 20 On Mon, Nov 23, 2015 at 03:22:31PM +0300, Vladimir Davydov wrote: > When the memory.high threshold is exceeded, try_charge() schedules a > task_work to reclaim the excess. The reclaim target is set to the number > of pages requested by try_charge(). This is wrong, because try_charge() > usually charges more pages than requested (batch > nr_pages) in order to > refill per cpu stocks. As a result, a process in a cgroup can easily > exceed memory.high significantly when doing a lot of charges w/o > returning to userspace (e.g. reading a file in big chunks). > > Fix this issue by assuring that when exceeding memory.high a process > reclaims as many pages as were actually charged (i.e. batch). > > Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/