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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 626E0C47082 for ; Mon, 7 Jun 2021 18:43:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E824961130 for ; Mon, 7 Jun 2021 18:43:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E824961130 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3E6FA6B006C; Mon, 7 Jun 2021 14:43:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BE0C6B006E; Mon, 7 Jun 2021 14:43:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2865A6B0070; Mon, 7 Jun 2021 14:43:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id EC6976B006C for ; Mon, 7 Jun 2021 14:43:32 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7BD27181AEF00 for ; Mon, 7 Jun 2021 18:43:32 +0000 (UTC) X-FDA: 78227801064.29.111C930 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by imf01.hostedemail.com (Postfix) with ESMTP id 7E2115001533 for ; Mon, 7 Jun 2021 18:43:29 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id z22so7630154ljh.8 for ; Mon, 07 Jun 2021 11:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9B3Sx0V5Yfw+vtWDBKV2BfxkUflJbs+2GKJxnszO55Y=; b=JVjhJug0KdhaJOBiBHpFvDeRVhgV0Ul6evOlc+aRMWWUbUNSFW3lOXdde7k4daaLg0 wQB/N5wqPD4Og71CI6zSqWbK+MK7XDWK7hlPbyCWMftSlB28YgyUOnLBPmIEw7uSj7Iv g0yyuf5bNvBLryh8AAgJrOY9yKHD7mHu1OcjGMaox/aRqja9dX0M/3ulloZ+eBBzEDG4 7V/A/7wVr/Ywi4+M1PHGyXhsbLxSIK+lfzoltUKaSntmOPcKM9oF59Qhc4KhTmcfJLvg ytDz4Y23NI5Sga5/V0sKt67h1p/blm/DkPGezDsTaYBfYimNV2DENBiHI2/mmhPt1eFb lt0Q== 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=9B3Sx0V5Yfw+vtWDBKV2BfxkUflJbs+2GKJxnszO55Y=; b=C90NDOzdz4XuQ01TuZqoehbbqoNhWt4G41qfXAaFqLbTBSm1zZv9Knm1zHW4ogietO i8xWNyZRd6ji0+Hu8l447D9NpulSIdv+dCLEuU7P9XEHTM9HLCDFF89CW/qgeSAucpks EsVgFyaSimn1gB6KoKMcqvnifRlIhpIEsX542vJTaub8mF7lX0HMvaqEoRsLyUkrb4+C pRKTyHilgLzntYMJetQ1SdYltwCP90d1bTuQ2ewlyoKkeO2AZrbptMAG0swK6GjDLNhu mZy1jyKIpmqK2RdpnR9qzQRGgKVynC7+dyR0rrVi7LjXOVSdgbxeh3tgZb5Zd/cQ/0Yg OOMw== X-Gm-Message-State: AOAM5317diSQXvzUanp1c+plTvcMwSeiA02kFkRdoh/+xat2iwILlLtm fjPcTjsg7nANnXEKN7BY5rl6r8llC1aUlTye00J4ug== X-Google-Smtp-Source: ABdhPJyvqnABqg6mvaB/IbD/smKfWMJZsFMwS1ZAqErX+JwSU0e7UktY4aOeeU9ILrsrfbcqpnXh5UkwWjrXTTlySGo= X-Received: by 2002:a05:651c:b1f:: with SMTP id b31mr16093698ljr.0.1623091410157; Mon, 07 Jun 2021 11:43:30 -0700 (PDT) MIME-Version: 1.0 References: <20210607163103.632681-1-atomlin@redhat.com> In-Reply-To: From: Shakeel Butt Date: Mon, 7 Jun 2021 11:43:19 -0700 Message-ID: Subject: Re: [RFC PATCH] mm/oom_kill: allow oom kill allocating task for non-global case To: Waiman Long Cc: Aaron Tomlin , Linux MM , Andrew Morton , Vlastimil Babka , Michal Hocko , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7E2115001533 X-Stat-Signature: eunsr4buwbnig7rau3nrsms34w6hahh7 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=JVjhJug0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of shakeelb@google.com designates 209.85.208.170 as permitted sender) smtp.mailfrom=shakeelb@google.com X-HE-Tag: 1623091409-603546 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 Mon, Jun 7, 2021 at 9:45 AM Waiman Long wrote: > > On 6/7/21 12:31 PM, Aaron Tomlin wrote: > > At the present time, in the context of memcg OOM, even when > > sysctl_oom_kill_allocating_task is enabled/or set, the "allocating" > > task cannot be selected, as a target for the OOM killer. > > > > This patch removes the restriction entirely. > > > > Signed-off-by: Aaron Tomlin > > --- > > mm/oom_kill.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > > index eefd3f5fde46..3bae33e2d9c2 100644 > > --- a/mm/oom_kill.c > > +++ b/mm/oom_kill.c > > @@ -1089,9 +1089,9 @@ bool out_of_memory(struct oom_control *oc) > > oc->nodemask = NULL; > > check_panic_on_oom(oc); > > > > - if (!is_memcg_oom(oc) && sysctl_oom_kill_allocating_task && > > - current->mm && !oom_unkillable_task(current) && > > - oom_cpuset_eligible(current, oc) && > > + if (sysctl_oom_kill_allocating_task && current->mm && > > + !oom_unkillable_task(current) && > > + oom_cpuset_eligible(current, oc) && > > current->signal->oom_score_adj != OOM_SCORE_ADJ_MIN) { > > get_task_struct(current); > > oc->chosen = current; > > To provide more context for this patch, we are actually seeing that in a > customer report about OOM happened in a container where the dominating > task used up most of the memory and it happened to be the task that > triggered the OOM with the result that no killable process could be > found. Why was there no killable process? What about the process allocating the memory or is this remote memcg charging? > I don't see a reason why this should be limited to a global OOM only. > > Acked-by: Waiman Long > > Cheers, > Longman >