From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (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 E016E36F43B for ; Wed, 28 Jan 2026 21:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769634858; cv=none; b=rVbbrLMjsdKh8B3FjDxlX63BuTyNf45BB0sPPJ+N2RINSxCfkbCTIAmjJZ7iBVvXdCIo3Er7co25yPc/rgaraSU4rCMHD1jvI+rc3Q4r5rHtY8Y9W3dheptO3tXo1b73e0+nIVD5E18wtbxNCei+CJLqG7m8+gl1p0ESCb9QK6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769634858; c=relaxed/simple; bh=da9JD1YJn6XSolHgifWTXwdU+nHOiT0jUp3Nb+QT4f8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gnQ4eqertG4ZOnVAKpprtSNh1UkPVDqudlekWKJ0Q44ndoq8bk21/hXSLX3FmdCwx4HelL8cWRmsWPUJZdEpbg7WrSAsFxwNAq3amYMTFnXNkSCxSMK/tXnHQ5NXMVY/bkjj2mg2j3znHar93Izy6FejSWglnxKHan2IHR89OGc= 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=He5hsoEj; arc=none smtp.client-ip=209.85.128.66 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="He5hsoEj" Received: by mail-wm1-f66.google.com with SMTP id 5b1f17b1804b1-47fedb7c68dso2678835e9.2 for ; Wed, 28 Jan 2026 13:14:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1769634855; x=1770239655; 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=Hv2y5+eHgpdbyVWkOZYtB9y4CpO1vE2yqof3Vkhxaww=; b=He5hsoEjHJ3rNlEimd4G9Nz/hOReLnZz/Anim93KMexVIFsPEEF3mx4EdyhGSuxnAy RZUslN07/7/EGmGAKDWB1Roxk70iyFf0kRwVuo3U/NoxNMxFd1qXWbDVfrLeejQ7hdOx yXPzmuAivA/dNIVq2nHy5UZcfPhZEuz7OiQmcz8CxYUvyR3+/OOkiJyWRJ1cgx7vLxwW lurD+lWu0ySEnicxereqCiCwu9b/H3u4NF5Cnc8ze+S6nJSdFp3CrFeSF37jJPd6+bhS w80jzm3qF1zNA8AswHHum8N56Pggka2mdNKf9SOS502wM2xboMrUUp8JHTNDDxP0fXLe VWZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769634855; x=1770239655; 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=Hv2y5+eHgpdbyVWkOZYtB9y4CpO1vE2yqof3Vkhxaww=; b=saJHCkltjmcKziY1M+MdpAXyw/CtEVRb6hmnA+bXJlZWrySBTSru0rZnoqEDPKIkhK nKYVgsaEfa5SiwICMVmbc5N3DXGLpIg9IBD8sE+7MA4kKUfjVdLgYEbQgpOgnmYuAcII QTsvn3iRsqDWcy3MeWbY9O2UHovyrqAasknRxx5QdRRHX7kSuPJ+5IoA/rKMFkW/BJr0 BRgws4Q5B8oxDmz4UzkMOKj7fcZA7fhqyqBqL5znqERCPvGXfhvlP4FMoHKSZ45YZYEV THtYxf85mE3S6U2KnTTSmHJ/9t4KYBmL6OfUUkF0e9hUdK4C6APr7zC5buYBqpgOtewq Y8Zg== X-Forwarded-Encrypted: i=1; AJvYcCXHnJCJ38yjEusA9hUdPPkzc86fEemyvYgMAhG8FFOBeFqUmViJKkcrL8Rwq8RZu/pANlX0Nb7cFfo1/Yk=@vger.kernel.org X-Gm-Message-State: AOJu0YzzQdDfKLknrn8dFF+TrvaW7vXgIrJd1ojQDDgWK5N7fxvLOWDN 3KXdbvZbNIUVubOH1lAYUCCL+RxmKjrCSz/GY35Uy5wsfl5k/sLjGmGsVJ/PR3pRXgzuFZpJYIh pvrwG X-Gm-Gg: AZuq6aKSMNzZ6TFIurHvJViU4ux6u+Aud1wDmfZaWAtU4sAxSfH11JywHE7BUILGrVE WpCEJeHX1Ei8Wib+gwwR5VSPVsOpoQHEh6gVYm/BjqBhWIpgQcRRbZNo9vh3UJnhnLBabJKokEp sZMJw8R0N0oO7/QrngGxoP+nj4sc05FwytE8fY8LnlRIGZO/0tS4hm11PDQyEeaMBKsBoYBtEkv M4acJTA224ddNxiukvrxFL8RxCJfxaIHESIEg14nagQ2Znd7HvWOhMd93syktslOFxKiDylAc6x 87E0FQOU+qFfQEjxJWBM9m8gtgqBSNeHSx62pXNPTUlIoZqNcQnvsoPBWaldklKw1U1ti4LQlMb OOGJ2+nqj8FLZeUiQMHeRwybrr+xSvwtS0yX22VRvM7AP2/M6kJBth0oNTEjwFDyz3YFMw5ttaU BPztbEK2ANvsO9l2iw/hObPbBA X-Received: by 2002:a05:600c:3b96:b0:47e:e4ff:e2ac with SMTP id 5b1f17b1804b1-48069c60317mr95974885e9.33.1769634855205; Wed, 28 Jan 2026 13:14:15 -0800 (PST) Received: from localhost (109-81-26-156.rct.o2.cz. [109.81.26.156]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e1354205sm10054004f8f.41.2026.01.28.13.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 13:14:14 -0800 (PST) Date: Wed, 28 Jan 2026 22:14:13 +0100 From: Michal Hocko To: Gregory Price 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 28-01-26 09:21:45, Gregory Price wrote: > 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. Yeah, my bad, I haven't looked carefully enough. > > > 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. Agreed! > 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 -- Michal Hocko SUSE Labs