Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2355038ybl; Thu, 29 Aug 2019 07:10:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEJv9Hu5wMjgQzfd3hTJUQ8b3gciePq3EKWMN23E/ZteoCFHCYGB6aWDLhhAcW6QwNvUbR X-Received: by 2002:a62:f245:: with SMTP id y5mr11722415pfl.156.1567087854606; Thu, 29 Aug 2019 07:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567087854; cv=none; d=google.com; s=arc-20160816; b=QUzVSBc9C3Hb+VPYeWIS0ZyUUrw/gEOkWO3BMsk3qtwlpYO0nNj5ILnMB3igjjw3se tpvIsfIRW4BEfWw580TjnfxeukbCnMKJk0jSxuB84nB+5SADpnXmRllEr0C41s9oR/a1 Dh18Hd384Ajn54VLQ7GzNDoI77Ey0J2GWfQmBgDbaIKYOo/Uzy2aqj2t0AMGoBCzM/5u wE8eahSmfuFLxq3ajLYNP/bkeO/DM+5YebdHwv8xiTT6p0LseGJgjypywOmvdheOMSqL JJ3TrV+j45WAlQpNPmi78b0KyRZKt/KDc1IgfIMpkkE2+ALwtSnvmMsBq0IbrsROZjcs 1/mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=yKwnrdjpHEvdNlA+NgsoSv9mY7IbwhMKZTilgLTuB2E=; b=TzCqYLXBkgx2Ia3SeFmsvoBGKyVBKUTrLNPk7WBa8yjDgZgkIlf6JORmygUG7sk1rG MY9bLjAxq1a4WvxgsV+bL5DQqq3DfyOLj2x0W3mJx6KTw4sKTc8p4sQYYOXY0MAwistf HDk2MW5uJrTi7jpl/FFmNtszPbo47Hqg79gNPY1QOnoJwVBrlyUYjYmP33Q9seA3BadI a0XhycFBSGYIssBB+nfo75tDiNPpdfci0mWRCSRfAbDxQk2t2HVNRfYoKzj0lUo8Iq5h 9jdMfGC9+vk9hjMBDSNDkD1SyV1escQAiV7IK+Xv0VpR+FsI694hlGPPKnL3mT1JLVpQ ViVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si2016939pls.110.2019.08.29.07.10.37; Thu, 29 Aug 2019 07:10:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbfH2OJQ (ORCPT + 99 others); Thu, 29 Aug 2019 10:09:16 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:65367 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727578AbfH2OJN (ORCPT ); Thu, 29 Aug 2019 10:09:13 -0400 Received: from fsav305.sakura.ne.jp (fsav305.sakura.ne.jp [153.120.85.136]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id x7TE9A90061951; Thu, 29 Aug 2019 23:09:10 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav305.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav305.sakura.ne.jp); Thu, 29 Aug 2019 23:09:10 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav305.sakura.ne.jp) Received: from [192.168.1.8] (softbank126227201116.bbtec.net [126.227.201.116]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id x7TE9AZZ061947 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Thu, 29 Aug 2019 23:09:10 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH 00/10] OOM Debug print selection and additional information To: Michal Hocko Cc: Edward Chron , Andrew Morton , Roman Gushchin , Johannes Weiner , David Rientjes , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Ivan Delalande References: <20190826193638.6638-1-echron@arista.com> <20190827071523.GR7538@dhcp22.suse.cz> <20190828065955.GB7386@dhcp22.suse.cz> <20190829071105.GQ28313@dhcp22.suse.cz> <297cf049-d92e-f13a-1386-403553d86401@i-love.sakura.ne.jp> <20190829115608.GD28313@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: Date: Thu, 29 Aug 2019 23:09:08 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190829115608.GD28313@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/08/29 20:56, Michal Hocko wrote: >> But please be aware that, I REPEAT AGAIN, I don't think neither eBPF nor >> SystemTap will be suitable for dumping OOM information. OOM situation means >> that even single page fault event cannot complete, and temporary memory >> allocation for reading from kernel or writing to files cannot complete. > > And I repeat that no such reporting is going to write to files. This is > an OOM path afterall. The process who fetches from e.g. eBPF event cannot involve page fault. The front-end for iovisor/bcc is a python userspace process. But I think that such process can't run under OOM situation. > >> Therefore, we will need to hold all information in kernel memory (without >> allocating any memory when OOM event happened). Dynamic hooks could hold >> a few lines of output, but not all lines we want. The only possible buffer >> which is preallocated and large enough would be printk()'s buffer. Thus, >> I believe that we will have to use printk() in order to dump OOM information. >> At that point, > > Yes, this is what I've had in mind. Probably I incorrectly shortcut. Dynamic hooks could hold a few lines of output, but dynamic hooks can not hold all lines when dump_tasks() reports 32000+ processes. We have to buffer all output in kernel memory because we can't complete even a page fault event triggered by the python process monitoring eBPF event (and writing the result to some log file or something) while out_of_memory() is in flight. And "set /proc/sys/vm/oom_dump_tasks to 0" is not the right reaction. What I'm saying is "we won't be able to hold output from dump_tasks() if output from dump_tasks() goes to buffer preallocated for dynamic hooks". We have to find a way that can handle the worst case.