Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796239400; b=w0la/rJxJ8YesMMKIzUmebgHUk01i+tLl50yKB4+WYYMK78lu959ecYqUoLCadOYeeI8 dymxOv9rpQ/M+kzM7sCwBb+SCHTvVxMBcCr2snglh4sz4C3qd2l+EXthmShJOg++yuYl+ rWzLEcDVGYu0HXYr0EWsxVwxqVeQlgH9Y541dcAo8gGtMrRaKDnuF0/WayuPteFL0U9+3 CpQydcMKOxqV3BHxqwgL831RjHgmGkExItJNmTgvmxsT73VaziJJ9UFkmGe587IbG7ofr /eay3TuCRPxKXIJ2wfF6W1lPNVmH5Q4KYxmeQZgxyoSHDAL+AaXjEiNXeBRJ19UO2nA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796239400; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=2oxQGKpd+Gg3fKYjowXQ4oHt9bIWDVvRp+Vfrju5wYA=; b=euJ2nrGnG0Q93bCrQrTCFhSJGktVriFtkYB5+BreMUdM63d/cBqgJJIOXnYqa2jq6oSd iOi69dLNOrsym5u2jd+g88jIFPeP3LBLTHG1c4e9xj8rJtgCoD84LgjBWQSiTybbF4w0U zW55BGTBvoDNHiH/Zp3gJj5P916+H/dDftxXEBwN1KjmULapPpMx8xgBV9bhdeanDTcCL 382fcQsYkqhpA9iCVKEHXlFF2DyYbRd3fRqzqnPKxN3hrLQ6OhkgGioUt4qB4k16WZyGS GCOfzOFbrRAdghWe5UKLmmvGzzersZjpkY2uVXUhWgc1zajaOQhywCYrMYpTorxcmgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=IjrxQQoO; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC472606A32F for ; Wed, 2 Dec 2026 19:23:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC472606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=IjrxQQoO Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4a2153c8525so107914515e9.3 for ; Wed, 02 Dec 2026 11:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1796239398; x=1796844198; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=2oxQGKpd+Gg3fKYjowXQ4oHt9bIWDVvRp+Vfrju5wYA=; b=IjrxQQoOI7Aw+38MT4ylIMDQ6t01GF9Fd47n3TXBdJ20mdL8cZF9Ia8wCmfDwzDHOd 6HURK50cusI10LxWebUtpvHBlspFALxEE8wFliwyU4z1WNUpl8C8CJ5SjOYT8gCR1P8b XDsTujoX2vRn/LlvYutu0UZ0xWKtbvkE+d4dxA2im3WX11Mw7dkfi0PYtpPTU+pDR7f6 1i46HLwZT0cVCkVNEkXOKdDlWIvwvgLSxJBwknpFYEg/aEPklU0QL3XL3DY1JAO5PnXp bYxN/UubDKUfhH5YyG/vprX3PecYROAvdJu7JbexTb4/yo7w++6Fzwz9+Q/yIZ9LP/fs gRkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796239398; x=1796844198; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=2oxQGKpd+Gg3fKYjowXQ4oHt9bIWDVvRp+Vfrju5wYA=; b=JENpTx3I4s2ISMtSMwY5LJQt4vvO2UOPWempBvKJ8mXYKr5nJ8ULcOYSPHe70y0DFJ 7RcxYzPyk99apTMAM3K0ZWCjizMs4CWC05QRKDImWKRtTKICqrpTNL++IbJd05oIN2Wv WAKH6SurM1O+w9wzY2aWGGu2+4VdtZCPopUhIEqp/TZ9/9++56SpxJp8sklPOB0V3KCz LUCNAAFRKNvkVWpD1wChSjK7tVBGpzbgdfpuo+XLxqfEX6gjb/iqEGnkrmVUmeKwl90X Zu3TpRFIg2avC+o7VEjQVGY+pscOyF4Xn6afHPZDxHhBqFSF6JTt65VEqLTzz1p3oXIo 8YYw== X-Gm-Message-State: APuU4Z99B/yuTUPrkkk2v/d2W5AOw/L8PsUIZJnizB9JbNoEpcWosZY8 YZZQnlmB/k3hMyEgSorwnvFTuu83sAvJgHebsj5M1hqh7j9izvSIe3bBLf0V+Bb5D72pMSTjn0a NwZsMCZo= X-Gm-Gg: AZFdTZcLgRaWTlWcnJ+t2tRLXOHxtpTIkju9QaduRdbj1k9UU/DSdMkcpQKng0aDrJc HLZE8kiyPWzeHA/4SFtcvC/hyy5dfoNhySIcavj6iYRqL5vgwzqd/X2aoHaeHv8boaW2fOa9J5F abFXcBhYDQCXnFQVQleANJ2p4EL0vTrr0ZMU/11WYzyDKWk+XjecYpyE9txzZSxrAMbOKYmFok7 mTH4kX6AOy64p1zzeWgsjl6RZYiWcO8Afp9/o6EfeJimvNYmCr1SLWbyLwz9PwcARhEMjXVa8Ip uhVeHVdyZkeL4FXIlsI1M0G1cGsiz+J8dsRqiShI80ujpgRlNLW0PpRSKC8Sy/0RCwjx0m6SQ5x NgZCTXiNZLlOF1Ht5QYuHSApFdekalzgFjPx3mdVWULFe/MYLtD8kyD/To92fuU7c9M+AIP035A /EnUV/uPY/8fQnE0nio/oFaU42AulR5DmSiiPaoBwzDsyyxRZFjC4ErNe/8IszC9EgrVxq3AI4e IUpE070KqnQxeAbi4V3iZao4L6s+yKt1C0FQ4moTiHnBxcPOQy6KCotYzxoIoSvgnaNrxSyr7n7 K8UNdbxum38VfMD6exBcik9XVbi+2Wf6YQMm5vc= X-Received: by 2002:a05:600c:4f16:b0:4a2:47:b79c with SMTP id 5b1f17b1804b1-4bb8882a66emr896978025e9.32.1796239398160; Wed, 02 Dec 2026 11:23:18 -0800 (PST) Received: from localhost (109-81-21-11.rct.o2.cz. [109.81.21.11]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe06edeb7sm7437195e9.11.2026.12.02.11.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 11:23:17 -0800 (PST) Date: Wed, 2 Dec 2026 20:23:16 +0100 From: Michal Hocko To: sashiko-reviews@lists.linux.dev Cc: David Hildenbrand , David Rientjes , Ben Gardon , Johannes Weiner , Andrew Morton , linux-mm@kvack.org, Chris Mason Subject: Re: [PATCH 05/10] mm, oom: thaw tasks sharing the mm with the oom victim Message-ID: References: <20261202095450.296675-1-mhocko@kernel.org> <20261202095450.296675-6-mhocko@kernel.org> X-Mailing-List: sashiko-reviews@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed 02-12-26 16:30:59, sashiko-bot@kernel.org wrote: > Thank you for your contribution! Sashiko AI review found 1 potential > issue to consider: > - [High] mm, oom: thaw_process() fails to thaw shared-mm tasks in > __oom_kill_process() > -- > > commit 342e5dd06461083fcf31f5a288fe32e31c789a6e > Author: Michal Hocko > > mm, oom: thaw tasks sharing the mm with the oom victim > > This commit calls thaw_process() on processes in other thread groups that > are killed because they share their mm with the OOM victim. > > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > > index 56e65fa1b08e4..aca0e816b87a8 100644 > > --- a/mm/oom_kill.c > > +++ b/mm/oom_kill.c > > @@ -990,6 +990,7 @@ static void __oom_kill_process(struct task_struct *victim, const char *message) > > if (unlikely(p->flags & PF_KTHREAD)) > > continue; > > do_send_sig_info(SIGKILL, SEND_SIG_PRIV, p, PIDTYPE_TGID); > > + thaw_process(p); > > [Severity: High] > Can thaw_process(p) actually unfreeze p here when mark_oom_victim() was > only called on victim? > > Because this loop skips same_thread_group(p, victim), p has its own > signal_struct where p->signal->oom_mm is still NULL, so > tsk_is_oom_victim() returns false for p's threads: > > kernel/freezer.c:freezing_slow_path() { > ... > if (tsk_is_oom_victim(p)) > return false; > > if (pm_nosig_freezing || cgroup1_freezing(p)) > return true; > ... > } > > When thaw_process(p) wakes a thread in __refrigerator() (or a thread in a > TASK_FREEZABLE sleep that enters get_signal() -> try_to_freeze() before > checking SIGKILL), freezing(current) still returns true if its cgroup v1 > freezer is frozen. The thread goes right back into TASK_FROZEN without > exiting, leaving the shared mm pinned and failing to avoid the extra OOM > kills or panic this patch aims to prevent. Correct. I believe the following should address the issue. I will fold that into the patch. Thanks for pointing out. I always forget all these details about freezer. I thought thaw_task would act merely on grounds of pending SIGKILL. Mea culpa diff --git a/kernel/freezer.c b/kernel/freezer.c index a76bf957fb32..61a4c1607743 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c @@ -44,6 +44,9 @@ bool freezing_slow_path(struct task_struct *p) if (tsk_is_oom_victim(p)) return false; + if (p->mm && mm_is_oom_victim(p->mm)) + return false; + if (pm_nosig_freezing || cgroup1_freezing(p)) return true; -- Michal Hocko SUSE Labs