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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 CE017C47094 for ; Mon, 7 Jun 2021 16:42:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7FE0C6054E for ; Mon, 7 Jun 2021 16:42:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FE0C6054E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1889D6B006E; Mon, 7 Jun 2021 12:42:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15FAC6B0070; Mon, 7 Jun 2021 12:42:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0005A6B0071; Mon, 7 Jun 2021 12:42:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id C395B6B006E for ; Mon, 7 Jun 2021 12:42:58 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 62EE8DDFA for ; Mon, 7 Jun 2021 16:42:58 +0000 (UTC) X-FDA: 78227497236.30.55B3A81 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf18.hostedemail.com (Postfix) with ESMTP id F138C200107C for ; Mon, 7 Jun 2021 16:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623084177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eXX4QBwgXhnHy1g2ghKync/xPThQvIt5AbfFrJ16lew=; b=YaNviOGP3Y6QO+JEJmIaFpyFHtOh2YGkDHWhtYupUMLoyUbghN35zPxai7fkn5gnMRpCGa ihVXUOynMjSSJBRhjs2gkNY0UejBZwTpMZN3N2B/9kqdcOpQLrRDM3dOqBEboqS9+0QyOL 4zD3vKQGZc4d+MFUVPG0b1DDLzMCa+U= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-399-fWY9LSoGNEGxeSYmPZ9xTw-1; Mon, 07 Jun 2021 12:42:56 -0400 X-MC-Unique: fWY9LSoGNEGxeSYmPZ9xTw-1 Received: by mail-qv1-f70.google.com with SMTP id 2-20020a0562140d62b02902357adaa890so124200qvs.20 for ; Mon, 07 Jun 2021 09:42:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=eXX4QBwgXhnHy1g2ghKync/xPThQvIt5AbfFrJ16lew=; b=uW+2AVf0qC0TrK1khXU0UMpEeROzh59gguhrVkoO+lMhW08rTGH3zUglxmT7mx5pVg mmzvvAlYdhf7D3qJjQY0XrNUpX804jTZKOLD/a2YJEKbyspC09uTvfjgIgfjJEDLsenu RiBnEitcR12Temhqws0/PFvb1+ZSIizcbkEroQMYku0NiDZIlQrS7TQXU9eBw4gS67Ti vh/0h8s92ykZGFGDKDO2VxxYBirMi+amRTBYWfQ2HTlg4Wf0Ted6YqFE5UazFg/1yMc3 OqIhUDB/tKKrCIZ/bh6G75iqeg+c9kHAc4SIr1uaJnAIY4qNdBpjDVRANYRIZuDnPxo0 Rc5A== X-Gm-Message-State: AOAM532PZZAujU0kxUR9qLmKg5aqh2bbild5KPf1M1VrMtJtQzbXxCEo ECm93n/5NrK2sVbhbQfDZ1XN+6E9B8DKBMbrOrgSfcktY0RRMMg0kql8bicSlOnukk/q19Q+Jer +Xy9abPH/gec= X-Received: by 2002:ad4:458d:: with SMTP id x13mr11781784qvu.42.1623084175719; Mon, 07 Jun 2021 09:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwF9lNE9+upcMWy1zFhyI98fDYzgXAfplW+Th0aNYId2crCtqCvBdom2RV7sOqt0YeOHNGYw== X-Received: by 2002:ad4:458d:: with SMTP id x13mr11781772qvu.42.1623084175578; Mon, 07 Jun 2021 09:42:55 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id c68sm10022865qkd.112.2021.06.07.09.42.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Jun 2021 09:42:55 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [RFC PATCH] mm/oom_kill: allow oom kill allocating task for non-global case To: Aaron Tomlin , linux-mm@kvack.org Cc: akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, llong@redhat.com, linux-kernel@vger.kernel.org References: <20210607163103.632681-1-atomlin@redhat.com> Message-ID: Date: Mon, 7 Jun 2021 12:42:54 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210607163103.632681-1-atomlin@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YaNviOGP; spf=none (imf18.hostedemail.com: domain of llong@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=llong@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: kkf8cxg8huixaa7s3gs7jmagkehcu38e X-Rspamd-Queue-Id: F138C200107C X-Rspamd-Server: rspam06 X-HE-Tag: 1623084175-370892 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 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. I don't see a reason why this should be limited to a global OOM only. Acked-by: Waiman Long Cheers, Longman