Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1239162ybt; Thu, 9 Jul 2020 02:04:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTIVitnYfQQeSX2Gv+lkY5S2BNzkXwqYglLrleYA/Hr9FXmt3oqued79CngNdK9peO6lxP X-Received: by 2002:a17:906:fa9b:: with SMTP id lt27mr52763804ejb.365.1594285468581; Thu, 09 Jul 2020 02:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594285468; cv=none; d=google.com; s=arc-20160816; b=DBTIm0JUqlhIVzf0mWR5X7s3NBj+DmZKbr17r3mwz8B5MBoU99JiyoufhjRaT+aYSi M0kVzUMM34WQ58gfRF1/E1zE+gxjZEUlRlVUaS69119+aHUqyyilGtVK/fgQx662Cgy6 PToYkdy2eF/Igd8VMMaZmprC70MeNXhec8lORIa/SreEazr6GttFJlzh3CXAotxV3FDE K79HVjSh22iWVoZ4HpDVqqzSnl4tJWrnOoadlF0q+DqiK+BGhoY0L9QnpTZWHZph4YMk Gcd+BHDqfwqbeIt+jiRxl0WOzHBp7fLAeQb7pcKOKZ6rEPZSyCTGchsCFwu6CYF/yNEu WSPQ== 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 :in-reply-to:references:mime-version:dkim-signature; bh=55x0UBIPkk2Krfx/KXzHrVaxKqeYZGh5rVc+isvPSjw=; b=Ztyj3mL/SFjbQ0OvsNpHBTh9LvLytHgwBXRUo9GLO51PDKkaCEu1RB2H+EgIJZxdDv JTb7KR+C1M/gtTxmJMWAIIZ4qVWGbRGZPqtEiMfOLkVlZJxrt0rpVcMXaX2dE5l0/Rqa +4ljwxjM0+ks2JTXNd0G3YCNfcYMgRgi9+Ffd/OIkPYOodd85ewpko/Fg6oSJeKY4fxx Sqq7u6ESp1foIkljbgFIpcztpp0+D7TQTCBhweBfE8QQ4liPpB/I3mPvJlB1FhCICxzw MQZ+kul2fMMohwzW1ESf1F8DUtiJwvRMX/Y8cTHRVRrHD3pZ/6fr9SbNjgFV4kK3ObMp recw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UyLQq+5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m12si1513761ejr.298.2020.07.09.02.04.05; Thu, 09 Jul 2020 02:04:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UyLQq+5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726261AbgGIJBo (ORCPT + 99 others); Thu, 9 Jul 2020 05:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbgGIJBn (ORCPT ); Thu, 9 Jul 2020 05:01:43 -0400 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B5FC061A0B for ; Thu, 9 Jul 2020 02:01:43 -0700 (PDT) Received: by mail-il1-x142.google.com with SMTP id k6so1394364ili.6 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=qYqqMyuysg0ulOtGPG74oJi9iuXNdtELnscXFWSFfIELpfoD8oZD6fhvwBIcgxazHN kBTlarW8+2sQ87zmal8eJOiPe32T6rkjPR0jNl5leY3+2ex9NaSDHlRi68L0+mcZYdCS amefrxTv7aFAvGm978ZQuPue3GVsy/SWECxOi99SjEMOXrvQGjhbcjOIHaWPv/2tSk7l xxPERRFxxEgzRSWuD3ymeu41ApnIFdBDgkJ9wfF2oxV6k7gY62RWo94JdissS9OsHuaX /merI7oAFeP60Im5pgXoR5SCRw2EQpz/71WmkEjnnLct7CCgbyf7zUr6vGTszsx2/6bY Hcow== X-Gm-Message-State: AOAM530gjrapCRY+ekci6YOgJogzZoaMpQnn+adiVESmW92yaQmFGtOP jPOd11i1GTHu9gEDADdHSrA/npAexqz9/tnpz70= 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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