Received: by 10.213.65.68 with SMTP id h4csp3502993imn; Mon, 9 Apr 2018 23:18:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+A19zqL7mlExqHkFRZ/K1O+7MwY0EFVnqxXMPQkKBFbTmEXdj44GuaBuaN07cIyE+vtnuT X-Received: by 10.98.236.220 with SMTP id e89mr1619685pfm.173.1523341089680; Mon, 09 Apr 2018 23:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523341089; cv=none; d=google.com; s=arc-20160816; b=E+zv/GXlmfCZYBaxs12l6zhRsvkUNHyYFo3Pt3VDYn4ywfLeyb5PzocZEeA8+qjiJa oAoaxbajcn1ka7lPwjK+hTrsA3zLyMePYUkYO8qNWJ09IJiKVWhubM3rXEyP56LwYill 3CWvj0M4HtssfkXtZMSOdN1n2hEAx6baalWVyl1W2+66cRqSJro9UITSv3IybVRmsImr 1oD2Ab9yv/W3PnzqIs6hXwd56tbuSdXEx9vq2RmJjwHvYmm05ONusv79t6AdWUqrIShA Ke/44xQBzEanGaQK7MyV67Epq9JS9R93Yx7lqJZ4SiRcm7bEOvkJeDE5l/YioRRvOsEd eGlw== 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:arc-authentication-results; bh=kSvkSxqx9iu5qoRI3KLqQ4WyoarF4k4Gmb82Ux6Ozio=; b=Hxr0udnNIDhyWo1U5B5yl1UU91wNCP79gDbi6hr5JcsfJg3k4BsDvJFDPtmbglduMl VlClGS0sN9AsKpcL50aPLxLw+iT87aCkQcobWlAG5Ay9w9IBMAhPJAhoQ9YsDmwvK79x BDhdHlFUVAIYZI9mEShuGc3wAsl7/fVFWM+el4VoXNjTGEwcqkXz0ARCa+yTOZRQ1qTZ NaGVB2LW8dVrQoic61H4uo0P9d+gmwzI85l/A6j8dd8Ma4CegdVod8OEGg56xcAIqSfG QP7JSwten2ywsgBzDQo8bLXIJd07QisSnE2NCqWnX2lLkntqOcmDqqQjXjGcmAQlIZCg bfkw== 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 b38-v6si2017299pla.124.2018.04.09.23.17.31; Mon, 09 Apr 2018 23:18:09 -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 S1751877AbeDJGOw (ORCPT + 99 others); Tue, 10 Apr 2018 02:14:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:33197 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbeDJGOv (ORCPT ); Tue, 10 Apr 2018 02:14:51 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 21CF2AC12; Tue, 10 Apr 2018 06:14:50 +0000 (UTC) Date: Tue, 10 Apr 2018 08:14:47 +0200 From: Michal Hocko To: Zhaoyang Huang Cc: Steven Rostedt , Ingo Molnar , LKML Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN Message-ID: <20180410061447.GQ21835@dhcp22.suse.cz> References: <1523153783-20579-1-git-send-email-zhaoyang.huang@spreadtrum.com> <20180407234812.2bf2b24b@gandalf.local.home> <20180408084717.62ee4f9e@gandalf.local.home> <20180409094944.6399b211@gandalf.local.home> <20180409231230.1ab99e85@vmware.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 10-04-18 11:41:44, Zhaoyang Huang wrote: > On Tue, Apr 10, 2018 at 11:12 AM, Steven Rostedt wrote: > > On Tue, 10 Apr 2018 10:32:36 +0800 > > Zhaoyang Huang wrote: > > > >> For bellowing scenario, process A have no intension to exhaust the > >> memory, but will be likely to be selected by OOM for we set > >> OOM_CORE_ADJ_MIN for it. > >> process A(-1000) process B > >> > >> i = si_mem_available(); > >> if (i < nr_pages) > >> return -ENOMEM; > >> schedule > >> ---------------> > >> allocate huge memory > >> <------------- > >> if (user_thread) > >> set_current_oom_origin(); > >> > >> for (i = 0; i < nr_pages; i++) { > >> bpage = kzalloc_node > > > > Is this really an issue though? > > > > Seriously, do you think you will ever hit this? > > > > How often do you increase the size of the ftrace ring buffer? For this > > to be an issue, the system has to trigger an OOM at the exact moment > > you decide to increase the size of the ring buffer. That would be an > > impressive attack, with little to gain. > > > > Ask the memory management people. If they think this could be a > > problem, then I'll be happy to take your patch. > > > > -- Steve > add Michael for review. > Hi Michael, > I would like suggest Steve NOT to set OOM_CORE_ADJ_MIN for the process > with adj = -1000 when setting the user space process as potential > victim of OOM. OOM_SCORE_ADJ_MIN means "hide the process from the OOM killer completely". So what exactly do you want to achieve here? Because from the above it sounds like opposite things. /me confused... -- Michal Hocko SUSE Labs