From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A032C433DF for ; Thu, 9 Jul 2020 09:01:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 47F572070E for ; Thu, 9 Jul 2020 09:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UyLQq+5Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47F572070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B33366B000C; Thu, 9 Jul 2020 05:01:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B09536B0022; Thu, 9 Jul 2020 05:01:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F9176B0023; Thu, 9 Jul 2020 05:01:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id 8AEA76B000C for ; Thu, 9 Jul 2020 05:01:44 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 27FDC8248D7C for ; Thu, 9 Jul 2020 09:01:44 +0000 (UTC) X-FDA: 77017944528.25.end95_0d0d70526ec4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id E5B601804E3AD for ; Thu, 9 Jul 2020 09:01:43 +0000 (UTC) X-HE-Tag: end95_0d0d70526ec4 X-Filterd-Recvd-Size: 5255 Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Jul 2020 09:01:43 +0000 (UTC) Received: by mail-il1-f196.google.com with SMTP id r12so1402353ilh.4 for ; Thu, 09 Jul 2020 02:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=55x0UBIPkk2Krfx/KXzHrVaxKqeYZGh5rVc+isvPSjw=; b=UyLQq+5Zcvypue6+lOGoyOhePqCq/gCp2ZErd7RoeDuVOS95ZAqcftovuOcrSr/K+a 3vYLElrqp6O/jDNnk+q+ULcdqHsryivU4lMXiMWwAHN6mgiXK8yL0R1wMOmB7ofTvn3k qF0C9ydQZqjToD7Gt3BAEpppprHu0kqXTvepj/BQAQlAJnywrsGyZUahpWSfVhuJ6PHa wiegYy6r2MynMfaLhy0Ea9KENHP9qwuqrKcqHHDFB7WWhtoEb5gP+Ti5hDf42ViH1WaT D6wJqIrHkywfxvtbSK7GNH5ISxwQKoM9+dP87tHzsDnFcqNuqShrUqqlbaPQVWfGlvgG db+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=55x0UBIPkk2Krfx/KXzHrVaxKqeYZGh5rVc+isvPSjw=; b=BYIHIN2bWFIw632HjuT9ycyJMdE3sDn3IGkMb8XKul6wdFj9+Dmm0jsbylzQgyt1Yr is+w5WxsV/aEX8fxkDthTyLZWWOGtCBe8d0i1AqHZWHM9ZxrgSIvYqCbS1gSOq15KkUV shZbHv0fwKMOSyroOSt2WMmksW0p56KnFqXIMDwkAcpZ8hNtCR7CVi0sFXI1uoEiYqCj GaSMLmyQAFfFxVCIjOI49RJL2YlNWzvKQEPYCxHVGZLZpyUnhOrWcT4C0XGItBs/dbSO wohr+kDs8T41/BXWSiA5EWh02+yT0mE67QKLwTxPHEdG1qzLYYQWYdgucc5DrSlhwvC6 hg7g== X-Gm-Message-State: AOAM532E23TY18IEc/vNGVu7izqdt1xCWwec+W0manHRALn6TQGs+lwm WcR+WwWBC1jFMGrT/s301RQp90pAyyD/nYMGBDs= X-Google-Smtp-Source: ABdhPJz6lyL1M32mjf3JxgiI/8RtiIq0VAeksFU6EQslv8TA2NBsE8hOamkfocpra4lgbUe+eVHGSGkkJYbAUnpueL4= X-Received: by 2002:a92:404e:: with SMTP id n75mr5224682ila.203.1594285302929; Thu, 09 Jul 2020 02:01:42 -0700 (PDT) MIME-Version: 1.0 References: <20200709062603.18480-1-mhocko@kernel.org> <20200709062603.18480-2-mhocko@kernel.org> <20200709081813.GD19160@dhcp22.suse.cz> In-Reply-To: <20200709081813.GD19160@dhcp22.suse.cz> From: Yafang Shao Date: Thu, 9 Jul 2020 17:01:06 +0800 Message-ID: Subject: Re: [PATCH 2/2] doc, mm: clarify /proc//oom_score value range To: Michal Hocko Cc: Jonathan Corbet , Andrew Morton , David Rientjes , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E5B601804E3AD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jul 9, 2020 at 4:18 PM Michal Hocko wrote: > > On Thu 09-07-20 15:41:11, Yafang Shao wrote: > > On Thu, Jul 9, 2020 at 2:26 PM Michal Hocko wrote: > > > > > > From: Michal Hocko > > > > > > The exported value includes oom_score_adj so the range is no [0, 1000] > > > as described in the previous section but rather [0, 2000]. Mention that > > > fact explicitly. > > > > > > Signed-off-by: Michal Hocko > > > --- > > > Documentation/filesystems/proc.rst | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > > > index 8e3b5dffcfa8..78a0dec323a3 100644 > > > --- a/Documentation/filesystems/proc.rst > > > +++ b/Documentation/filesystems/proc.rst > > > @@ -1673,6 +1673,9 @@ requires CAP_SYS_RESOURCE. > > > 3.2 /proc//oom_score - Display current oom-killer score > > > ------------------------------------------------------------- > > > > > > +Please note that the exported value includes oom_score_adj so it is effectively > > > +in range [0,2000]. > > > + > > > > [0, 2000] may be not a proper range, see my reply in another thread.[1] > > As this value hasn't been documented before and nobody notices that, I > > think there might be no user really care about it before. > > So we should discuss the proper range if we really think the user will > > care about this value. > > Even if we decide the range should change, I do not really assume this > will happen, it is good to have the existing behavior clarified. > But the existing behavior is not defined in the kernel documentation before, so I don't think that the user has a clear understanding of the existing behavior. The way to use the result of proc_oom_score is to compare which processes will be killed first by the OOM killer, IOW, the user should always use it to compare different processes. For example, if proc_oom_score(process_a) > proc_oom_score(process_b) then process_a will be killed before process_b fi And then the user will "Use it together with /proc//oom_score_adj to tune which process should be killed in an out-of-memory situation." That means what the user really cares about is the relative value, and they will not care about the range or the absolute value. -- Thanks Yafang