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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE autolearn=no 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 0DD87C433FE for ; Mon, 20 Sep 2021 15:55:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAB6F61177 for ; Mon, 20 Sep 2021 15:55:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AAB6F61177 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 08C506B006C; Mon, 20 Sep 2021 11:55:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 014A4900002; Mon, 20 Sep 2021 11:55:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1E5C6B0073; Mon, 20 Sep 2021 11:55:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id D18AD6B006C for ; Mon, 20 Sep 2021 11:55:18 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 58EB92CBBB for ; Mon, 20 Sep 2021 15:55:18 +0000 (UTC) X-FDA: 78608401116.16.5757129 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by imf23.hostedemail.com (Postfix) with ESMTP id 11B8E90000BC for ; Mon, 20 Sep 2021 15:55:17 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id y4so15128224pfe.5 for ; Mon, 20 Sep 2021 08:55:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=J6jFxJJuT4Dtwqmcu5yYwgUvY5yux5mAiO+wx0G598Y=; b=PerowDK9yLOtzkuda4uWjyPz9N6Gsgye9G7Rd9xVz1RE1hbKw1+8UYmRilIVsQf/pO Q+BF8dQ3SeVhlkcMd0aWDuuAADdde62tayTK07rzmwUpBS2aBaC7X/OQ8a8w1hpov+Lm zyCmKMoTLR1mipj4XFr5NoiwmBrjwJThI6epS4oqwpqPO9/CByB02TOHd84hMBJqOnhY QYa3+d6mmuYKLSp+M1jcWotXRAMNlcmkuLnXAbhpZHDCHncPFeEVHCM9qnWLyZPvJHJN KmF4ABy7zeJ5YGNv6BnGB34O7YuskwWOMPvupTaIBDCAkGNyQzaomC32Phr5c1slJTHu 3MzQ== X-Gm-Message-State: AOAM531nPjRreL6qIlQ149uyDD1SPaYMy6nXWa4iq0Ks9nQf01m+aFP0 HTHaxXUGd0gF1ZNkqPl7Upc= X-Google-Smtp-Source: ABdhPJwPGOxfJ+V57SFYoxgpHJJ4/CVeutyP823krqlMz/AVcwyszW+yNR8Dwmj9/u/By+QOPChRJg== X-Received: by 2002:aa7:94a2:0:b0:447:ce69:7601 with SMTP id a2-20020aa794a2000000b00447ce697601mr2838614pfl.46.1632153317073; Mon, 20 Sep 2021 08:55:17 -0700 (PDT) Received: from sultan-box.localdomain ([204.152.215.247]) by smtp.gmail.com with ESMTPSA id t13sm13790293pjg.25.2021.09.20.08.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 08:55:16 -0700 (PDT) Date: Mon, 20 Sep 2021 08:55:15 -0700 From: Sultan Alsawaf To: Michal Hocko Cc: Andrew Morton , David Rientjes , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Mark the OOM reaper thread as freezable Message-ID: References: <20210918233920.9174-1-sultan@kerneltoast.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 71ecg3e7ko1tujf66zfa7ha65uhtnonr Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf23.hostedemail.com: domain of sultan.kerneltoast@gmail.com designates 209.85.210.180 as permitted sender) smtp.mailfrom=sultan.kerneltoast@gmail.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 11B8E90000BC X-HE-Tag: 1632153317-127071 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000871, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Sep 20, 2021 at 02:40:37PM +0200, Michal Hocko wrote: > What is the actual problem you are trying to solve here. There isn't any specific problem I'm trying to solve here; simply that, it appeared as though you intended for the reaper thread to be freezable when it actually isn't. The OOM killer is disabled after processes are frozen though so I guess it could be considered a matter of consistency to freeze the reaper thread too. Do you remember why you used wait_event_freezable()? > Freezer details are hairy and I have to re-learn them each time again and > again but from what I remember wait_event_freezable doesn't really depend on > tyask being freezable. It tells the freezer that the task is OK to exclude > while it is sleeping and that should be just the case for the oom reaper. Or > am I missing something? The task indeed doesn't need to be freezable, but the rest of what you remember isn't quite true. It tells the freezer to exclude the task only because the task will handle entering the freezer on its own. When a task sleeps on wait_event_freezable(), it will be woken up when system-wide freezing starts, and then it will try to freeze itself (see freezable_schedule() and freezer_count()). If the freezer bits here are undesired then I think wait_event_interruptible() should be used instead. Sultan