Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1516890pxb; Tue, 26 Oct 2021 10:25:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxRdTi0jq/4HSTUz7y0rfua6X8n2sIGDV+ugBwOQHE6T7mAi83vyHszr92T7PCYPh6Ude0 X-Received: by 2002:a17:906:1382:: with SMTP id f2mr2183542ejc.144.1635269101804; Tue, 26 Oct 2021 10:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635269101; cv=none; d=google.com; s=arc-20160816; b=EuDA9uZ1/7iYamXTfWoWz3EWO96ZpB/SUZN67EMgz3qe8YhnLQIX54l+WwAKaj1h/N 9c4SKT57NjLlcVDPsjB3TJtIgpFtBRwAFDA0x4opd3N0hB64vwYxpVMpSBFG3yWFPjqk wMrJLh3iJSWNBUu2MJNJsEW1vdTpZ5cGwK2DERDAL4SXV0UyF9QoYuC2odhVvThtZF3/ kP8jvRDJtUFJbQaxNNd8P7Fy10IOB5cJ59JyAtOxp4qpHxgmtdDHT3mOtE2XuZogkwaQ 9EfqgO3dSwpEksArdTwx1SwwwaCvPytOYcjYguwqS8VUcQyFjR9E0w25ZWvTB0kvjT/S Il2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=A1hTQrynBHD7EzOP/TsIy7/zC9YD3cup6P+EiupmKAM=; b=ZkZJOcBDfZux76GQa4H57OBAfGMzztC9KMNQnU3/gC/hpoPSc3o9o1X0JaM7ExFi0B Rk1hWVgaEyytZebf3Ay1lQDwPEXWBCYcuLNknUijH8mfDffL/OSXFS6VeaYmeuXtvNSf r82oaRVdcvuy8QEzZxLv4ATY/kWYp4Wbi4a9W8+IAPk/lEqFCglJ/GJ2MMJ/dpz9O851 X11XpSWI16ClMrGG0kjG4mM9IwCqFZQmwn+3ka2Upo+7E4tWOQRWH+S9wn4Mxa38RjTF QgpOuPy4rmLzjrVlZvohsdsOlRxmAU0UfTq7UOjBHTT9TdnlYszQ2EcrukktC+quXcHk HMPg== 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 u9si15832751edp.507.2021.10.26.10.24.36; Tue, 26 Oct 2021 10:25:01 -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 S236391AbhJZOAF (ORCPT + 99 others); Tue, 26 Oct 2021 10:00:05 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:60125 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236345AbhJZN7w (ORCPT ); Tue, 26 Oct 2021 09:59:52 -0400 Received: from fsav314.sakura.ne.jp (fsav314.sakura.ne.jp [153.120.85.145]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 19QDulsa003967; Tue, 26 Oct 2021 22:56:47 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav314.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav314.sakura.ne.jp); Tue, 26 Oct 2021 22:56:47 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav314.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 19QDukhj003946 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 26 Oct 2021 22:56:46 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Message-ID: <62a326bc-37d2-b8c9-ddbf-7adaeaadf341@i-love.sakura.ne.jp> Date: Tue, 26 Oct 2021 22:56:44 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH memcg v3 2/3] mm, oom: do not trigger out_of_memory from the #PF Content-Language: en-US To: Michal Hocko Cc: Vasily Averin , Roman Gushchin , Uladzislau Rezki , Vlastimil Babka , Shakeel Butt , Mel Gorman , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel@openvz.org, Johannes Weiner , Vladimir Davydov , Andrew Morton References: From: Tetsuo Handa In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/10/25 17:04, Michal Hocko wrote: > I do not think there is any guarantee. This code has meant to be a > safeguard but it turns out to be adding more harm than a safety. There > are several scenarios mentioned in this thread where this would be > counter productive or outright wrong thing to do. Setting PR_IO_FLUSHER via prctl(PR_SET_IO_FLUSHER) + hitting legacy kmem charge limit might be an unexpected combination? > > On the other hand it is hard to imagine any legitimate situation where > this would be a right thing to do. Maybe you have something more > specific in mind? What would be the legit code to rely on OOM handling > out of the line (where the details about the allocation scope is lost)? I don't have specific scenario, but I feel that it might be a chance to retry killable vmalloc(). Commit b8c8a338f75e ("Revert "vmalloc: back off when the current task is killed"") was 4.5 years ago, and fuzz testing found many bugs triggered by memory allocation fault injection. Thus, I think that the direction is going towards "we can fail memory allocation upon SIGKILL (rather than worrying about depleting memory reserves and/or escalating to global OOM killer invocations)". Most memory allocation requests which allocate memory for userspace process are willing to give up upon SIGKILL. Like you are trying to add NOFS, NOIO, NOFAIL support to vmalloc(), you could consider KILLABLE support as well. Of course, direct reclaim makes it difficult to immediately give up upon SIGKILL, but killable allocation sounds still nice even if best-effort basis.