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 0A06DC433F5 for ; Mon, 27 Sep 2021 09:36:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7697960E8B for ; Mon, 27 Sep 2021 09:36:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7697960E8B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0CD296B0074; Mon, 27 Sep 2021 05:36:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 054C1940009; Mon, 27 Sep 2021 05:36:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5E8A6B0078; Mon, 27 Sep 2021 05:36:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id D21846B0074 for ; Mon, 27 Sep 2021 05:36:22 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9043282499A8 for ; Mon, 27 Sep 2021 09:36:22 +0000 (UTC) X-FDA: 78632847804.01.1599E96 Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) by imf07.hostedemail.com (Postfix) with ESMTP id 0D46E1000099 for ; Mon, 27 Sep 2021 09:36:21 +0000 (UTC) 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:From: Subject; bh=UuF6FHs19BNorLrl2iJ5nlzRqI12m41442Ub5BwC1yY=; b=cLaqobgNClIHOqPlH 4PvwKYnD6rUCdvka5AQkv2s1rFASROYIi0XMbECngjIx9Cdm9lUzuqO/DpoDma1WyY+fZO27ZPZCz yVMT5tKlP4GG049tOkT8nVxdakIoLjMIA4pjZZ1d+/PtrSfIjlruZdsBA9KuVUT0pB6QMF8a5RhM4 =; Received: from [10.93.0.56] by relay.sw.ru with esmtp (Exim 4.94.2) (envelope-from ) id 1mUn3Y-003bZI-4A; Mon, 27 Sep 2021 12:36:16 +0300 Subject: Re: [PATCH mm] vmalloc: back off when the current task is OOM-killed To: Michal Hocko Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Tetsuo Handa , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org References: From: Vasily Averin Message-ID: <508abe37-a044-7180-ac67-b4ce5e4cc149@virtuozzo.com> Date: Mon, 27 Sep 2021 12:36:15 +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 X-Rspamd-Queue-Id: 0D46E1000099 X-Stat-Signature: b45k9jiq6rzwogtb5m3z1qpn1eiwft36 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=virtuozzo.com header.s=relay header.b=cLaqobgN; spf=pass (imf07.hostedemail.com: domain of vvs@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=vvs@virtuozzo.com; dmarc=pass (policy=quarantine) header.from=virtuozzo.com X-Rspamd-Server: rspam06 X-HE-Tag: 1632735381-275958 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/24/21 10:55 AM, Michal Hocko wrote: > On Thu 23-09-21 09:49:57, Vasily Averin wrote: > [...] >> I'm agree that vmalloc callers should expect and handle single vnalloc failures. >> I think it is acceptable to enable fatal_signal_pending check to quickly >> detect such kind of iussues. >> However fatal_signal_pending check can cause serial vmalloc failures >> and I doubt it is acceptable. >> >> Rollback after failed vmalloc can call new vmalloc calls that will be failed too, >> even properly handled such serial failures can cause troubles. > > Could you be more specific? Also how would this be any different from > similar failures for an oom victim? Except that the later is less likely > so (as already mentioend) any potential bugs would be just lurking there > for a longer time. > >> Hypothetically, cancelled vmalloc called inside some filesystem's transaction >> forces its rollback, that in own turn it can call own vmalloc. > > Do you have any specific example? No, it was pure hypothetical assumption. I was thinking about it over the weekend, and decided that: a) such kind of issue (i.e. vmalloc call in rollback after failed vmalloc) is very unlikely b) if it still exists -- it must have own failback with kmalloc(NOFAIL) or just accept/ignore such failure and should not lead to critical failures. If this still happen -- ihis is a bug, we should detect and fix it ASAP. >> Should we perhaps interrupt the first vmalloc only? > > This doesn't make much sense to me TBH. It doesn't address the very > problem you are describing in the changelog. Last question: how do you think, should we perhaps, instead, detect such vmallocs (called in rollback after failed vmalloc) and generate a warnings, to prevent such kind of problems in future? Thank you, Vasily Averin