From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D670C3AE1A6 for ; Mon, 17 Aug 2026 21:34:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787002458; cv=none; b=PdPEB1we6ZDH1QfpxCxvFj08BNMqD/NUgmlEnnqjcvdtrOIdLEDl6I0H6wt9kk3SurfF3ZwnsXN9nhUI0zoy0l+fWvvvnF5lY4z1c+nNdixe34dFuHO1PrFHqB/W9TeYTyj/CU6EjpFTh+Nz6qZrgTxu1vZycIkyOBXpwM1Xk40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787002458; c=relaxed/simple; bh=trn8jwVQ7+J4WXnV7wjluyF+4lcDv3ZSr/Pe4WnBz78=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=bCmSwwMkdh/SdQWfiyyV7+lN3WBlnI8wfdozToXBfSdNrS4QCnGTmZfQFneDyouXakWnUJXiaQe8eN1cV5YXNY+wWGrVgzpIxpyW8RA6558Thy2dTLGrgY2BSOJh07NRFssLV6ERdA/fr4qkP/LsaHasDrD/jZ0dMIFtpZy511g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=NsUIgn8V; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="NsUIgn8V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18F4A1F000E9; Mon, 17 Aug 2026 21:34:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1787002456; bh=WQjvsR0htZRo4CCOSSq4xQt9hCGvWvKnzwfQzV5B36s=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=NsUIgn8VbdmC+39Tq3LQvej3JpwRFehOwuE7dvt9ybC6OLwBNz9KZYvARZh5M5664 Z1/k3tEEVvARkQmBZO9lNZvJOGoDouks8FeiCaUpb8plCUdIfjP5gCN9+ISyu+E0h2 Ufv8DJnbHqn/TRaC928KcRv1sRgQF4/P4jTMGo4A= Date: Mon, 17 Aug 2026 14:34:15 -0700 From: Andrew Morton To: Hui Su Cc: apopple@nvidia.com, balbirs@nvidia.com, byungchul@sk.com, david@kernel.org, gourry@gourry.net, joshua.hahnjy@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, matthew.brost@intel.com, rakie.kim@sk.com, ying.huang@linux.alibaba.com, ziy@nvidia.com Subject: Re: [PATCH] mm/migrate_device: fix cache flush when replacing huge zero PMD Message-Id: <20260817143415.60bedb09819d13a2dc0fbe63@linux-foundation.org> In-Reply-To: <20260817163646.929678-1-sh_def@163.com> References: <20260817090640.287a9a415da49e3974797aa4@linux-foundation.org> <20260817163646.929678-1-sh_def@163.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Tue, 18 Aug 2026 00:36:46 +0800 Hui Su wrote: > > > > --- a/mm/migrate_device.c > > > > +++ b/mm/migrate_device.c > > > > @@ -872,7 +872,7 @@ static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate, > > > > > > > > if (flush) { > > > > pte_free(vma->vm_mm, pgtable); > > > > - flush_cache_page(vma, addr, addr + HPAGE_PMD_SIZE); > > > > + flush_cache_range(vma, addr, addr + HPAGE_PMD_SIZE); > > > > pmdp_invalidate(vma, addr, pmdp); > > > > } else { > > > > pgtable_trans_huge_deposit(vma->vm_mm, pmdp, pgtable); > > > > > > Reviewed-by: Balbir Singh > > > > doh. It's a shame this actually compiled... > > > > Can we add some speculation about the userspace-visible effects of the > > bug? > > > > I'm assuming we should backport the fix? > > Hi, > > I took a closer look at this, there is no userspace-visible effect today. > > The architectures that currently enable ARCH_ENABLE_THP_MIGRATION use > no-op implementations of flush_cache_page()/flush_cache_range(). > 32-bit ARM has non-trivial implementations, but does not enable > ARCH_ENABLE_THP_MIGRATION. > > So this appears to be a latent API misuse rather than a currently > observable bug, and I don't think a stable backport is necessary. OK, thanks for checking. > Should I resend a v2 clarifying the userspace-visible effect in the > changelog? Yes please, after 7.3-rc1.