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 CE21C37F8AF for ; Fri, 10 Jul 2026 23:53:49 +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=1783727631; cv=none; b=prWhtgrhCVTbC+Gjqu4c0c4hhnHjp3tl6zdayz1a0cNrHCfnnj+ih0VmhXy2Mdt8+9SqkxeQzx7JJc4NOmEqyDKOfvucY06D6WML/Sw4PUXTKwoqMmBiuWZgZUYogwmWsN0+KCx3hfAtB9WY0QsajPVeL1VLAsk+TNpU67c9300= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783727631; c=relaxed/simple; bh=v8h3kqIQbux96mWHbYwBMZwMVqT+tf9n6EuPNQ0zoCE=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=P6OA1slQ1PL3zIfeb7RW3p/6x0GUio1KHKhWcEXZpuJ27B7qwf3Wp3PMvBP2N43zZeDcuADit33RNXFLVpPF06jPgZcNCjXzPSnor1V/A8uOUpjrHKGxmfE02ML2emWaDZzXI0y82kJfGSgT81dOJYeudUgu71gv+R33iia02ZQ= 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=REiuFs4V; 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="REiuFs4V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A52AB1F000E9; Fri, 10 Jul 2026 23:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783727629; bh=HVL+OWDjz7dR1B8k2mIwS3yFQn8TSeFYCxydqWdE8V4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=REiuFs4VZ8HBHgEuS8pPATEsHkD67CqvsVug2ISH3ua+FB7HXhRIT42SsJ522Cw+R 4RqPTXUcoSl3sv9Nx0CKFVeyB/CD/AOjA+DBcmQVnwjcj3BAB7XLv8oNxPSn2XhyYx Nb5shhdV5JTt0cIfb3ciLGYnVvFYGsDsaTGMTEZw= Date: Fri, 10 Jul 2026 16:53:48 -0700 From: Andrew Morton To: Usama Arif Cc: apopple@nvidia.com, balbirs@nvidia.com, baohua@kernel.org, baolin.wang@linux.alibaba.com, byungchul@sk.com, david@kernel.org, dev.jain@arm.com, gourry@gourry.net, jannh@google.com, joshua.hahnjy@gmail.com, lance.yang@linux.dev, liam@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, ljs@kernel.org, matthew.brost@intel.com, npache@redhat.com, rakie.kim@sk.com, ryan.roberts@arm.com, vbabka@kernel.org, ying.huang@linux.alibaba.com, ziy@nvidia.com, shakeel.butt@linux.dev, hannes@cmpxchg.org Subject: Re: [PATCH v3 0/3] mm: handle device-private PMDs in walk callbacks Message-Id: <20260710165348.cab6f58aa81b30e34d121d0d@linux-foundation.org> In-Reply-To: <20260710105557.1987433-1-usama.arif@linux.dev> References: <20260710105557.1987433-1-usama.arif@linux.dev> 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 Fri, 10 Jul 2026 03:55:20 -0700 Usama Arif wrote: > Since commit 368076f52ebe ("mm/huge_memory: add device-private THP support > to PMD operations") a PMD may hold a device-private swap entry whenever > an HMM-based GPU driver migrates an anonymous THP folio to device memory > via migrate_vma_pages(). > > pmd_trans_huge_lock() succeeds for such PMDs (pmd_is_huge() returns true > for any non-present, non-none huge PMD), so several MM walk callbacks > that used to assume present THP or migration entry are now reachable with > a device-private PMD. The results range from a VM_BUG_ON() firing on debug > kernels, to an oops on a bogus vmemmap dereference, to silently isolating > an unrelated live folio from LRU in the aliasing case. Added, thanks. I didn't add these as hotfixes - the Fixes: commit is somewhat old. Feel free to disagree with this! Sashiko went nuts over possible pre-existing issues: https://sashiko.dev/#/patchset/20260710105557.1987433-1-usama.arif@linux.dev