From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 3396F36196E for ; Thu, 13 Aug 2026 11:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786620579; cv=none; b=cwfyFFryZDo0O194CdLvL9U2b+o9rb5nVKLTotzbt8nJrwUtKV2IqqGIOvssfvfU5UMbSBosF4J8wSEWfwbl+LzdLQ7XAmxLaz2g1an5fZqiJKvmgt76uCW3rFLdqnsQICh1JWWECQ995PDA6hW//i1fQJibObzXuNBp4pgF1EY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786620579; c=relaxed/simple; bh=j+QmVnPZGFnw3yEaEvw78V+r5T6WWqWA7HYe/4d2TSA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e1O3Mo6sPHrXXalwGvy5VsmEnfsk26g/YWaHzDmQoiy0zPH9VxfE+nl5x8k9Ds0+XUAlaVa9T3h4yQ3TqpVxAUIG5d3qe1olfZ1SwCHqI+qiLgvUoM/h+GniZ2PGKUpTtXqvx0rsFNLxZli7EOFX+XTmTgkM+m/7/Ts6hS3x4SY= 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=AEGyk8yb; arc=none smtp.client-ip=209.85.128.47 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="AEGyk8yb" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4995b0343c1so5831435e9.3 for ; Thu, 13 Aug 2026 04:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1786620576; x=1787225376; 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=suWflRf8BDwu3SlHTCcacUX0f/oCtM4GLGeZ1g/af2A=; b=AEGyk8yb2m9p/bgCjc/UQGau0ZPOCkBZpp8RFHBZTeOLIBxKrxhWtbYNgxo/icQGJZ 2TdRENr7o+1wWJZjvVRcACWKQU5lGuzyFCQwML7ly/29P2EJqec8otuthr7D89AJ63wG bwQpfqO/ShjQlvUCvX6ZDnqQBOMaxGxxOf+peXt3Qi07vSWjTNH23A8s4aPuarPWi780 lt5TmVaEx04BcKbZqTEkXo6fn+AskqJHW63GvXaANl7g/j8GRLZ/oo51HCNqk/u8r2Hx VWcbAMUe/yeBdaGrRyqF60sNH+f9D+MY4zSVMNzhfTDa5Nl5CAz5BpjLNK9ZAusz4+jn EviA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786620576; x=1787225376; 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=suWflRf8BDwu3SlHTCcacUX0f/oCtM4GLGeZ1g/af2A=; b=Lw05LsNLaSB3L9RjXFuFThnaRzmM18S82GTiAzZMwcFpY/h5+3SORhRAN7Hl1HT9Sk UMtHjP65gc5B25OjYqbrPlyMMkiWNStv033iWttMkFU3ul2C6gGbpVKNzAXqDR6Huh4M ikwEsJLF8MRTZVevGJJKHF84zFMrZR1ZDyKPziNeZbjUiDBEtMbmeu4Z/B0L6d0rz6Ry T4/49CW44pz7rC0xnvs46IULhXwttq9/Qb/vq0AT9SPleTaHgBcmUh1OlNA+A3FpSw19 BqLQWVVO2bz3+6nn2OkJIZif+J51dy6SRcIKOCchFmueEvg6sbquQOV9mQqGXB+6xKS7 Ncmw== X-Forwarded-Encrypted: i=1; AHgh+RqOIk+Ac0nPZgzk1TpqvEtGW/GT23ShdicYBCZeXE1hMeSqWlb7+sOITxv4KxcXqPncH9mXuDot7r73xRY=@vger.kernel.org X-Gm-Message-State: AOJu0YwOjOKJNCLo7n5KEcdc9NT+qFzQMMi0VVUKMUA+n/mz+fbW5BSt tkrz7JaMm87b1J388b2cB0NuNzllvxt3H6RBf2TOyhR69hp3upirIAKb7qNSg4WTbCc= X-Gm-Gg: AR+sD13BBBJomT9mObxK8bMFWRFSf5xTG7Uy1JwHuGPjjWv5QBUxECS7U5esVF86+Vg ReMXPNw849MNX+2sJbDI3zY5EEroJMbkCUGINYGSPzNHGnbpFEWRYgOdJ8Sq0V7zukuYL/+3mlj 8JpOQCC206pKpAO8Z8uqRIGBtiRKZHACTzUDf3CK0w6kgxJjRlwsqIdLQpCcfNH8JXLvAFAJD+S Ix1oyd+k4pg1/V/jPMw3oHqrNCTKNk7ljEW+wVj4SryT/DONSzNOhGvgnUCJ9DpVAtRMOOKoG3k A7QpH8Z7PF8JG9ZLfp92ef+3cgV7ufXMclDur4CGMkSI5a/SjrOnLnRS+d0cb9qYqamVjwvwVO8 hIgGeD+5rRKVEkHsB3PgccySTkr01xKKZ6CoBVfUTIsCQ0Iln4stSPyCqYa7QYKueUnPCW+jTmD U0NNa1gbny5z5J5WvYWeOExZSaNhcFacpdEYIVApNrc5lGjh13iHQSVyoIgXDoL+pxrAM98iQ= X-Received: by 2002:a05:600c:1988:b0:493:c47f:3c55 with SMTP id 5b1f17b1804b1-4998215e5f2mr62599095e9.5.1786620576357; Thu, 13 Aug 2026 04:29:36 -0700 (PDT) Received: from localhost (109-81-29-60.rct.o2.cz. [109.81.29.60]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49981b03e70sm68907325e9.3.2026.08.13.04.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2026 04:29:36 -0700 (PDT) Date: Thu, 13 Aug 2026 13:29:35 +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 v2] mm/oom_kill: remove unreachable __GFP_THISNODE check in constrained_alloc() Message-ID: References: <20260813093810.573302-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: <20260813093810.573302-1-ye.liu@linux.dev> On Thu 13-08-26 17:38:09, Ye Liu wrote: > From: Ye Liu > > The __GFP_THISNODE check in constrained_alloc() is dead code: global > OOM is never triggered with __GFP_THISNODE (blocked in > __alloc_pages_may_oom before out_of_memory() is called), and memcg OOM > returns CONSTRAINT_MEMCG at the top of the function before reaching > this point. Remove the check, its stale comment, and update the > following comment that referenced __GFP_THISNODE. > > Signed-off-by: Ye Liu Acked-by: Michal Hocko Thanks! > --- > v2: > - Remove the dead code directly. > - Link: https://lore.kernel.org/all/20260813030654.320269-1-ye.liu@linux.dev/ > > mm/oom_kill.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 5f372f6e26fa..fd3c476846a3 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -267,18 +267,11 @@ 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. > - */ > - if (oc->gfp_mask & __GFP_THISNODE) > - return CONSTRAINT_NONE; > > /* > - * This is not a __GFP_THISNODE allocation, so a truncated nodemask in > - * the page allocator means a mempolicy is in effect. Cpuset policy > - * is enforced in get_page_from_freelist(). > + * A truncated nodemask in the page allocator means a mempolicy > + * is in effect. Cpuset policy is enforced in > + * get_page_from_freelist(). > */ > if (oc->nodemask && > !nodes_subset(node_states[N_MEMORY], *oc->nodemask)) { > -- > 2.25.1 -- Michal Hocko SUSE Labs