From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 3538B373C1D for ; Sun, 12 Jul 2026 12:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860432; cv=none; b=sNBn+vVp1DlRmk7JgiM2jRtgz44iyWSEBxRvGrIlWuTiy6bo/bti2rJYQCDiikwlQpblYkZ4FOMChuch8HxClRQ0bl0NU1zxBLVBoQ+mVlkkdVcddtq63Pu1cDsThjIhwg6jZeMRk8jWV4MkXV1ewbrBT9zFsstg63T4wY7yXeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783860432; c=relaxed/simple; bh=G6YgrJJIeaUz6k98Nm7aOEgiM7tjDBbtGbTUjrGpc8I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lWnDlTDGVXx3rTZR5OuhQ3uIibSCTjl7e5CTAAZ2R0ZQ3IjvRY1y+ls7jBiBxgfN7lMpbJ+rMgDOiMW4o7JqkhvdZndQC9MeY8QMO9FP7I/UU8u/QODJswAU+wDALMCJMe/TZF8GaUCu5nidv5g+aOAILuuk1XxtphVvBhEsBVA= 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=tuxdeAGO; arc=none smtp.client-ip=209.85.222.169 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="tuxdeAGO" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-92e54f8c051so131509585a.3 for ; Sun, 12 Jul 2026 05:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1783860429; x=1784465229; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=pm9nW7teOFNiy7UMYUIullioRRBzDlnrKfEE2/bnUaY=; b=tuxdeAGOnlgDSvzZK3ZaZ0gAhiehxf8fu5YkHB+Kx/zrwqeBL2PJra7BZC71jGMdMZ 6y6T4khsOer6z5lAOUOUb7bNtRwct4hGCloVRcbvjiNeUrWvF2ZvkyLxG+ZKjnU+x43Y 2LUSK5R/AZlM2CYgGvqkGv0XeOMsg/nvUMTWRrkqGXE8tvTYDHkJpTWbXCIpKo7lMi7z sApNRllqrPmLOEHWxHljurdYYv8ren1gVdI/vNgetkQ18l9a6ZmRYUzb6EaLDpQgpQVB /PNf+vBJGuHguGL/v++M6JzKa3vhldn+/QaqPOxh1trQgE+zEMP/67OlqGp8fZBvulnV vh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783860429; x=1784465229; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=pm9nW7teOFNiy7UMYUIullioRRBzDlnrKfEE2/bnUaY=; b=AmYf1o9snorIGbxlj0yMqR3/CyuUxihA4bpev+PTCv6T7tWdarMEkQOEE6NtLPGZK8 WtD+UOEcCc7ASG5LLyb0EmTp9OxybnmYun9RSVVccBG9jO6kXTH/k5tqMYYFZQ7+eI/3 3IxK82pG1lXXghSGsFyLo8aX/7zzpbe2m230B3VYWcrgluRN2nm9qr55eGEbZm4i5RC1 DOLeGhLOS+6Kq0e06CX2S99B2Zenod25rl6psSgg1tTU+78Y5NyMaQtXw8kOQyR3Fd7k C6U47cyBEJgRxM6Zfm6wfKBQ3mk6WOdzQlB7IR996U9gOxqjBiwGaDXXTxEIJGzV1zPB U4Jw== X-Forwarded-Encrypted: i=1; AHgh+Rr7nSs3DwHJhjhiH5U6fmLXYKN/Viq/9deOdAIkUQALk6pdBcCSjYtqrNdEgZ+jE0Z6odDk+0gVPUz5a2s=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0I5VR8qANxFiDLAL4Pjvlky/gAtIgo22MAh3ijVJ2rUNm/fsb kdRN5FiOW/0POI/iE3E9LiYFIKFIxvpERcSCgdukGHCOrBPL14B85b3IsscK+c5DbzU= X-Gm-Gg: AfdE7clZiHCYL3ifgtTVojM42nmyWYTbBmFAmmDevnjUeRTyuCRrQAxop5mlE96fc1a STIX23CrkVsdnVRNOEeIynMLYXPSL2iEd66tRXNBszKNb1TKEdhZ3CWML7fVFMisYG9aSwR+EdR dU/H8S507wQDETiIu9n3kuOvUi2dA8yjM7JqI8ukfbMBN+d2wMkeBgz8F9tdKZm65YgjfP737Fh V+dPIFq9qcwLREhnw58/veYWSLXsBYGiMrY5naZaQ/btn38fNV2MEvO/kVZHi5OLt+ZEi3Zv5yl xdNgpVNkCiZc0aC5roMMsNO+yaWvpfPVd3tFD7ao3QRgVB7E3MeJcEsflykchP4JobGq1RNOG4U w9n+S7cuiXUadieJXQ/25biZyWsd/VtBrmjBpGcIpCOFOnUMI/31vfvLVG93C3VGyjCPTIM6fyb bTAjH+DcfxxlRWmeqT2WqKGbwzZ/d7A38rQ7NAeeHb+5oM1Hdo+I6200mAAEXRzgTFWZqCqv34+ EH7v1s= X-Received: by 2002:a05:620a:318f:b0:92e:c117:5edf with SMTP id af79cd13be357-92ef2c40a92mr592338785a.75.1783860428981; Sun, 12 Jul 2026 05:47:08 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92ee5cf9d9bsm833767185a.28.2026.07.12.05.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 05:47:08 -0700 (PDT) Date: Sun, 12 Jul 2026 08:47:03 -0400 From: Gregory Price To: Usama Arif Cc: Andrew Morton , apopple@nvidia.com, balbirs@nvidia.com, baohua@kernel.org, baolin.wang@linux.alibaba.com, byungchul@sk.com, david@kernel.org, dev.jain@arm.com, 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, stable@vger.kernel.org Subject: Re: [PATCH v3 3/3] mm/huge_memory: skip device-private PMDs in madvise_free_huge_pmd Message-ID: References: <20260710105557.1987433-1-usama.arif@linux.dev> <20260710105557.1987433-4-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: <20260710105557.1987433-4-usama.arif@linux.dev> On Fri, Jul 10, 2026 at 03:55:23AM -0700, Usama Arif wrote: > > Fixes: 368076f52ebe ("mm/huge_memory: add device-private THP support to PMD operations") > Cc: > Reviewed-by: Joshua Hahn > Reviewed-by: Zi Yan > Reviewed-by: Balbir Singh > Signed-off-by: Usama Arif Reviewed-by: Gregory Price > --- > mm/huge_memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index c0892cc533a9..7ae21b006b68 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -2297,8 +2297,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, > goto out; > > if (unlikely(!pmd_present(orig_pmd))) { > - VM_BUG_ON(thp_migration_supported() && > - !pmd_is_migration_entry(orig_pmd)); > + VM_WARN_ON_ONCE(!pmd_is_migration_entry(orig_pmd) && > + !pmd_is_device_private_entry(orig_pmd)); I just realized, are there softleaf entries we wouldn't want to WARN on? If not, should all three of these patches just be something like pmd_is_softleaf()? x_is_softleaf() does not exist, just curious if it should, and not worth holding up the patch. ~Gregory