From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 1B1A78F7D for ; Fri, 6 Mar 2026 10:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772794340; cv=none; b=Uui341+gLJC9YFBlNO8k2EnNLbL8ToLPzaNXgUPEyvfNdX7foxYuVUtfBUC9AbmoFRhE99b+TYcYPaylXQW+3ybBmDcRGQYbk2YNp4SshI81fsd1TNaEzcdQ8M7gyNj3f2S7w58EBmLgEqXfka8bagAQPDp4zFPZdCBJpxMYvns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772794340; c=relaxed/simple; bh=65pzu9jQ98PWgAYH7swSgnD9teyU4Tim+px/VGvsMyE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kAukohG8chD9oPZQ/FdDNCDb7/xvL0xkF07LnkeEaq6FpVB18hMf0UtXKxlGILV/A/xmLVH7rlVXiYM/eDfv744GZN8pZ/R7Sp6El2veKz6HmEAmNAq5imZ4M6LdXMqPQpK0EpNVTETxpbPBQlH8K8lAUD31UVKQqmrTW0VBX3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=hruPX1va; arc=none smtp.client-ip=95.215.58.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hruPX1va" Message-ID: <9008c7bb-f312-4a9f-a471-568575519d08@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772794337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n28OOmT0dysIuHKBAgUVdyHn1XpIpPb4AQfanb1Mupw=; b=hruPX1vaV5b3TUivNO8aCAVwQs2eLWNc8SoppNpNlo6spHYFvXo3orEGenyPMlPMW7wxYd pibIn4LMZoosNzSZPSRsBbg5pnjjxNafSqvpvFww1xowrKiJ6wdDotIu1jXOQ7q4CmjPOa nM/BU/yWBdhJ95j9O5U0+D5sDWYmlh4= Date: Fri, 6 Mar 2026 13:51:52 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] mm/migrate_device: fix folio refcount leak on folio_split_unmapped failure Content-Language: en-GB To: Balbir Singh , Zi Yan Cc: =?UTF-8?Q?Mika_Penttil=C3=A4?= , Kiryl Shutsemau , matthew.brost@intel.com, npache@redhat.com, david@kernel.org, Usama Arif , Andrew Morton , linux-mm@kvack.org, joshua.hahnjy@gmail.com, hannes@cmpxchg.org, rakie.kim@sk.com, byungchul@sk.com, gourry@gourry.net, ying.huang@linux.alibaba.com, apopple@nvidia.com, riel@surriel.com, shakeel.butt@linux.dev, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260304120132.3973445-1-usamaarif642@gmail.com> <5e59c077-9f06-4e45-86e1-ca696e6105b4@nvidia.com> <622eb392-8c04-473d-b42a-ecdc489799c4@linux.dev> <942f2df4-6fb5-415f-b7d4-87a83315890b@redhat.com> <80683d6d-ea38-4326-af5e-e4c173bb1930@redhat.com> <332c9e16-46c3-4e1c-898e-2cb0a87ba1fc@linux.dev> <7996d5c5-24db-4ef2-b88a-1b9d33f9e976@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT > > @Usama have you figured out where the original issue you are seeing stems from? > There was no issue or bug report. split_huge_pmd_address currently cannot fail. I am making lazy page table allocation work [1], which would allow it to fail. One of the review comments was if I need a folio_put if split_huge_pmd_address fails. Its not needed if folio_split_unmapped fails, but is needed if split_huge_pmd_address fails [2]. Actually it would be very nice if you could review the patch in [1], as its modifying the code you wrote! Thanks! [1] https://lore.kernel.org/all/20260226113233.3987674-13-usama.arif@linux.dev/ [2] https://lore.kernel.org/all/6982e9fc-cc17-4d4f-b26e-83997c4bf070@linux.dev/ > Balbir > >