Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp129223imj; Wed, 13 Feb 2019 05:54:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IZjgLxoiMSNDIeDuvEg/yrIi3oG4tYx1K+cW7DgN5LR6GZn6iWG5RAbot3XkL2adBvk9JAQ X-Received: by 2002:aa7:8045:: with SMTP id y5mr650590pfm.62.1550066042532; Wed, 13 Feb 2019 05:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550066042; cv=none; d=google.com; s=arc-20160816; b=I4Na4qkZPl3fMz73fGWCkkJmiGFIUgYli1xcnzJXcvUMfTQs4PfZ5ZPzqTbR8IbivN HFb0XhGY14UoBExegUnrTxZodEdDcyEE6L1RGac7fyW8mafATURfGL5vi+z6E9M0DND4 tT6LuKobs4kr504VqKsa2EYxnNVrWFYoHyfOI2UGpZ4A8FtKG1dqoD3VGJLQOrsO5jyS wmo/Po+YfP+wbzJEluC15Z3i1m3t9IEwwppxdwQegm1FOdkHGUNApLuOJQzClXFJAJV2 ZxObypt4/a/GeyY6LOu/qZnbRzh9I0QFqiXlkYe1mmWeIsK+n34lpBy55qxqnt+76g2+ F42Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fqKvzr2qY3/hju/1gw51bS7xXDgLxNbCAQ3D2Gsiok4=; b=eQy13SPiZzeBhkrYz9zb8AIcxiRdYtFU7fRbqrfrmU8bj8KsAdg7JQorylxsbj5h51 jm8xUXO6pxals8Ctlb1GWm20lWnysxG22sBg6aNVSF5N0xM5fIfcesGtTckPnEUanU7G bYOC7BmIHcFQ/KfDF2e7TwN905TmPX8vzeb1bF1DvxlEQUDFUlPLU5slpZLQVrUDn6e5 p5na8AtoN5W05CqDFkgFq3hDynFzR5RoXu8zWUjyDCagQnDTbhLTd1MmhMvKBu9Kh33q /V8uxiWSTecxSFrlIPRUoWPN/gAn6ksbMvYZND137EUGf9Dsk4nbEjNG9EPlPlCkoFP4 HlDw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4si17171216pli.432.2019.02.13.05.53.46; Wed, 13 Feb 2019 05:54:02 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733050AbfBMLrh (ORCPT + 99 others); Wed, 13 Feb 2019 06:47:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:49028 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726174AbfBMLrh (ORCPT ); Wed, 13 Feb 2019 06:47:37 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2384AADAA; Wed, 13 Feb 2019 11:47:35 +0000 (UTC) Date: Wed, 13 Feb 2019 12:47:33 +0100 From: Michal Hocko To: Tetsuo Handa Cc: Andrew Morton , David Rientjes , Johannes Weiner , Linus Torvalds , Yong-Taek Lee , linux-mm@kvack.org, LKML Subject: Re: [PATCH] proc, oom: do not report alien mms when setting oom_score_adj Message-ID: <20190213114733.GB4525@dhcp22.suse.cz> References: <20190212102129.26288-1-mhocko@kernel.org> <20190212125635.27742b5741e92a0d47690c53@linux-foundation.org> <201902130124.x1D1OGg3070046@www262.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201902130124.x1D1OGg3070046@www262.sakura.ne.jp> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 13-02-19 10:24:16, Tetsuo Handa wrote: > Andrew Morton wrote: > > On Tue, 12 Feb 2019 11:21:29 +0100 Michal Hocko wrote: > > > > > Tetsuo has reported that creating a thousands of processes sharing MM > > > without SIGHAND (aka alien threads) and setting > > > /proc//oom_score_adj will swamp the kernel log and takes ages [1] > > > to finish. This is especially worrisome that all that printing is done > > > under RCU lock and this can potentially trigger RCU stall or softlockup > > > detector. > > > > > > The primary reason for the printk was to catch potential users who might > > > depend on the behavior prior to 44a70adec910 ("mm, oom_adj: make sure > > > processes sharing mm have same view of oom_score_adj") but after more > > > than 2 years without a single report I guess it is safe to simply remove > > > the printk altogether. > > > > > > The next step should be moving oom_score_adj over to the mm struct and > > > remove all the tasks crawling as suggested by [2] > > > > > > [1] http://lkml.kernel.org/r/97fce864-6f75-bca5-14bc-12c9f890e740@i-love.sakura.ne.jp > > > [2] http://lkml.kernel.org/r/20190117155159.GA4087@dhcp22.suse.cz > > > > I think I'll put a cc:stable on this. Deleting a might-trigger debug > > printk is safe and welcome. > > > > I don't like this patch, for I can confirm that removing only printk() is not > sufficient for avoiding hungtask warning. If the reason of removing printk() is > that we have never heard that someone hit this printk() for more than 2 years, > the whole iteration is nothing but a garbage. I insist that this iteration > should be removed. As the changelog states explicitly, removing the loop should be the next step and the implementation is outlined in [2]. It is not as simple as to do the revert as you have proposed. We simply cannot allow to have different processes disagree on oom_score_adj. This could easily lead to breaking the OOM_SCORE_ADJ_MIN protection. And that is a correctness issue. As a side note. I am pretty sure I would have more time to do that if only I didn't really have to spend it on pointless and repeated discussions. You are clearly not interested on spending _your_ time to address this issue properly yourself. This is fair but nacking a low hanging fruit patch that doesn't make situation any worse while it removes a potential expensive operation from withing RCU context is nothing but an obstruction. It is even more sad that this is not the first example of this attitude which makes it pretty hard, if not impossible, to work with you. And another side note. I have already pointed out that this is by far not the only problem with CLONE_VM without CLONE_SIGHAND threading model. Try to put your "only the oom paths matter" glasses down for a moment and try to look what are the actual and much more serious consequences of this threading model. Hint have a look at mm_update_next_owner and how we have to for_each_process from under tasklist_lock or zap_threads with RCU as well. -- Michal Hocko SUSE Labs