Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3721040imm; Mon, 11 Jun 2018 00:08:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKILVyP0I76tZ1lFeDfNY6FsTH0kvLErwaNyGB/lLUJz/VA4X9IrrNnsmwai6iDY6GmBp6Hk X-Received: by 2002:a62:3d05:: with SMTP id k5-v6mr16297071pfa.122.1528700899390; Mon, 11 Jun 2018 00:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528700899; cv=none; d=google.com; s=arc-20160816; b=MbH7n+eV3k9QiZtsHdTu6IAimNknletifKdgbfgr6HjGv8yJvw0zlvXFV6KQCkk+g6 +Vh//yFWQFgtk08xjciW9ZTTwGq/dD5vrEybmc510gu2GEDC4BYg4rYgjPU8mSAyRhKh pmkYBDYYLBghxkZSyBofQtyFe07oUzanOSv0rzt/eYcLBqwgsx7YD08b4yKylOd9uGTN gL/Wc64uwvp5okXx3K0fzGeKm1pUXWg1AFdb24qGbs5CWegbB9Nlhz2RBgcpFXesSZ3x kVTX1NJTuxqTd1+fbFGoHauKkKxb2wGr3oQNzQd2rsrK+d3z3OlciNoTWB4g4ErbNW6M t7qQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=clwUSQ4Yo9YP48u8SlQqUuAayin2Cd98ypuxb2pEtII=; b=N7CzvTNmKIO8BG9CU1xNczwyhpGKBceqAaxj8CNiSi5caTrOZof8bXtqEpvlqbDvKz RVqNvvptfT8VeJG9ldnIOqvFt9+c9NAmPHxJE57+TYFU+0HQ0Je/Z3hoRx6RAL3OUzcB cEosDlqbx0y6gX4kJ81j1vJT4d9yApIbcKjduuKhcxoeHBDob6aUE+lYp0RSahquTgP8 AV5jl9Fm2GUg5vrZ0AY7shTOpAnOpmmjrHjcx14HRc4EXl0C+S/dl77laDdy9jftZViK HERHBBy67zD4i2yfVM6MRvT7heYCY4hE0vSQu9TLcCYZzQPGgGYduaKeEPgYTq4aUwXE qLDw== 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 c2-v6si32943606pfb.139.2018.06.11.00.08.04; Mon, 11 Jun 2018 00:08:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932365AbeFKHHY (ORCPT + 99 others); Mon, 11 Jun 2018 03:07:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:34823 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754066AbeFKHHX (ORCPT ); Mon, 11 Jun 2018 03:07:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 75E01AE61; Mon, 11 Jun 2018 07:07:22 +0000 (UTC) Date: Mon, 11 Jun 2018 09:07:20 +0200 From: Michal Hocko To: Mike Rapoport Cc: =?utf-8?B?56a56Iif6ZSu?= , akpm@linux-foundation.org, rientjes@google.com, kirill.shutemov@linux.intel.com, aarcange@redhat.com, penguin-kernel@i-love.sakura.ne.jp, guro@fb.com, yang.s@alibaba-inc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wind Yu Subject: Re: [PATCH v7 2/2] Refactor part of the oom report in dump_header Message-ID: <20180611070720.GA13364@dhcp22.suse.cz> References: <1527940734-35161-1-git-send-email-ufo19890607@gmail.com> <1527940734-35161-2-git-send-email-ufo19890607@gmail.com> <20180603124941.GA29497@rapoport-lnx> <20180604045812.GA15196@rapoport-lnx> <20180610051215.GA20681@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180610051215.GA20681@rapoport-lnx> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 10-06-18 08:12:16, Mike Rapoport wrote: > On Fri, Jun 08, 2018 at 05:53:14PM +0800, 禹舟键 wrote: > > Hi Mike > > > My question was why do you call to alloc_constrained in the dump_header() > > > function rather than pass the constraint that was detected a bit earlier to > > > that function? > > > > dump_header will be called by three functions: oom_kill_process, > > check_panic_on_oom, out_of_memory. > > We can get the constraint from the last two > > functions(check_panic_on_oom, out_of_memory), but I need to > > pass a new parameter(constraint) for oom_kill_process. > > Another option is to add the constraint to the oom_control structure. Which would make more sense because oom_control should contain the full OOM context. -- Michal Hocko SUSE Labs