From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760058AbeAIRW6 (ORCPT + 1 other); Tue, 9 Jan 2018 12:22:58 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35907 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759958AbeAIRW4 (ORCPT ); Tue, 9 Jan 2018 12:22:56 -0500 X-Google-Smtp-Source: ACJfBoszz9dN6HeOrWCWVlPXMLrUk2egIGVnLKjdN/g06E7Kkvu9Fc7D7oqVbmwHDvi3Fvy/zulAiFS6MUNUEQNQWrA= MIME-Version: 1.0 In-Reply-To: <20180109165815.8329-1-aryabinin@virtuozzo.com> References: <20171220135329.GS4831@dhcp22.suse.cz> <20180109165815.8329-1-aryabinin@virtuozzo.com> From: Shakeel Butt Date: Tue, 9 Jan 2018 09:22:53 -0800 Message-ID: Subject: Re: [PATCH v3 1/2] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes To: Andrey Ryabinin Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Cgroups , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 9, 2018 at 8:58 AM, Andrey Ryabinin wrote: > mem_cgroup_resize_[memsw]_limit() tries to free only 32 (SWAP_CLUSTER_MAX) > pages on each iteration. This makes practically impossible to decrease > limit of memory cgroup. Tasks could easily allocate back 32 pages, > so we can't reduce memory usage, and once retry_count reaches zero we return > -EBUSY. > > Easy to reproduce the problem by running the following commands: > > mkdir /sys/fs/cgroup/memory/test > echo $$ >> /sys/fs/cgroup/memory/test/tasks > cat big_file > /dev/null & > sleep 1 && echo $((100*1024*1024)) > /sys/fs/cgroup/memory/test/memory.limit_in_bytes > -bash: echo: write error: Device or resource busy > > Instead of relying on retry_count, keep retrying the reclaim until > the desired limit is reached or fail if the reclaim doesn't make > any progress or a signal is pending. > > Signed-off-by: Andrey Ryabinin Reviewed-by: Shakeel Butt From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shakeel Butt Subject: Re: [PATCH v3 1/2] mm/memcg: try harder to decrease [memory,memsw].limit_in_bytes Date: Tue, 9 Jan 2018 09:22:53 -0800 Message-ID: References: <20171220135329.GS4831@dhcp22.suse.cz> <20180109165815.8329-1-aryabinin@virtuozzo.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=f3+vKTfCZ5BU2ia71DuqgJ2Tw8n+e7Jb7VHuriGpktc=; b=Buw8cKItLsqLJCBEalxSiZwsTkOvOW+P4Z0vgLBDuhEiHWbNK3Gned31Vk5ywejtWL 45Oy5e2/IIQ/oiDnx7UPYNaxx2L45KBf8u9OVb2VQzyxvuiyVX7f1+oZfbhyDFMKRxzf x1uvXNNiX84YtJ+0Wh2w4a/vxHDe99m/DmqtcViHfQDKhRJKWf5E1G4EixeJ1Ypgh4/K h+IxNc7lm8GCvH8qXt1NoFYsXy3GSyjNAdDgWTzoQ6d4ImMx7c5IYxzhMxFC+p4ZE6H0 oYs+peP5GXT3XI/Yufo0GLY4wZU3hJiZFXtfwq+d3pAZy/3hIGQ2DwHXV7v1C4GBMaJo 38OA== In-Reply-To: <20180109165815.8329-1-aryabinin@virtuozzo.com> Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrey Ryabinin Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Cgroups , Linux MM , LKML On Tue, Jan 9, 2018 at 8:58 AM, Andrey Ryabinin wrote: > mem_cgroup_resize_[memsw]_limit() tries to free only 32 (SWAP_CLUSTER_MAX) > pages on each iteration. This makes practically impossible to decrease > limit of memory cgroup. Tasks could easily allocate back 32 pages, > so we can't reduce memory usage, and once retry_count reaches zero we return > -EBUSY. > > Easy to reproduce the problem by running the following commands: > > mkdir /sys/fs/cgroup/memory/test > echo $$ >> /sys/fs/cgroup/memory/test/tasks > cat big_file > /dev/null & > sleep 1 && echo $((100*1024*1024)) > /sys/fs/cgroup/memory/test/memory.limit_in_bytes > -bash: echo: write error: Device or resource busy > > Instead of relying on retry_count, keep retrying the reclaim until > the desired limit is reached or fail if the reclaim doesn't make > any progress or a signal is pending. > > Signed-off-by: Andrey Ryabinin Reviewed-by: Shakeel Butt -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org