From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 8AF5A2C1584 for ; Fri, 13 Mar 2026 01:18:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773364698; cv=none; b=OnAfa+69VWzD7Y057/P6ux5IzIgZ8JPAJsezOTbYRPdHohIxyQ606dfEPUBzghYfAvY3lgzJgPcH/VZ0C5moIMGovLgSRYJKwB53wcRbox3UqnQ2xXfU7BaF6w9g4t0v1UivWIRcUE6RuwaqrpaF4cE5DwSI7jFsYg/cttaiCZk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773364698; c=relaxed/simple; bh=GMZuR5kfdJV8UQPi7d7fORND/r34QVdtXWaMBojwNec=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AuSAOLU2M37wokNmpQr3LyzBV88Nvatha7YVKDoc8LpJqhIPWEVr9Rcw5cpslG6gHvdAu7dg4WtCQhst0edXoOpGNzMTgBa5oSKWS0U2L5jHnwH77HeAEMyiLw18LmvzLwDZKqAFAC1tcFSXjLxLWp+WOuvZGhIKOwAA3PtCqiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Oye+eS/N; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oye+eS/N" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b9704cd6951so168677066b.3 for ; Thu, 12 Mar 2026 18:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773364695; x=1773969495; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=G+7XsAoNKOaWOBAj10JuSqSpQXLhiG0oqQbVuG2+b/o=; b=Oye+eS/NvxAwNkBYiO6kYwxMR/tACjKA12XnSMP/lXqa9vqs0DUam2mK378Qx8iXsd AvuMzoloeLpLQSAIG8yMGpvaY6oFN/+nXoKUEsNG2qtOh2Wl5rwILwjtYk0yfeljrqUw dm0txxyx21cwOjdzFtAFlSJ3Zz3+ru2TGjrQUaGJ+5Q229jloVuTm6rPuuj7t3dacW2D 12ZFEQPbywjY06HjEnRaISuz5qTPbzsf7fSBf2RqeAOk6IDJi6dQk1iAYjtwM7jwbh36 pK4EDLOdLhA0GenTxTZROEvKfa6RlV1hicS9bSd4FFBHgaht1VV5uvH2efgLKyq5zcNb pc4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773364695; x=1773969495; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G+7XsAoNKOaWOBAj10JuSqSpQXLhiG0oqQbVuG2+b/o=; b=X/dEHvfLv7ldSADYtSrAynLjWSylN8dCURmx3faQ3dkUuD/WG3awbEVCY84but9VUj Xo2dLsNbP91Wv0ECi3Apljq1KC3uEwQSGha/QRlzVUuscXtPtoQBtniAnfvFhQN2it0c o0mGOlWWrsbsSaI6jy9D1ChBI51mIFJvIoklu8Br4SHTRB7YO3FAn4P80QYWIg2QJgo/ RqEI6NakHBwXiT32yaW36mfe/eb/YmWyg2OdCjtOp0+jWQp+ux+rYAblcmRSAOBRvFB6 E/ZDBqGBq4KI1QqBF196eX94rQMp9BTuRtMjoNcJRHqj1iZlcHnTyS6xC5UaEahGpw28 rIEg== X-Forwarded-Encrypted: i=1; AJvYcCViH+octBn+GKQsSS5q0e/hhb/PKsgcAu+jrCYVXdn1Nfsd4MT0mpzatWatVtNvcLz6yzbfWIkx5CTQTNU=@vger.kernel.org X-Gm-Message-State: AOJu0Ywgs4xZTJgiKS/hPYRaMsTCkKhEDWmPVWiU1augDZVvrDtz2/JB KfzoSJOaBc215HRiCesHewmgMsuj5wsq0gDpPkF9rYBCDtcXrmBbBvTd X-Gm-Gg: ATEYQzz2UPsh7v6Ikt2LE+Qooio6YbyyqXB4pq7KO6MqI3SPca5vQnptRxdUdh/0Uj8 k0WE5eIc7oVVkundobZK8C2KXjbvykH2a8+t/ETvjVs92wq0nex/K5+Ihx9Czm+pTUGDl3TduKU lc4q0NrjWMSWbZ/bl8r9tIVVvN19tUGNRvaCopoz9YzJihNbdO+TU1H1+G5DsD0TD0It2vqB7pD X4TwEsikH/X6hx0wI7zk3c7CDtJZNhLv+5UGI5wcYcC56hl3UR4s5XVkpqJHzPGB8MG/AxbW2Ki w0ATsHqwceuemcDuftInKsOgDorunxXCaio9SIopVfiFl6VrJ1zrAnGcyj4CC9O7pw6kv8yb7Xs aCdZsIa+tVA7Wy1XW4OuEV2ED5XdXtLr6Jbu2ln0vQK9Sp0TjyTPjPlJ80CxeE1wvu+KEmCgk0d 1aeKhpy4VrGrO+8sh6zMEYgpQdp6Vkobmv X-Received: by 2002:a17:907:9481:b0:b8e:d1f3:4744 with SMTP id a640c23a62f3a-b976540242amr69402366b.55.1773364694584; Thu, 12 Mar 2026 18:18:14 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b976cdb6936sm7941866b.37.2026.03.12.18.18.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Mar 2026 18:18:14 -0700 (PDT) Date: Fri, 13 Mar 2026 01:18:12 +0000 From: Wei Yang To: Usama Arif Cc: Andrew Morton , npache@redhat.com, david@kernel.org, ziy@nvidia.com, willy@infradead.org, linux-mm@kvack.org, matthew.brost@intel.com, joshua.hahnjy@gmail.com, hannes@cmpxchg.org, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com, linux-kernel@vger.kernel.org, kernel-team@meta.com, richard.weiyang@gmail.com Subject: Re: [PATCH v3] mm: migrate: requeue destination folio on deferred split queue Message-ID: <20260313011812.cdxu4ypbwyb3hiol@master> Reply-To: Wei Yang References: <20260312104723.1351321-1-usama.arif@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: <20260312104723.1351321-1-usama.arif@linux.dev> User-Agent: NeoMutt/20170113 (1.7.2) On Thu, Mar 12, 2026 at 03:47:23AM -0700, Usama Arif wrote: >During folio migration, __folio_migrate_mapping() removes the source >folio from the deferred split queue, but the destination folio is never >re-queued. This causes underutilized THPs to escape the shrinker after >NUMA migration, since they silently drop off the deferred split list. > >Fix this by recording whether the source folio was on the deferred split >queue and its partially mapped state before move_to_new_folio() unqueues >it, and re-queuing the destination folio after a successful migration if >it was. > >By the time migrate_folio_move() runs, partially mapped folios without a >pin have already been split by migrate_pages_batch(). So only two cases >remain on the deferred list at this point: > 1. Partially mapped folios with a pin (split failed). > 2. Fully mapped but potentially underused folios. >The recorded partially_mapped state is forwarded to deferred_split_folio() >so that the destination folio is correctly re-queued in both cases. > >Reported-by: Johannes Weiner >Fixes: dafff3f4c850 ("mm: split underused THPs") >Acked-by: Zi Yan >Acked-by: David Hildenbrand (Arm) >Signed-off-by: Usama Arif LGTM, thanks. Reviewed-by: Wei Yang -- Wei Yang Help you, Help me