From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4068BC433FE for ; Sat, 23 Oct 2021 13:19:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2336D6108D for ; Sat, 23 Oct 2021 13:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbhJWNVq (ORCPT ); Sat, 23 Oct 2021 09:21:46 -0400 Received: from relay.sw.ru ([185.231.240.75]:56328 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbhJWNVn (ORCPT ); Sat, 23 Oct 2021 09:21:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Date:Message-ID:Subject :From; bh=8UnnDRqw1eQkdViplyQTAIcge1Yu9hofXdZZzzuk4p0=; b=lrFx+iduxqiGySqgByy T0lniizeMHv+jFlBbTcd2TPw3FbwrptbgYNOU6RQPkGI+3qEEgilJNCu2is/MGSSvf2+RFMv71ppi 2oPcHrmYKnwRhHJ0ns9KfeowxcMTEUe3AXgBk2zuv+cnZ14iTt4Jy7+VFxIuXnYugopxOyL20Bw=; Received: from [172.29.1.17] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1meGvf-006vPv-Fv; Sat, 23 Oct 2021 16:19:19 +0300 From: Vasily Averin Subject: [PATCH memcg v3 0/3] memcg: prohibit unconditional exceeding the limit of dying tasks To: Michal Hocko , Johannes Weiner , Vladimir Davydov , Andrew Morton Cc: Roman Gushchin , Uladzislau Rezki , Vlastimil Babka , Shakeel Butt , Mel Gorman , Tetsuo Handa , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org References: Message-ID: <20e50917-3589-bcb7-0174-b6fccfd15c66@virtuozzo.com> Date: Sat, 23 Oct 2021 16:18:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Memory cgroup charging allows killed or exiting tasks to exceed the hard limit. It can be misused and allow to trigger global OOM from inside memcg-limited container. On the other hand if memcg fail allocation, called from inside #PF handler it trigger global OOM from inside pagefault_out_of_memory(). To prevent these problems this patch set: a) removes execution of out_of_memory() from pagefault_out_of_memory(), becasue nobody can explain why it is necessary. b) allow memcg to fail allocation of dying/killed tasks. v3: resplit, improved patch descriptions v2: resplit, use old patch from Michal Hocko removing out_of_memory() from pagefault_out_of_memory() Michal Hocko (1): mm, oom: do not trigger out_of_memory from the #PF Vasily Averin (2): mm, oom: pagefault_out_of_memory: don't force global OOM for dying tasks memcg: prohibit unconditional exceeding the limit of dying tasks mm/memcontrol.c | 27 ++++++++------------------- mm/oom_kill.c | 23 ++++++++++------------- 2 files changed, 18 insertions(+), 32 deletions(-) -- 2.32.0