Received: by 10.213.65.68 with SMTP id h4csp3523673imn; Mon, 9 Apr 2018 23:44:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+EspElqaHXuPS5cNcf9lhXN3rgFCpaIkl1vMPvJU38GmiZ8zNNNVvkmeXjig5BqLh0rUKB X-Received: by 2002:a17:902:2863:: with SMTP id e90-v6mr42779227plb.58.1523342654935; Mon, 09 Apr 2018 23:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523342654; cv=none; d=google.com; s=arc-20160816; b=eXl1atPzOnQM6My8eYNmhE6EU4ZgaARm+7qtvgglZ5vJgol3JM6vRkdO8SMqeLFo5t rdAuZPzhQhjisKvyK0Z6Ygd4VebAt0yjraanYATQAXxiVs0pcauMfhyYIE/bbYf0Ganv Z0ANcqMDhHoPGGPQ5A8gdW5qf3yESiRbzPNExsd/qjjczBedKBjdA8FwpWAfNsv4fuoA VCph0QaXNRj7jUMWGM858aTV1iE1xFZfU4fegETyPzNFR5hsP0pVwjCQFCTQlsxax+wQ AzcGl/ZzYfqCn7CjtbkdVOEdF/Gq6GeFW6TgF1ydmKJ6rEjpLmWuiXC4XHBV36JfVwm9 jjIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=DPuW9mvZJUDXggR3iaBgl5IpzV0wfK6PkeF6iS4gGMw=; b=dU/bBFBuHiJ0iKwWT0Aty4M5x0kWzwFAXy+yboHXGYMvNZTMinXDSqqLd5A4LrHmuP Tnr2My4CU/hmRKShvNIe6BrAwP6oENrxM/9E6Jkd327ritjA5OWyaLqO6EH4Ifnz2XAk z+j10cMRvpqemFRUOWZWHDFvBH5TOQqlIQQWy9pyPMpFCJYTLu2LIKRgh2FiYwqdrWhe dE6U7Xcl10B77/+r23FlKuO1EPs4wp0WQdV3Efu+smHlSjTevlwvJi2e7CEPRjQxA37S Jck7UqjlguQwh9JM8roanT+ErSqX9KLIcfvQcQpGirjGgrevhx6akxNoefQfJL3DfVdn VPEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D8Q0FuOs; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63-v6si2028835pld.52.2018.04.09.23.43.37; Mon, 09 Apr 2018 23:44:14 -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=@gmail.com header.s=20161025 header.b=D8Q0FuOs; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbeDJGji (ORCPT + 99 others); Tue, 10 Apr 2018 02:39:38 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53842 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbeDJGjg (ORCPT ); Tue, 10 Apr 2018 02:39:36 -0400 Received: by mail-wm0-f66.google.com with SMTP id 66so17318092wmd.3 for ; Mon, 09 Apr 2018 23:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DPuW9mvZJUDXggR3iaBgl5IpzV0wfK6PkeF6iS4gGMw=; b=D8Q0FuOsF605B+s6p7CtiaqhG1SAJ8/TJl5OJ8GKvAvIhWUSpX1OWHhmTeaOKl5u4j uUUw6LZsaYUhz/ubDJaNvboWZP/5BJCcPjYpsXpjc/pGU5R7PMU5NpnNFz1mPd76woIE vXDlpiMu1iKaiPwSY9jluHMi6sb4TXgstbzGEENn8M9TdZbLBFJjgBsDRGBhY7ph1TFv cNodNJ/pZ1AQ+SIAiTMl5F7uH5PlkA0WM1rGg7lG2YcMPIlqStuKyJX4BsYo7N3D/V+Y tRGLGaIVcXmDLYY+cfaIVknlupn+87PRdLWMnrtKQddjP7T0a94i3y8f2vKohjOctJHF MAeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DPuW9mvZJUDXggR3iaBgl5IpzV0wfK6PkeF6iS4gGMw=; b=JfRWjPl0Vz6UZ1FNLlj/WIYyotRR+cFuE/aMr6fD112UKS9wYQ8hE8/N1JesQ1kY6p 153sxjTbf15SqDyaW4ds60xO2nBVXVH+a5SyV4jUeTYiJRcU6qRJ7cI+X9b1dLeD0H8y BNUJoDfv9ped2/KJknity7b1lVK7oelrNYrAJRGSCk0GbFac0us5XFrOXkyxp3rIft9g 5tQ7B1Lf5BvsAMqOxXHqPk32Sb0vKRMN+JLb0E9Xo11yANKFzIvNnbCseEdTXe94K+dc eoPtZBGV0d61BN4hOoILbTfVDIICLD3AXF2MRIQNjszJElo8Igh8G2lEUeGiHm5/fSS+ /Ycg== X-Gm-Message-State: ALQs6tDThVgfc4K+V++ERkXBSQ85WeXtAZO/HUOJKjIELxO9w9EVDrJ4 bElc/XbyS/ZKvT+aGfXtg9quGkyAJqKdlgcVRmI= X-Received: by 10.80.139.141 with SMTP id m13mr1393862edm.164.1523342375663; Mon, 09 Apr 2018 23:39:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.201.76 with HTTP; Mon, 9 Apr 2018 23:39:35 -0700 (PDT) In-Reply-To: <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> <20180410061447.GQ21835@dhcp22.suse.cz> From: Zhaoyang Huang Date: Tue, 10 Apr 2018 14:39:35 +0800 Message-ID: Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN To: Michal Hocko Cc: Steven Rostedt , Ingo Molnar , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 2:14 PM, Michal Hocko wrote: > 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 Steve's patch intend to have the process be OOM's victim when it over-allocating pages for ring buffer. I amend a patch over to protect process with OOM_SCORE_ADJ_MIN from doing so. Because it will make such process to be selected by current OOM's way of selecting.(consider OOM_FLAG_ORIGIN first before the adj)