Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2316960pxb; Mon, 20 Sep 2021 18:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuyAd3xQGtIrpHBdCjL29n/fiIJNZn1bGKMpjuSKPupF+34fvOjeHdrXfeSUtk4qc5HoC/ X-Received: by 2002:a50:bf0f:: with SMTP id f15mr18467065edk.196.1632188272834; Mon, 20 Sep 2021 18:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188272; cv=none; d=google.com; s=arc-20160816; b=Bmq29HPNxOyKR6u8WPTjoyYbLQIysHTGBilb5IpldDQctCMsbkrbRyBDpEbA2sx+s5 BkoFbNCs20LvpVrjnsEC9reH9Vh4s8Ba8X4N1IK9wwPSlvoSeHGKjz2q0aULf1CyYo4H bUXWLTk/IPwD4zFhq9XdD6kegCLWj3HWZU28AtqUBCWv5y1E7VeKvpsePDU4ynm3PJJk bG6OmepV7IEK87bpLCdjGv2XWbEz7gK7STmB0uekEPIoEaEsjxDFP/P66r1H2QoPx8N4 JfgSnGlOdn7RxV6Th9ahbFfDmQUSkRJWQ3WJ8OvEMuMHqAdKWOOx/0Rl+ihj2cxnY5tu VECQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=J6jFxJJuT4Dtwqmcu5yYwgUvY5yux5mAiO+wx0G598Y=; b=gORK7kch4BiGBJy8QzdsTgDT+1cPMIvSngrnqSzmls567khlSlUdVMwhZCNZH8IT6M 9gjvK9CQqT1z5XSkq7XbX2bCIiG6+CsdTXed9O+Qm6iX1KQRVmQKJNJmENdqzO4tAErS dSpn7JU6nz0SsJQDEs3KpMQE/fDgvYHJ3sEl3CY5VR0BIhAA+4xHmWUxinq2lDiYKKnp tSAFAq/gmebtW0s4aTxvflpgH63Tk+mH7UkeXeVbu1oACk1MF3+xzJNLpPXYrG6Xtl+4 5TW5HCX8okn98+ghWIO8u1f28l4zWW2fvpKGnpk6Vt6/1S1ElKQ6noem9Jx+PhoL3shv 9oPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a2si3425210edb.225.2021.09.20.18.37.29; Mon, 20 Sep 2021 18:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241752AbhITP4o (ORCPT + 99 others); Mon, 20 Sep 2021 11:56:44 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:45786 "EHLO mail-pg1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbhITP4o (ORCPT ); Mon, 20 Sep 2021 11:56:44 -0400 Received: by mail-pg1-f179.google.com with SMTP id n18so17785901pgm.12 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=goRMTi2Hjxg30SVQFKfq9+a5rq7fuY+/ayRWgPdRm5I22PvOZ682oqZw5wScH+vYma 2v4ILMQZgm7VZz5pSTz33VBncEu6FJtmYMRWM9V3H4hqDYNtVA+Rdmr/fxGAskzifzER 7A3uFWNc2ImUDKNqiFK9OqAy/Of0atyO7hL3pm9RtuQ5z2hpe/B/hKUulIxBd56mOtPy rErhkaSexcwSTsVacduoaPZtxcUPKGm/3OTxawLxIbwzR0tPUmLA9EzGgC/hKEa//6vu mtviv3ePZJwdn/Rr25frWd2Pq5I3QVQRzZcE7CAbQKZuhSRzpy1mt0LfmBH1lu5ErkWF Jvwg== X-Gm-Message-State: AOAM5300gDURTwUX/6DtLt9Df9SDon8GaWahCgvTaMoI6CYhJLl6D6UG FOCS5uU3ZxxffhukhWdUrfk= 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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