Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2186687pxb; Mon, 20 Sep 2021 14:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/NTyk57T1f3+uA4qoJvTUpv1PPN/ASk+zK1fxJhVPI1yPpzRYqTVQpoY7trnYRbpZCqK+ X-Received: by 2002:a02:2302:: with SMTP id u2mr3764473jau.32.1632174081898; Mon, 20 Sep 2021 14:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632174081; cv=none; d=google.com; s=arc-20160816; b=gJkwS0CMmx77soncmcNga8iFGvmthGdsnVoFamTvyjO6n7LqImyjEA2unkjqLoqMC9 Iqcy9/S31ATT2mSWMJc2rNNZwM3SQKGwsskAdEcvdPbZws2j/FdspQOEt6wgF5rDyL0p XPtiWx3A6JKzJagZukxuVDeA6AEgQbT1HxqjBxq8e7EG9T+OKiUddEkYWKvjJ4V6mAe8 uo5v2v06yU2R5ZXChoupYaticbrgsSMY7GlUXYWu0PpPVfriyHK1a6P2yw9ssd+3wHum Z9tSMoYcrmnykJVEMpgbqCcUqWsZsDFPTVyxBkUM/omH1Xs96ySLjNZzNolIsRtlPKQk K2pA== 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:dkim-signature; bh=D+sTsm/QQvZLDm5RCwun3FTJYNW9+vVqCamEMpO1CSY=; b=qd4+EP21TAuo9KdUc1vN4uGZZiMidLJV3dA28Uzb2pDoxSKjk5PqMupvrB9L9371yP RqlFptlFsGP2EC6FWTN3VeVmv1o233nx7jcYmxSoOQDgjMekCshbNmM+ZmxUIxOhfWyF hPi41fd8vcIU5YTt4/bTpBAbbOENNtJLmUwK1fxxn1OPMBXvVIcyclXfXPryiWEs+1lV qRQrd+MHDluUh08BxQvvEkKwXL2A27FmYy6zmBk+ScroSiJlubsy+R7vfLSy6Lh0so7C 8EYltKsjpsCmWrTRm79x3Jhr9ZomRTGeM2ExKf/WMQK9g8G8OwZmTIKgCIgpeqK5KNjY Hv+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DIBZ7J1X; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m47si12494982jaf.133.2021.09.20.14.41.09; Mon, 20 Sep 2021 14:41:21 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b=DIBZ7J1X; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbhITMmM (ORCPT + 99 others); Mon, 20 Sep 2021 08:42:12 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37686 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbhITMmI (ORCPT ); Mon, 20 Sep 2021 08:42:08 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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