From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 2F7A83E5573 for ; Fri, 24 Apr 2026 17:33:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777052038; cv=none; b=Fgt/PuLpnx3GjFY7FipJ4Xan+NK9JG98CSA1lRgcwr5UOKrP/T26bWrr5fa9BKsEPPkERc1UvMHZtdgcxTBNfRXz1Y6OuZj38oC8/PMiaXONlmgguE9J7LLwzVXAu1+L7abSSdW4JiV0R0JR43/RVleC2iVhQmx8gsHuTac5s1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777052038; c=relaxed/simple; bh=EryUD1CgKD7V8tB5CcPep6jDCWDPbtSMis3sUzxdZjU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aLx5j1BYNbUcZx3EZvamZlbZz47CB1bpvJFQ/3jGc47Faf5pTJ80xUHIjl0VDGOMDzxDI3N3Sr9azlgpKd7F5O0BG5aRah1W2czUqwwSJN1uZ9QBlKvPdepTfDXVky4TWwlvMowXzZiP2RYEuFqlCV8SPAPpuVDETzUGvzVPtBA= 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=rX4tjW+D; arc=none smtp.client-ip=209.85.210.176 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="rX4tjW+D" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-82cebbdbdccso5098204b3a.1 for ; Fri, 24 Apr 2026 10:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777052035; x=1777656835; 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=RPyGjLt+iGZDFvL2Bll9Dt+u24uS4gQyWucsdGpH7po=; b=rX4tjW+Dy3c3OINQNU4IYrkVmAnI+jzqnjyHzpUtDflA5R3YFcNxKsJPoUFQsIO4A5 hcJMVGZMnHftiPSGzU5bnY9gKSlB6wEqK04WtkzEp6EWHUibAxVmKg6uBNrNJK8wLbDI jMY6Cka+WPjcF3uR4huxowHC6Wy3yFh/RdN9rEVB86K9vfazuu/zAzpOTsTAmpO2inui zCaZc49P5/Nxz59bC6XYCgZRrZcfOFIqwKybuM3ryRGU9wwlBEyDyzUCI0+FdUydtBAr Ehv//13LRXBdWoVeV5guliTiWcoIPIQIzeYn28XCdOK4TkBNrgweMB98zUmZQ8KuKrqh ZP/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777052035; x=1777656835; 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=RPyGjLt+iGZDFvL2Bll9Dt+u24uS4gQyWucsdGpH7po=; b=jkNI5Sg73Iu5N1bAmbB8jNWKJcmN+4w9AJ5UIbulzwio/6hDTMAsoZxtZpTqq37yxf Yt2GZyFvzkCQrN8UI3rTK9RS63VHCuiFPXyVl1c0V1i3wffhWTJxvjiHFEXg1i+zV41T X05e+2kq76Ytt5i8npE/o46D0eNZmOxH6mh40UPKgL9iajYA9/8HG1TIk6PyXG+lYI3T VH4iHBeyvwJWHWh4jMUgI3AljswsygbIau0xNVOtjMgaGMeM6vo1zcP/+Lx49DE1JwrS Pi3WTzy1I0tm4bYhu6FS1dwZXzGNNgCiPjkEExFKp49S2nn0UoorpJ1WIQyFrjgZ1bSK 7lSA== X-Forwarded-Encrypted: i=1; AFNElJ9396joK20pocrVBL4z52FqVVdPM85fDylbl7dYvpV1b3ZHPbDevALRXftXCSj6xtaJG0AQ083e2xe8R8A=@vger.kernel.org X-Gm-Message-State: AOJu0YwAafuLbh27nC150VYenrB+fjBIe1Ja6Ty9ebnKHp5LFk2LJRHO Qny+viiI5WbYbfhdE8yU359URN0tT+lQBQvd2TTxNvT2wOsHNoCYYRlK X-Gm-Gg: AeBDievcR88QScDmJ6ln71dgwCDenpRvIMekSOEAjTNG/mW4L5EanXMIPHs2Oy7s6Me R0GW9lj+4/ku/Q5idfSgqdM/ByE3/9ZqBsJgAvmJIO54nCFHB4IpcLPAIPO2vejfB50gIP5/KJH plawxpHJDkB+0uarsgyP0ZvIhSwiyMpwL51MaE/OSio4KPW4hmcKYX2yfOShEVZrmKiQ4UPx+8t HMcLTxVA2cId52s/ct4yNGRZiB1VMA07afry1YouQEPTlyBQaKsJxZZULJGSKOS1i2sk46bpPtX kStmz0HP4mhjlv+iUTWqYKNLJ7AwPGcFDHPPsD0gFmu2m8fpkJ1EPoBLF4Iw7hyDj7nmlWVNV81 0lvobH0KzIdlSdglEcXcVRxHEGzWmnJPQS4G8+fjqgTkvbjotQluUhWi2z7wWofnXskBa0KVQ+X yrLfGnlj9CzdAt103mfEfy7pC8zEOLumMFp9NLfwtnsi7Ui6cjJISlhkE= X-Received: by 2002:a05:6a00:a83:b0:82f:4bcb:a9d5 with SMTP id d2e1a72fcca58-82f8b387e8cmr29061189b3a.14.1777052035092; Fri, 24 Apr 2026 10:33:55 -0700 (PDT) Received: from tech-Alienware-m15-R6.. ([122.171.19.32]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f8e981c12sm29647462b3a.6.2026.04.24.10.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 10:33:54 -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 v2] mm/migrate_device: Cleanup up PMD Checks and warnings Date: Fri, 24 Apr 2026 23:03:47 +0530 Message-ID: <20260424173347.44621-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 NOTE: Ignore the previous message was sent on different Subject Header by mistake. 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