Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3791095pxb; Mon, 27 Sep 2021 02:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqaUDARB85jjeyh4u7DicW7Z8XbCU+zLgznBPDeT3HEHRWeI6JRjq7HBue4T9xf9B/LLHH X-Received: by 2002:aa7:df92:: with SMTP id b18mr21389510edy.47.1632735491494; Mon, 27 Sep 2021 02:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632735491; cv=none; d=google.com; s=arc-20160816; b=LaMchVUG8qZWr+am1bwjuLGcq1GyYfF/uLCY5vfV70ypREbJeJcLfO3vM6WdBLs+RI A/Jk1wBKhZs/GRLVv7wZJpItEuh2dx+X2mz6TecwBjf/ohSygn+N0zL35UXStNJMcioA xqb9QbqLQRBX8akNgfNWyhPCOzUn1X/pGlAo8hO/DASR9ZEB4DeAJz1gxwMMQnknJsIG XmrJIuFeVXcHi40xWzLDiXl5teBh5IotZE2y9sL12thOTS6gZ7W2r29hp5q480fIPMNR oUtx3F0ZQ1LSid0fgh+RfgTYafcR3DxzRw+6nfoZE1fLcQXzI3ZPFTBNoHZoLvljGIht srnA== 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:dkim-signature; bh=UuF6FHs19BNorLrl2iJ5nlzRqI12m41442Ub5BwC1yY=; b=ZTtVTq94heMhsN9pmIDSBTgtBqqOBheJooyxvt3IuE0m4GNGCWuCiQPa+D2WLfHIwi DQXjDkfdmDIC5JjW5EUPpvBDYS9iXlDQLiPUI3rKJclFMOhMENeOBsOZnruND7v06mfL H6fnZt0zyDHHfUOh16xKPQooDpnHHiJb+2c94+tOS0f7kng6A6+kC/QWn61eP4cLkYzf ZEek1e/TvlSzoexx7iGLf47u6m2ax3N7fCHPYOuaRjWJaQpr+j3ExrS6NBAPwSYuPW0Z v7bIO8zyDan0SKVd42nmYYxnn0xn5auQUhgubT4y4Tux1Z9swD0IO75gtejkbDGxFeaI WUYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=cLaqobgN; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q30si17378261edi.509.2021.09.27.02.37.48; Mon, 27 Sep 2021 02:38:11 -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; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=cLaqobgN; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233680AbhI0JiC (ORCPT + 99 others); Mon, 27 Sep 2021 05:38:02 -0400 Received: from relay.sw.ru ([185.231.240.75]:54652 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233587AbhI0Jh6 (ORCPT ); Mon, 27 Sep 2021 05:37:58 -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: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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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