Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2143907ybe; Tue, 3 Sep 2019 08:34:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTCNqX4KMqIApypqf+jUKnMFMIoBMij6F8TR62ka0ucdd08n8LyRulH93SATC9Ft/dNWDj X-Received: by 2002:a17:902:141:: with SMTP id 59mr36730683plb.324.1567524877344; Tue, 03 Sep 2019 08:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567524877; cv=none; d=google.com; s=arc-20160816; b=RlBmjeIxJoO5nTIOcalJT93btwysh2CoFf85TkuZynyi2JqRWaVw3hrldh+fLOFzcK yVdI85d7BlICJgxlDvq6WVKLzuA7nLR+Sqmd3ESiOlJXgrhwOtpgHfAezaKOqS8zowmh Azpr2g2JAFsQqmDTsokW8aQz9o5jZEhRvB1H5d/D70eXnQs8lvedTYVgY7Hnqr8NDfDU pLoyUQ8XNLDrv4fy25dGdBwu4XShEwkCNvPW7rB0IhdDr7H77p7qkGsu+fr1syJCycFf ROJZb5d1pRU5d98BgYE1hAAcv3YJUxTrqjkO0BHramiQNzB0SeYCg0ZF2WG44SJTp4Ma 50gQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=7z24kFn1qyfn97kG5Kld1bO8ER8wbRTx80HXtH0YfLI=; b=spdu2tSw0IVJtlaY3ITMv/Fi/2vfXNF+0YTectoDlxUOBUKv/Kyvn97cnYzIxMV4Lw /qq6ROVWa6+KoWThOMNR4XR62GoHejjFyN5MkqXOaYeksX2mMub3IjTffT+uAn7c1ajY 5oAeiy251MCTC6lIei7Z5RUmS4ewK9MI+DJgsG/dHjOGT2A2XvOH7HEPvtIwRJBA1O3A 8SrwLECPMpoMg3w+vKDn9FJNGtbJzIpyQ6cvsq5H7055PK5L+MMGEDWcbf2ClEcQMS+n 3qZoBfkZ6i7Gj/ZNvNYp3T4sASa1cjh/2ZFzRLTd3Y86lRX6V3H3gsQX5e/eYG7P0soP 4MAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=N6W+xOAX; 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 e11si11460961pfj.104.2019.09.03.08.34.20; Tue, 03 Sep 2019 08:34:37 -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; dkim=pass header.i=@lca.pw header.s=google header.b=N6W+xOAX; 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 S1729393AbfICPdB (ORCPT + 99 others); Tue, 3 Sep 2019 11:33:01 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36138 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfICPdB (ORCPT ); Tue, 3 Sep 2019 11:33:01 -0400 Received: by mail-qt1-f195.google.com with SMTP id o12so8862448qtf.3 for ; Tue, 03 Sep 2019 08:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=7z24kFn1qyfn97kG5Kld1bO8ER8wbRTx80HXtH0YfLI=; b=N6W+xOAXiUXU0wvHWttTDLMyO2AzXhN45qBg4wtqJdxne7OSSiXK0g1BTXPnat77Va BmH2KZF5dbj5r7R4vN474M2hJlNat9522gVBia2FW7Wg1NwFPetlfOH68zDenNfVLXZh 45O/rb20ZXcd/PnYJwl3rq7pu7yNeEIAUO97DnlXmohSGQkdCZM5XUBZNPMUPIxlTAZU zV9+HvCw8IB7dr+DiwVO6VL6XRPVTblAGIZl7xjVKk6EDpqX148S56FXLJnRKE4LyiJd /wC/Y1KZxzeB0Y6G21lndTOWQNMLytlBO9FZGA/wg4rJiwlYHHHSzsZDelSiTALE2nGH ZaDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=7z24kFn1qyfn97kG5Kld1bO8ER8wbRTx80HXtH0YfLI=; b=RZhq7293xdwR81HBoDCGVZ8Ty7AF3PkiC0NP2tiOwSTpmWNQsRTfjjG8xlqtUZN+Ye 0uXUstpOIebI3pSCxsOfcAfU9zYEL7R5yRE147yaxg25cY1PlYecuu24wPRIoCcc0W2g WDheznwb8afE081Y5smz7ZZAPO/geEx2OsxpXMSFl+rEfPYj7BSBRBwiZ8XYgaoxL9DS ikBanWxngMLa3fhqr0haixGjhy7yr6KEyGk9RXc/0Mx7rr9On2o0HGUNMRCzLmF2YyaD 9aND2v0FOA42TnVBcHeT4ulnfQR1Hy3o8VxI57zKMlLonPsR1ETlGb8Gn7ltAh8VMAcK J9Pg== X-Gm-Message-State: APjAAAWFHdBXL0Gi3rrSfNDt1voL6Z4XPPAVftxrHJ4AC8BDUsHiq8M2 PeW4bHSQjYMT39duzILm8JVq3w== X-Received: by 2002:a05:6214:1709:: with SMTP id db9mr5586290qvb.243.1567524780147; Tue, 03 Sep 2019 08:33:00 -0700 (PDT) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id 131sm8780749qkg.1.2019.09.03.08.32.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Sep 2019 08:32:59 -0700 (PDT) Message-ID: <1567524778.5576.59.camel@lca.pw> Subject: Re: [RFC PATCH] mm, oom: disable dump_tasks by default From: Qian Cai To: Michal Hocko Cc: linux-mm@kvack.org, Andrew Morton , Tetsuo Handa , David Rientjes , LKML Date: Tue, 03 Sep 2019 11:32:58 -0400 In-Reply-To: <20190903151307.GZ14028@dhcp22.suse.cz> References: <20190903144512.9374-1-mhocko@kernel.org> <1567522966.5576.51.camel@lca.pw> <20190903151307.GZ14028@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-09-03 at 17:13 +0200, Michal Hocko wrote: > On Tue 03-09-19 11:02:46, Qian Cai wrote: > > On Tue, 2019-09-03 at 16:45 +0200, Michal Hocko wrote: > > > From: Michal Hocko > > > > > > dump_tasks has been introduced by quite some time ago fef1bdd68c81 > > > ("oom: add sysctl to enable task memory dump"). It's primary purpose is > > > to help analyse oom victim selection decision. This has been certainly > > > useful at times when the heuristic to chose a victim was much more > > > volatile. Since a63d83f427fb ("oom: badness heuristic rewrite") > > > situation became much more stable (mostly because the only selection > > > criterion is the memory usage) and reports about a wrong process to > > > be shot down have become effectively non-existent. > > > > Well, I still see OOM sometimes kills wrong processes like ssh, systemd > > processes while LTP OOM tests with staight-forward allocation patterns. > > Please report those. Most cases I have seen so far just turned out to > work as expected and memory hogs just used oom_score_adj or similar. > > > I just > > have not had a chance to debug them fully. The situation could be worse with > > more complex allocations like random stress or fuzzy testing. > > Nothing really prevents enabling the sysctl when doing OOM oriented > testing. > > > > dump_tasks can generate a lot of output to the kernel log. It is not > > > uncommon that even relative small system has hundreds of tasks running. > > > Generating a lot of output to the kernel log both makes the oom report > > > less convenient to process and also induces a higher load on the printk > > > subsystem which can lead to other problems (e.g. longer stalls to flush > > > all the data to consoles). > > > > It is only generate output for the victim process where I tested on those > > large > > NUMA machines and the output is fairly manageable. > > The main question here is whether that information is useful by > _default_ because it is certainly not free. It takes both time to crawl > all processes and cpu cycles to get that information to the console > because printk is not free either. So if it more of "nice to have" than > necessary for oom analysis then it should be disabled by default IMHO. It also feels like more a band-aid micro-optimization with the side-effect that affecting debuggability, as there could be loads of console output anyway during a kernel OOM event including failed allocation warnings. I suppose if you want to change the default behavior, the bar is high with more data and justification.