From patchwork Sat Sep 18 23:39:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sultan Alsawaf (unemployed)" X-Patchwork-Id: 12504053 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 62B62C433F5 for ; Sat, 18 Sep 2021 23:39:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC48860E9C for ; Sat, 18 Sep 2021 23:39:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EC48860E9C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kerneltoast.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 2511E900002; Sat, 18 Sep 2021 19:39:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DACA6B0072; Sat, 18 Sep 2021 19:39:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02B64900002; Sat, 18 Sep 2021 19:39:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id E30346B006C for ; Sat, 18 Sep 2021 19:39:42 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7FD6D21960 for ; Sat, 18 Sep 2021 23:39:42 +0000 (UTC) X-FDA: 78602313804.08.547915A Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by imf14.hostedemail.com (Postfix) with ESMTP id 269BE6001982 for ; Sat, 18 Sep 2021 23:39:42 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id f129so13547187pgc.1 for ; Sat, 18 Sep 2021 16:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NyjJPH0yWwRNiBCx2+K7AQlPL3GeoPPTkMMh4PEMJGg=; b=oNnwdDV9G1cuZt4+7Pv87ODBrobfZ0zDBsgGmNVG1AO9LojUUIo/S/n7RF4W2Gx59U bOW6rNakaOPogdOpghUbbNJ5I44v8//NpdJPRk1ewQH5E/uKu0s46gQAKoAt59npEp95 IPLJJnLLaILUM9A4F79BPL2YRDgmUDAHHVy3lScJO+Gi+9TiDnlN7dbyOD0UTShLZCeK OZdIpcgXiS2NgDtSLclnu6HnX17y1eG+BtAk8JeCvNWEsuP5PfD20Ks8y4i1qSI+sDnz ubAycn6bjX5H/po7V1awvio29qe3PIs6alCLva4talhgC3cXsJx+Tm7AB5d3L2fzAiB2 vg7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=NyjJPH0yWwRNiBCx2+K7AQlPL3GeoPPTkMMh4PEMJGg=; b=6iyAoF3/Ph4Qnp5DDCWDLtzKZJ/NuKGw3HEXjncnQ5cVl0sMtvbTAASk45RMcMlJvg We4A8HWjPktpNO0YLJppDnFW7pi7k7r37r/vVdOpMlR1LJkp1Q+0KOm33KTb50ZKyJrI epDr2wK3DyMVAb0zpON8v1/nVmzQ8Mq+gG04+29723BudppI3E2eEhOIklCI/0ASwplS UHbflZE+mYBHyEZNfVzbuXJ/42lyYDHnLe4P5tTaMN9bYzuloU0JVdmR2MuKi/Db6sai YzLBj1Kl4nXTl21MmXtqgFEmdI/2W1tThn/dioFSNGCXMSoqGe4W391a4rl0RUNt4rxG yPSw== X-Gm-Message-State: AOAM5332WkX5jxKnaEyY1s+c4snYyj3bO1Jyhbgfi/6mgVAG/+3LMJCg 5oRA5X9OblvZujtvF2UKpRs= X-Google-Smtp-Source: ABdhPJwEuk9elTXcN348LxGvPBO93RYvG7K5IKAKFfLVUGJGAK45o3W4b3SqKpRlCKVUzt6AeeV9uQ== X-Received: by 2002:a62:1b07:0:b0:438:db92:6db0 with SMTP id b7-20020a621b07000000b00438db926db0mr18269679pfb.29.1632008380989; Sat, 18 Sep 2021 16:39:40 -0700 (PDT) Received: from sultan-box.localdomain ([204.152.215.247]) by smtp.gmail.com with ESMTPSA id i1sm11981696pja.26.2021.09.18.16.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 16:39:40 -0700 (PDT) From: Sultan Alsawaf X-Google-Original-From: Sultan Alsawaf To: Cc: Sultan Alsawaf , Andrew Morton , Michal Hocko , David Rientjes , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: Mark the OOM reaper thread as freezable Date: Sat, 18 Sep 2021 16:39:20 -0700 Message-Id: <20210918233920.9174-1-sultan@kerneltoast.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=oNnwdDV9; spf=none (imf14.hostedemail.com: domain of mail-pg1-f177.google.com has no SPF policy when checking 209.85.215.177) smtp.helo=mail-pg1-f177.google.com; dmarc=none X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 269BE6001982 X-Stat-Signature: kuseznomeywcp6statujo86ys8r78j7p X-HE-Tag: 1632008382-146336 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: From: Sultan Alsawaf The OOM reaper thread uses wait_event_freezable() without actually being marked as freezable. Fix it by adding a set_freezable() call. Fixes: aac453635549 ("mm, oom: introduce oom reaper") Signed-off-by: Sultan Alsawaf Acked-by: Michal Hocko --- mm/oom_kill.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 831340e7ad8b..46a742b57735 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -641,6 +641,8 @@ static void oom_reap_task(struct task_struct *tsk) static int oom_reaper(void *unused) { + set_freezable(); + while (true) { struct task_struct *tsk = NULL;