Received: by 10.213.65.68 with SMTP id h4csp2117553imn; Sun, 8 Apr 2018 20:08:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx48rFA6IC6Thuo/zqde/kAHU26kGrtK4/1DYBQq4lzbdAUoqK6Prdr9f9e4VsL22XBWluqEF X-Received: by 10.99.107.196 with SMTP id g187mr14994919pgc.384.1523243316129; Sun, 08 Apr 2018 20:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243316; cv=none; d=google.com; s=arc-20160816; b=D11UB+oXJCqNl/YhjkQim6+Z6Pag02034MupxHuIT4ZwAEsMLGG+TQz/KWd7HEbUs0 foVuzksdifrehC+plRbcX9QjiuGhNKPQtZPLJx5H7xSAqsL0BcI1Gn2eApk7Iy0qZjas Qe8kfFxM/Xe0E3w6kXzx1pCOg6w7hW3rasdYr8T0W+StLPAJkukvE1ehmyrstrhQTlTc 5usQwiR9SMf2ddHD+ra5zHybRV584nBJEHyoV8lTB22s087R29pMVYEWA79H3mqAvLXV XCjzdvThu0CyXUMaIGeNEVuVaNGPI+mdCqSCJVjfHiTrUdI3vZsE4rrckaGDsoPQ7ri/ d9Aw== 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=o9/X0x0vPT2xj+KltYVGubv7jxZQHQKMaR7l947fCWs=; b=J5J0ifQ5wzJSl4Ep8NVCuJrEXlx5bOAN0IpW9+yOre+xwsqqCxhcbC2NxKP5F84bmu dJ19qCv4yc4HF3Ven/ZLy7VFCi0kUYFmIhxLZIO6bQfamuQEJjYDvx0LMOIbHwURgTZh GkOpoP/Aj0SUzp7VemEDZ3ULrQ/RTg9TIpFfAMXce+TM6r6v3y7PRXb61QDQgLw+QTFu eNMJIY2iaJA67xs3SWOEc3TxARNcZiX4yPpD+acFbm3tS5bVH5vXRuNTLuHtpWs8/U39 9sVNX5FFQlLgXv18M3LtFJQmjcHeybbgLOZQ+IibL3HCix4NKlMUbWCGKkVXI0IxLvfk 7nUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsReyjnE; 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 g33-v6si13768547plb.499.2018.04.08.20.07.59; Sun, 08 Apr 2018 20:08:36 -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=QsReyjnE; 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 S933600AbeDIA4F (ORCPT + 98 others); Sun, 8 Apr 2018 20:56:05 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33124 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933245AbeDIA4D (ORCPT ); Sun, 8 Apr 2018 20:56:03 -0400 Received: by mail-wm0-f65.google.com with SMTP id o23so15281501wmf.0 for ; Sun, 08 Apr 2018 17:56:02 -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=o9/X0x0vPT2xj+KltYVGubv7jxZQHQKMaR7l947fCWs=; b=QsReyjnECl0pUMM98ccpDMd7dtJr07RMglRaPSkVpGLLv2dgYLVrgej9gUO6yBF1nk tcmvyQ4xHFtUk8jZfwzKym6Zcv47YXU9xb6pDyq4O0AFKYhzOqO2gX2h3nTVpxa6hakm VooVkS9CiPb2dSyhz/EreUPFDfbfma0MzGPRsotrBJ9lWuOO/mfBXKNCKVQJtDm6lSdw PYyxz4j6x0Pp/b/LB3xvXkU+i4Yh8HTALCrk6pAf2Jva+Swj0t+4/KKMPJ/3vYRjuLY/ F2WihHDslc8UXCBNd9wVYyQ73nCo7aM0Z8SIyPjcOl4Bj/gnoJ0sfwIVQxwjEc6XwkJa anEA== 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=o9/X0x0vPT2xj+KltYVGubv7jxZQHQKMaR7l947fCWs=; b=nzL8xOOXOasdDR95ZEJuvkSQ123iN3CHyKXwLL4GHHJ5iO6ke65hObarEkxJv8241O wski70/LZOl8eROfDQJisLDn9uvtfJv0ptA+ssA7lTvanWGymTRjh5ISM26NYD8A8PNz ThNcUNcizK+OVci3wzvP5jjYvSxZ0h+o1niLhtE+61/irVa6ywCaCBHgvL3Oec6R/sEG evr0OEYEh2sSYQN661o1GBI6H1o4TQKf+LnBAVo+23ECUqQ7OAFUJV2PFPuCf4eCkx7T 8p9uTxzQHYoQUElm/I1OHFLEMptV/NisnDAQaHSZNDIgsfhXz0TR0xXsxgliopy4vvaD JhaQ== X-Gm-Message-State: ALQs6tCU5XlOBezVOHffqXzpxRnzqbaiwdJQ9KxZnwtnvphGXS4neZo5 CsHMBcbOorz31eDirx+Z9OyEyXyl3A19XiT6CxLIgA== X-Received: by 10.80.168.69 with SMTP id j63mr19399612edc.301.1523235362244; Sun, 08 Apr 2018 17:56:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.201.76 with HTTP; Sun, 8 Apr 2018 17:56:01 -0700 (PDT) In-Reply-To: <20180408084717.62ee4f9e@gandalf.local.home> References: <1523153783-20579-1-git-send-email-zhaoyang.huang@spreadtrum.com> <20180407234812.2bf2b24b@gandalf.local.home> <20180408084717.62ee4f9e@gandalf.local.home> From: Zhaoyang Huang Date: Mon, 9 Apr 2018 08:56:01 +0800 Message-ID: Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN To: Steven Rostedt Cc: 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 Sun, Apr 8, 2018 at 8:47 PM, Steven Rostedt wrote: > [ Removing kernel-patch-test, because of annoying "moderator" messages ] > > On Sun, 8 Apr 2018 13:54:59 +0800 > Zhaoyang Huang wrote: > >> On Sun, Apr 8, 2018 at 11:48 AM, Steven Rostedt wrote: >> > On Sun, 8 Apr 2018 10:16:23 +0800 >> > Zhaoyang Huang wrote: >> > >> >> Don't choose the process with adj == OOM_SCORE_ADJ_MIN which >> >> over-allocating pages for ring buffers. >> > >> > Why? >> > >> > -- Steve >> because in oom_evaluate_task, the process with adj == OOM_SCORE_ADJ_MIN will >> be suppressed by oom_badness, but with applying your latest patch, >> such process will >> be selected by oom_task_origin >> >> if (oom_task_origin(task)) { >> points = ULONG_MAX; >> goto select; >> } >> >> points = oom_badness(task, NULL, oc->nodemask, oc->totalpages); >> if (!points || points < oc->chosen_points) >> goto next; > > And what's wrong with that? > > -- Steve I think the original thought of OOM is the flag 'OOM_SCORE_ADJ_MIN' is most likely to be set by process himself via accessing the proc file, if it does so, OOM can select it as the victim. except, it is reluctant to choose the critical process to be killed, so I suggest not to set such heavy flag as OOM_SCORE_ADJ_MIN on behalf of -1000 process.