Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1445153pxb; Fri, 10 Sep 2021 06:11:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFCI7yT9QkSe8FNlk4ktt8nh5LW3rStdQAgFKaF2iL0izng9oN6VCXm34dggmchzzryyij X-Received: by 2002:a17:906:720e:: with SMTP id m14mr9261150ejk.500.1631279472350; Fri, 10 Sep 2021 06:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631279472; cv=none; d=google.com; s=arc-20160816; b=o/aKZ/jXkTWMyrj23O6W5n01KqHtJ4/+WsSrmgw/0IuinBZ7rgY2JeXQUQykqGcI22 VeXHgcRH2PHp7GIxACFLioBvNODddjIVvpENSyWsdG6u/rUoNJJH34KEDyUf1UO09+95 3JMdR2qfMk8MhEQ7I5KIW0fs05MKXhw8DRmfowHqq6gPhjjDFhpCSVrxBjuy9NHEiCvX F02H+xpuPkbLU0Zp+h7CxV9/sILc8+ajKq1dK377ipoK6PjAZ5YKX/c0R0txMonqT1Dn r8cGU/3ERwpkoD1WeVz1vYMslyDfowAazvBaRCt4w6GJm7mgi0WOAbuD1bYM5+TKdkId alng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Ryq+gQGbyLA4pjR62GQ3KO18pfVbHoWDwxE19UmNmgc=; b=DoaTn+udbn/blI1U6Ms9efaTk2ZbzaJ6ZaijSymn7lyIMDH6wCLjenkFmmWyMpsCbM kI+8Wu2GQ/W1blBMdTzoFj6KKWy/bOzl9do5jLAcTOiq2s+gIwBvNrR5DWwEPydnAoyf Uu9BMywMSu0aGFnJdleBkcFs9ie01QGiL5YRcbAqt3xlArT/v1wkfpzGolp81cv+4W7/ ImcKNRk/k5aTbcleNeMG3gAndeGQY0E6H9mvL8cD422Z9TfAf4fop2PEm8bgqWnhrSlF dHRqRzAY3IPCc2vyqTbOePwu7ue7aahpT/UdW7/7Lt/5Zt7IHy0g0/S457HdSS/VGxoi 3JSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si4903261eds.55.2021.09.10.06.10.41; Fri, 10 Sep 2021 06:11:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233412AbhIJNG2 (ORCPT + 99 others); Fri, 10 Sep 2021 09:06:28 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:53608 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbhIJNG2 (ORCPT ); Fri, 10 Sep 2021 09:06:28 -0400 Received: from fsav415.sakura.ne.jp (fsav415.sakura.ne.jp [133.242.250.114]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 18AD4xAZ078287; Fri, 10 Sep 2021 22:04:59 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav415.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav415.sakura.ne.jp); Fri, 10 Sep 2021 22:04:59 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav415.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 18AD4wYq078273 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Fri, 10 Sep 2021 22:04:59 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH memcg] memcg: prohibit unconditional exceeding the limit of dying tasks To: Vasily Averin Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Johannes Weiner , Vladimir Davydov , Andrew Morton References: <5b06a490-55bc-a6a0-6c85-690254f86fad@virtuozzo.com> From: Tetsuo Handa Message-ID: <099aa0db-045a-e5b8-6df7-b7c3fc4d3caa@i-love.sakura.ne.jp> Date: Fri, 10 Sep 2021 22:04:55 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <5b06a490-55bc-a6a0-6c85-690254f86fad@virtuozzo.com> 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 On 2021/09/10 21:39, Vasily Averin wrote: > The kernel currently allows dying tasks to exceed the memcg limits. > The allocation is expected to be the last one and the occupied memory > will be freed soon. > This is not always true because it can be part of the huge vmalloc > allocation. Allowed once, they will repeat over and over again. > Moreover lifetime of the allocated object can differ from > In addition the lifetime of the dying task. Can't we add fatal_signal_pending(current) test to vmalloc() loop? > Multiple such allocations running concurrently can not only overuse > the memcg limit, but can lead to a global out of memory and, > in the worst case, cause the host to panic. > > Signed-off-by: Vasily Averin