From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 1088E3A48E4 for ; Thu, 13 Aug 2026 08:43:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786610642; cv=none; b=W+Ycf05Ty5eN5HVRvwghRFkLFppa2vlEuEEjENfRJf7g7eCBTaQHGWSC5dW7JPsP1YkiC4sT7lWUo58cDftsFETy2+x13piJ0lKMe/1mdl6MHbMv0mUsOu7pI1ohmkuUDev19pj59RVfpUY0Uek1aLib2/yOIQPLCQamW5n7pqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786610642; c=relaxed/simple; bh=+1SJVMi1tlVqdq9iOWfnhWeHbbsmCNnut60WWjREPfQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RIZKqINeRNovhHpEKEQbXBZC/FFOHlLtIsJ7qKSWfOm5QnRlVokK0O0136HeDoOQVUNhAM8K+h/pzJahrEKaTAS1l4PVZwF+rcWDyysnY1sqHrmw/cU9Vw5ueS9qG1IUuZHbHZNgpF5lYPCu47Q+i5YMdIJeX4s1suOEcR37hwU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=BsnUmsww; arc=none smtp.client-ip=209.85.221.45 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) header.d=suse.com header.i=@suse.com header.b="BsnUmsww" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-47362928f65so1502962f8f.2 for ; Thu, 13 Aug 2026 01:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1786610636; x=1787215436; darn=vger.kernel.org; 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=sHK+naXZbSmTTgZbPVVRIfgMmPRkLSA26SftDb5zD4Q=; b=BsnUmswwACnkQbZC52gIPQ2tDYn2XngqXWGTodtHonVx8Fij5RLNBvYOhClmMtlAqc cQVCrzlS8M5u0O7Up/a63ffBVnaGapC1EQQNLP9H7Viv7et4Z3l/VxApG4Ka+hPAhnV4 PY1Y494CiG8v27mm5s8G0SC+iXIyRGobNvgiHjVVKpMwezq3snplEbkaa7Dvn+fWrNdT W4yGKBIMUHXkhi/1cUo7x043Rmo14bPvsk4sIXvAZgV46NrinilcQ27vtgJ9EWDIRZi1 +QjpkMA7eF6q8fyClIaHZ3vz/cIzsTL8Xki3HsqJl4Ffha+aefM5i18gryhgkSckUkSS ojoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786610636; x=1787215436; 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=sHK+naXZbSmTTgZbPVVRIfgMmPRkLSA26SftDb5zD4Q=; b=pcxeL5MnhwvaPqlAgElDSaBeDtRBVFNJwcXHzt2HTpZBz6lW6EV433kgKOBpPcVQL6 5p5eIggo9fXKn9/B9MkSVBMt88KQe04sLm5AhcIlax2rBXu2FS49F8+kleYep+iwwp8h lV6E2tS2HKzM0GvBsLvsxvax/bspPetzhwT4381TECxgssUS+Ok384PZH+2aPqwM/UXh FvfL6MShrxxn0i208LjQiWenlbwak3CI24GayUAp5QwB+vz/0nRqf928ELfe2btX6Sek ExoF1sWcq5NUVHLNOHtuvra5gqhnBP/r5WvTo3TFS69pifHSp650xXLxVDSg5EMMETov 7Xog== X-Forwarded-Encrypted: i=1; AHgh+RonLsva0N10PhCWnenjlF9S6C1de59gXJ4t6BqxT3nHcQV0VgU5+fnxf0WYohKhCuuI5MkzNmHyWNn/Bs0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxx8qfbR3tHedc8xpHbXGCGhqnyqd7aW9nIDnepo3G9GSxA/ExM sZCw4w3Ny4gq6nbndtNJVKqYcQjArx1k2wi0CdQGwQ+P/gUCmZqEUOz1e+f+zOn7fN0= X-Gm-Gg: AR+sD12vGJdehWaq2DqKraSzX7kLfd07+PGMXHi3ogYq9+8jYqhyXR1/WgxvFZNm3JN w9g75x7M8f+kw4NfU4NCsGSjfajEqCnKqOqddutoS7SSeYkKMdmffhdKmxGXI4PQ287OfW6NbVV r5zyuUZLPphlb2/hzneldD+PnOS+VMZfdopA7/v9q5RXK1AXtBvFNLkIKj8rKcNiMhnWVa3i2w2 L3mDG3t8Fl8b7pMf/fPz3pw/hw0xrGOmqQqWU21oI3dkBf+VVjt0qSqPcsgYClsTLAFr/5txOFO NwPZ/tih++gKc/Mj8MuAskNuPTOX8cGudhtWSojlvIjR1xYKwUk2+DhaGxpk8aJBbSsCH1RMGFg VvUg2V+k0UgbLORAGsnLXmsUCxKQLyXcKqdH9teTauyztqEWVR2m6OxlzJSahU9c6m0PB7mKvh7 K3lCoTrZ/kwi4UMuyoS6vIeL3ENESU5qtvWWMzeSFL7/y5g8ZHFeJE+Blj8BfRghkbwZsxj30zQ trOiiSLdg== X-Received: by 2002:a05:6000:46c9:b0:47f:eac2:6f55 with SMTP id ffacd0b85a97d-48159fe936bmr3901618f8f.19.1786610636477; Thu, 13 Aug 2026 01:43:56 -0700 (PDT) Received: from localhost (109-81-29-60.rct.o2.cz. [109.81.29.60]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a5af19fsm4618737f8f.24.2026.08.13.01.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 01:43:55 -0700 (PDT) Date: Thu, 13 Aug 2026 10:43:54 +0200 From: Michal Hocko To: Ye Liu Cc: Andrew Morton , Ye Liu , David Rientjes , Shakeel Butt , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/oom_kill: fix stale comment in constrained_alloc() Message-ID: References: <20260813030654.320269-1-ye.liu@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260813030654.320269-1-ye.liu@linux.dev> On Thu 13-08-26 11:06:54, Ye Liu wrote: > 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. The comment is indeed confusing and stale. Your update unfortunatelly as well. This code is simply unreachable because we never trigger global OOM with __GFP_THISNODE (see __alloc_pages_may_oom) and for memcg OOM __GFP_THISNODE is immaterial. > 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 -- Michal Hocko SUSE Labs