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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 15D64C433F5 for ; Mon, 20 Sep 2021 12:40:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4D79610A0 for ; Mon, 20 Sep 2021 12:40:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B4D79610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5AE1F6B0071; Mon, 20 Sep 2021 08:40:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 55C846B0072; Mon, 20 Sep 2021 08:40:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 472FA900002; Mon, 20 Sep 2021 08:40:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id 39F8A6B0071 for ; Mon, 20 Sep 2021 08:40:42 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DE89D2AEF5 for ; Mon, 20 Sep 2021 12:40:41 +0000 (UTC) X-FDA: 78607910682.01.4B92EB3 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf20.hostedemail.com (Postfix) with ESMTP id 765DCD0000B8 for ; Mon, 20 Sep 2021 12:40:41 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 2E820200CF; Mon, 20 Sep 2021 12:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1632141640; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=D+sTsm/QQvZLDm5RCwun3FTJYNW9+vVqCamEMpO1CSY=; b=DIBZ7J1XZk+XwQ4mWtTiP85s3RIiajX/B4peNtjwUwyF56rC7UA7gU+InyLC2EPqxHmKVs Bvl62XzpLcAPaMWGUPCrFhq+8JjR4kMlpYXSnWGJFtqKaL0rISMVbrbPTFJot3b54k1D88 3adrw0hd2KqlqDxZbtwcFkCYNZrsBz8= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id F40CCA3B98; Mon, 20 Sep 2021 12:40:39 +0000 (UTC) Date: Mon, 20 Sep 2021 14:40:37 +0200 From: Michal Hocko To: Sultan Alsawaf 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: <20210918233920.9174-1-sultan@kerneltoast.com> X-Stat-Signature: nemmkbmgppmi63hjwa3wdr1qa1z4qbh9 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=DIBZ7J1X; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf20.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 765DCD0000B8 X-HE-Tag: 1632141641-245009 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 Sat 18-09-21 16:39:20, Sultan Alsawaf wrote: > 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. What is the actual problem you are trying to solve here. 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? > Fixes: aac453635549 ("mm, oom: introduce oom reaper") > Signed-off-by: Sultan Alsawaf > --- > 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; > > -- > 2.33.0 -- Michal Hocko SUSE Labs