From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta0.migadu.com (out-128.mta0.migadu.com [91.218.175.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 677CC29BDAA for ; Thu, 13 Aug 2026 03:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.128 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786590429; cv=none; b=HWQEI547JbUNOO55LIG13HPzjjp9kADXnCzex1q6Ma8/09f6Q2TaivJZvSkn7ywm8kcwqXCfklRnO622XneEXYxIx7iJBs61jaisaP+VqYOLoAfpPBDuBKB3gD4qaLOw67Vpp/gzqeuw06PFR1etwDieGsuZRX5tEGWiuLtComk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786590429; c=relaxed/simple; bh=ttci0L82/KRm+ruQkSVERz6ZOoHOrD4BV9vjZHSrlTA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=jEeOp4HPfWyRd3/uOl/xB7qJ6Cdxlq+NMhKoL1gLFq2VcuRSzHH7Nqfl+SFGS5hcRIy/h+pc98H/e91Va95lUDKq6brAzmFPnD+VNzA1Xh3qvah4roRJfsew2Re606K5kbQw5KaVhGZpCzTc/O4gPCWlDAlQhlPhkZO0wBykvus= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=hNdQ83oH; arc=none smtp.client-ip=91.218.175.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hNdQ83oH" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=ttci0L82/KRm+ruQkSVERz6ZOoHOrD4BV9vjZHSrlTA=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1786590425; v=1; x=1787195225; b=hNdQ83oHHmH8q4zWZwRPiQaUcVuScST+MycjAYbOI3JP7Isa1+FARRR3MXw6cqh1cr7G8Njd AaM8Qdgh1dI97NORutxmLICcAOLJpeBnXdYtOT/QYLhCC2wDyZvFutUy82fTYEICbeKCQGbJmP/ vj5bFnCkpwBvy98b3mmYoHRE= X-Envelope-To: linux-kernel@vger.kernel.org Received: from localhost.localdomain (223.70.159.239) by smtp.migadu.com with ESMTPS id 421e72884223c082; Thu, 13 Aug 2026 03:07:05 +0000 X-Migadu-Flow: FLOW_OUT From: Ye Liu To: Michal Hocko , Andrew Morton Cc: Ye Liu , David Rientjes , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/oom_kill: fix stale comment in constrained_alloc() Date: Thu, 13 Aug 2026 11:06:54 +0800 Message-Id: <20260813030654.320269-1-ye.liu@linux.dev> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ye Liu The comment above the __GFP_THISNODE check in constrained_alloc() is stale and inaccurate: it references __GFP_NOFAIL (which is not checked here), claims the OOM killer does "random task kill" (it uses badness scores), and mentions CONSTRAINT_THISNODE (which was never added to the enum). Replace it with a description that matches the actual code behavior. Signed-off-by: Ye Liu --- mm/oom_kill.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 5f372f6e26fa..4b5c70aaece4 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -268,9 +268,9 @@ static enum oom_constraint constrained_alloc(struct oom_control *oc) if (!oc->zonelist) return CONSTRAINT_NONE; /* - * Reach here only when __GFP_NOFAIL is used. So, we should avoid - * to kill current.We have to random task kill in this case. - * Hopefully, CONSTRAINT_THISNODE...but no way to handle it, now. + * __GFP_THISNODE means the allocation is restricted to a single node. + * There is no dedicated constraint type for this case, so return + * CONSTRAINT_NONE and let the normal OOM handling proceed. */ if (oc->gfp_mask & __GFP_THISNODE) return CONSTRAINT_NONE; -- 2.25.1