From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (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 F325D267731 for ; Wed, 28 Jan 2026 14:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769610111; cv=none; b=pzzuqUP0e5iWpMgVqTn7IIwpZ6mOaPtpiPkTuAiAoPvtHWFYUMealQIJwYgEAMGmOSMQ4XBivAs9Z3EfuGp/S1Qdsa5Xyj877EevZ8+5dLez+rN0v69n8xTEt+pokNhgm7xxTXixXoiGKKKFN9LpL3l4Ob4kHoUxzKNRr5y2yco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769610111; c=relaxed/simple; bh=zhfWj1IrgUZ63mHxugpYC8ANOdmzStBz/dvKdAHJx68=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O6Mf3gUjl1tOTN2SWkr2e8TnKF+dFFlq7MQEVbgph3yimZ+bySQB2tszl1s7G/0spxDUZuyB18/r1PmaJKAgTxjl0u8Yo5dSbqiwGS0vsL1cg2pAvQoArjApuo0g2GHWIkdYmIc2RY+0grBtvXuaHHmIgdY1eFNC+WBedCiEB2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=NP04pcm1; arc=none smtp.client-ip=209.85.222.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="NP04pcm1" Received: by mail-qk1-f194.google.com with SMTP id af79cd13be357-8c5386f1c9fso951567385a.1 for ; Wed, 28 Jan 2026 06:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1769610109; x=1770214909; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=JFnWufKdjRl1LzlNBH4foXwRJEqqXwbSTG5Sb2CxZBM=; b=NP04pcm1etjdsLAEKKj2uoQ8gkGx1TGwHDxNEjv5hRogvIIGZIuzR/+BHT6ZHSeECC ItRrALJBy5GCW9f2rdFdE8DphN8KyRjnH3MlwyTN4tJxCLKPzpbZdzkts+L0vVhzvcNU 8Nmfim7sliRNPbEcmWtRybj1Z33smLhybqtEHmEhV6pVd2zqUPXmbx3K5Y59vX7+2HNN Ytza0O5XIM9GrtSm3vHTqo/FOQUJYMltTOMipk8Zdprz7LqITJ+6jJV7anSH42vvlJA5 vsj3v1Qv7Hcn4qY9QLXnge5FfavFmiBq4ooGXaOEfNq9k9nxlbQ6V5yYQkvx60J9Uhd3 VymA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769610109; x=1770214909; h=in-reply-to:content-disposition: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; bh=JFnWufKdjRl1LzlNBH4foXwRJEqqXwbSTG5Sb2CxZBM=; b=IL0N19WBATVC4LuilL8kT4hlIjbufFN8ByRTOwPGD8MlR1rlNCnQUkSdmv+d/3EQg+ R022ih5SNeNa+/AZJKSDETgIb2j9zqTr8wlYqbi8jTXw7S3SDosPo0J//qD6vbqHK8hQ tncZfW+j6szA85tVGQQoWT/Vora5Z7MRbkZhIaa43pAoFUJV2DVvmcAIGAuxH4QCpAId c8NogVIPNXjL3JeQPjPm8QZoDIUzbaIL06O4H+V9ztvliGHQ13/jc37HpuCwmsZWH+9M KSxiYsCrCKh9G9zqSFYhRYOFLPdxx9IXItODkMherScplwvYlLK1u2QWzjhEpwEc6WMn RRbQ== X-Forwarded-Encrypted: i=1; AJvYcCV+YOQAVT/qVuYdu8nhtMuehMdlJl80rYzJUNq9cjBcgsGsyWqzJw3vULv7mzJ2itgyyX5gUBpHRTXgl/8=@vger.kernel.org X-Gm-Message-State: AOJu0YwnuCgr+z0ymNSQSgx9iPlK8fxmWb/X/nZutexXC8yZxqTAJzEr GLa6Bjsi4VYdKddtY8nQEz0GCMXdvxd3EJq2hs+U2/aoGcwFKO6nghF0dxW2FJPZpFU= X-Gm-Gg: AZuq6aLWfMMsNAD6i6kgVo8DgCQo1jPRQTiaSCcc6c8AYRNFtZq73Bv55yKbPaId9wb bkFxA269OsqAi06ZlISYTxuHnnLMsjKuOa7AwXafjNjy4KbB22ZLqaMA+J57yLBB2Zwh+G59ZcP ikFkXRnB1a1Tb57Iqr+IyLYX7sENeh6eeIU3FjRC6k1KpOa6cm1IcogJUwStU7pyCMSLsgIigXa fbVDXHcm3JR3n+zZyusuu0jnT2IcnDtY+RO29+mNMt22g7pt13NV9yYpi2t+WaCK8LG6KMCR0hD VZPaKnPKZ/lsZWD/f+o4nHK5dexF/E7569w6Nt5C1WZ6Pf+/jl+VnuBY+4cFlGAxhVyPZoG31za /+NUEyta+6RGnIg5/4q2rhhGZlEVBpMG2aG7zesqqTvpGV4V3vVlTnHP4mbsbSQGeoeZeJS5VdO UHZ3SHGP9fhoODpBEU9C3OG8VOZ+Ls2PjbtIJlDLpzh7ISn+PxdoTx+Abj/m3OK2OBJzmi6LKzV NyXgR3W X-Received: by 2002:a05:620a:5dc4:b0:8c7:139a:bf66 with SMTP id af79cd13be357-8c7139ac6dfmr250534485a.50.1769610108659; Wed, 28 Jan 2026 06:21:48 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c711d49c2bsm186932285a.46.2026.01.28.06.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 06:21:47 -0800 (PST) Date: Wed, 28 Jan 2026 09:21:45 -0500 From: Gregory Price To: Michal Hocko Cc: Akinobu Mita , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, hannes@cmpxchg.org, david@kernel.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, bingjiao@google.com Subject: Re: [PATCH v3 3/3] mm/vmscan: don't demote if there is not enough free memory in the lower memory tier Message-ID: References: <20260108101535.50696-1-akinobu.mita@gmail.com> <20260108101535.50696-4-akinobu.mita@gmail.com> 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: On Wed, Jan 28, 2026 at 10:56:44AM +0100, Michal Hocko wrote: > > .gfp_mask = (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) | > > __GFP_NOMEMALLOC | GFP_NOWAIT, > > }; > > This will trigger kswapd so there will be background reclaim demoting > from those lower tiers. > given the node is full kswapd will be running, but the above line masks ~__GFP_RECLAIM so it's not supposed to trigger either reclaim path. > > Any chance you are using hugetlb on this system? This looks like a > > clear bug, but it may not be what you're experiencing. > > Hugetlb pages are not sitting on LRU lists so they are not participating > in the demotion. > I noted in the v4 thread (responded there too) this was the case. https://lore.kernel.org/linux-mm/aXksUiwYGwad5JvC@gourry-fedora-PF4VCD3F/ But since then we found another path through this code that adds reclaim back on as well - and i wouldn't be surprised to find more. the bigger issue is that this fix can cause inversions in transient pressure situations - and in fact the current code will cause inversions instead of waiting for reclaim to clear out lower nodes. The reality is this code probably needs a proper look and detangling. This has been on my back-burner for a while - i've wanted to sink the actual demotion code into memory-tiers.c and provide something like: ... mt_demote_folios(src_nid, folio_list) { /* apply some demotion policy here */ } ~Gregory