From patchwork Mon Jun 7 16:31:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Tomlin X-Patchwork-Id: 12303999 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 9F958C47082 for ; Mon, 7 Jun 2021 16:31:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 376AC61C81 for ; Mon, 7 Jun 2021 16:31:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 376AC61C81 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 9F9756B006C; Mon, 7 Jun 2021 12:31:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9827B6B006E; Mon, 7 Jun 2021 12:31:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D5306B0070; Mon, 7 Jun 2021 12:31:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 471CC6B006C for ; Mon, 7 Jun 2021 12:31:09 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DD305180AD802 for ; Mon, 7 Jun 2021 16:31:08 +0000 (UTC) X-FDA: 78227467416.05.262405F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf19.hostedemail.com (Postfix) with ESMTP id C013E9001E72 for ; Mon, 7 Jun 2021 16:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623083468; 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; bh=yvt56Lfcj27UjLgNQdHePTO4mUszW+U3ALSrn0EK+Vk=; b=e23VoG/+eA/SrwahrZM8SuG9GHtRDi/SChMHXD11VXSDEMk6wTq+X1ejpFECqrK/Ju4ndl p7nsIWXJ01i5SCkCQVqP4WQvVuj2gWQRr/ngm+QX374QVGT0k71x+FLZQRmaedw2IPHJ/m IH8W/KKn519ZSXTXI8YEYFZnnZ/vDjk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-JbdBoXPDO7ON1R88yns2oA-1; Mon, 07 Jun 2021 12:31:05 -0400 X-MC-Unique: JbdBoXPDO7ON1R88yns2oA-1 Received: by mail-wm1-f72.google.com with SMTP id m33-20020a05600c3b21b02901a44b1d2d87so96312wms.3 for ; Mon, 07 Jun 2021 09:31:05 -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:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yvt56Lfcj27UjLgNQdHePTO4mUszW+U3ALSrn0EK+Vk=; b=JvfPqxdZpkvlPsOsOet+ht5URxQ3dMMtZ6i4yN8EjNIfBE3+Wrb1kB49qB6EpRgbyN SxrnT6bgCLa2go7IQyklz5DSfTXcPV/Fa1ej7diKhTX3Lu388FoYfPAAVex4qdrTuO9I b/s4n0xpCsfG9WMlULim/o1SfG1dxA+gIm0W5HOXnYvDTxWNgCKuvYyV8yShl3ozzUDk VEMBNvfnQqVY9erW1+3Zyg8pQksGF1LV/VPQN1UuAj1DY6iIaUjr2FZEnjkM+gibL2np LUHKQdhk6Ad/Y2GzHq050GiPwLhMRYsfQ4lwvRzNWSh8ABwN3THBtuokc7jwWnApKDrU uj0A== X-Gm-Message-State: AOAM531m6fsIIPqVtZ2ltrm5hnhzEUUe5hyPS2VQysfWmE+4rqi1847K VpVuBYVCS7RFL+l8TSgIdqEcoApaC3PyLdit2elhvZgR2GyJneDiHvsGXQbD8u+sfMVGGmcmzcp Zd8dSPLzLsZWZRY0Vqc4CLsXe6Xp9CBMSWEhP1MCNXAy1FGKJwn+RQTU3K7Av X-Received: by 2002:a5d:4681:: with SMTP id u1mr10848241wrq.268.1623083464562; Mon, 07 Jun 2021 09:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYVWuq/Xr6iBgRtwyhimoId1ByqwNrBAXb7ir/Ets4DKU4nAa1oB1RN752sji7WzbaAbTXDQ== X-Received: by 2002:a5d:4681:: with SMTP id u1mr10848226wrq.268.1623083464398; Mon, 07 Jun 2021 09:31:04 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id o3sm17255344wrm.78.2021.06.07.09.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 09:31:04 -0700 (PDT) From: Aaron Tomlin To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, vbabka@suse.cz, mhocko@suse.com, llong@redhat.com, linux-kernel@vger.kernel.org Subject: [RFC PATCH] mm/oom_kill: allow oom kill allocating task for non-global case Date: Mon, 7 Jun 2021 17:31:03 +0100 Message-Id: <20210607163103.632681-1-atomlin@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="e23VoG/+"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf19.hostedemail.com: domain of atomlin@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=atomlin@redhat.com X-Stat-Signature: 693fmbinjc1546cqiswm76fdufmncekj X-Rspamd-Queue-Id: C013E9001E72 X-Rspamd-Server: rspam02 X-HE-Tag: 1623083465-263696 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: 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 Acked-by: Waiman Long --- 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;