From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 7E0313E5593 for ; Fri, 24 Apr 2026 17:22:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777051338; cv=none; b=G0OZ55IX82vAoQwJM/W2Q4HTgqtTiqT5c4zbZoR6GwrQcZsO1RSxF51S0TKPRztvVQx0Lk0LaNL2bn4WFeJGHbt8KJ3Y1wpSFYGyr62znIMeLOcUTihgvwqkrxxxKDv40kPLdV3OqCdqW+otCMA0B5d06WVUPIQzNXJtMagVhD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777051338; c=relaxed/simple; bh=Pgz09n3UjBipX69jsZ9t/n4XPs7S713dshqgciYTaD4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uk7oblh54Uhw8Otu1u9R2skBB+Fwqz4DDsB0O7GQY/O4w4RP3BK35xXvClLR+9GAdeYZlJ3ocxa9qlFJV4Dp8kw2fsQqfoaLgE0aVFBq/TiqZ12InZQslnBTEeFRa0kqHjaXJ76q7zIUxw093HvO0Ql/gb6/RcD+d1RLMET75Ok= 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=ly0CcUC0; arc=none smtp.client-ip=209.85.216.49 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="ly0CcUC0" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-36146ae9dd4so6597399a91.3 for ; Fri, 24 Apr 2026 10:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777051337; x=1777656137; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nJpfQLhYCMBQwdjJS8K/XCMHtvPcHGNh9u8Wq145pxg=; b=ly0CcUC0Cn1cWUJyihfql0BqCg426VEs8LrEXPTbabG3NkFqy0uvQWNl2knwK/lkxU O0l+w9qvW+b1KuM29o1G2vujBo3Wg2rJPhoARhM9oWQvKpE7qeB8zT+PD8DotmmAhAhC ypz9IYbel6FKJ2X41k1Hx2OYzZYhCVyxEeDIN/neKgxe5aQ4Gl3jT73m4iiab29JO6W1 w01FHpLuNWoxN7NXwVzwhpHnaIh5EpZkzbHQr8rJXgdpmViC56dL2BGO1Yf+eb3HtpoT 0BgVLaTSl7dUPJPcY1BZci7SyxiufBUCEMdYOzc+FVCAxyI7+WXOmAXi5OCLkRbvkjjY UmBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777051337; x=1777656137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nJpfQLhYCMBQwdjJS8K/XCMHtvPcHGNh9u8Wq145pxg=; b=cxJSahm7rFTCgRDR21VB/QxjSv77Ds9h9KHl31HCKEOubmSlksVh7wBZt1xuc4omq/ OGOEr7TPkwNSdW5V/xuzUAuWBnrTzCC57d19YdWwWUJVEpo9c+ZyEkVZ/i4sCrhbrb7r u1Zd5fhMrRje/CqdveJ1sIDdmWbiAgGvY+Sen3fk7F8o877219Ry3GFqRFTovn1Jc7OO 1b2Tnv2hbwnfZTqdHUJHnboerNDVJ38JlJQATJEMmi9BLUVi8Oaniy8UWiwB++GR/M9/ nU7ecSr7ONYO6uKMmhYnj09qrAlnctx+WIoRUGdaCzrXwrjaFMzWvzFpwD/m8A5D+BaF v7Ng== X-Forwarded-Encrypted: i=1; AFNElJ92AgfUUUNyd/BiN+FcWLwOUtl5iGNfjzDvZ7nfzyOW0Qgl8l43uHEMxzZBagq26YjZ+IHejkydaKIuI8Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3TPGyWnqkEBABW/esXOY+diARGeNRFr3VF4Cy5Iiqsx7A2EHN P9L2lEYKfRZpDLujh4T3ok1hlHI3WWHEKNizbOFH9P8sRqt+7A8a5S6X X-Gm-Gg: AeBDiesmE8VjnkO7i8yGd6eGt3HWtAsn2j9kKvbKPOgq7FQ6hnTcMztDRQfalSCRVfz CdxPvzPDgvo9OfIYDe7ZUStX/sRlXIuC1nqMuFLJEr1Qf2LVy652L2dUuGuPpyaST0HFS5TsC2y 0q9yFYWFK2v7z0qOnOUqdsF33iqm4CutorRz/CI4YqVXn8frdM3Mh8Z4OyYOKKNrH6imat9r2Y4 cI3NWDIcmXv/kJL7JlRuHAvBCePUBnKqjbbyD7/Lt1vTTycJdFNw9dIkiZkzjYVluhlVTrb8Ptj qsJ5yaK5hQ+Btjhdp8PGqZbeDpVcF7FOozRYxzHuMwSZjfiTMYZIgguZgwrASotuFf6/1sGhnt7 jqlan5xYfbFm6N4S4wcBQnvOUTgYGLkxeygOgwjLDTd6jXkV5c8qmOfxfCtPwV7hC4MpgoJ0FNq Li6slYjA7u1ytuFxPPY9LgtLvMdt7RF+SiRI2sg1j0I8U19jtpJ0VldgSVM3PdsPw0fw== X-Received: by 2002:a17:90a:fc45:b0:35b:e4f8:7b2b with SMTP id 98e67ed59e1d1-36140468f71mr33021775a91.18.1777051336642; Fri, 24 Apr 2026 10:22:16 -0700 (PDT) Received: from tech-Alienware-m15-R6.. ([122.171.19.32]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3614186a52csm30673498a91.4.2026.04.24.10.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 10:22:16 -0700 (PDT) From: Sunny Patel To: akpm@linux-foundation.org Cc: apopple@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, nueralspacetech@gmail.com, rakie.kim@sk.com, ying.huang@linux.alibaba.com, ziy@nvidia.com Subject: Re: [PATCH] mm/migrate_device: Cleanup up PMD Checks and warnings Date: Fri, 24 Apr 2026 22:52:08 +0530 Message-ID: <20260424172208.11674-1-nueralspacetech@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260424065922.5f15ca8c88eaf8a02847af17@linux-foundation.org> References: <20260424065922.5f15ca8c88eaf8a02847af17@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sun, 19 Apr 2026 23:17:43 +0530 Sunny Patel wrote: > Remove the odd VM_WARN_ON_FOLIO(!folio, folio) usage and replace it > with a simpler VM_WARN_ON_ONCE(!folio) check. > > Drop the redundant VM_WARN_ON_ONCE(!pmd_none(*pmdp) && > !is_huge_zero_pmd(*pmdp)). > > Refactor the PMD checks, making the control flow > clearer and avoiding duplicate condition checks. AI review might have found a bug in the surrounding code: https://sashiko.dev/#/patchset/20260419174747.10701-1-nueralspacetech@gmail.com After looking into the AI comment found two potential leak. 1. The goto should be unlock_abort instead of abort to ensure the spinlock is released. 2. The pgtable allocation at the top of the function is indeed not freed on the unlock_abort path. Will add a pte_free(vma->vm_mm, pgtable). Since this patch is more of Cleanup on PMD checks and Warnings Is it ok if I send different patch to address this potential leak issues or need it in this revision itself? Thanks, Sunny Patel