Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2773472rdb; Mon, 12 Feb 2024 16:51:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWC36fOlpX5YiS3fRdY8ft7HT0mPY1ZtQxng7WbU8TbWHUlKlHoVsQinKdO/l2PK0z8Wq4AZTV+sBJb49Hz8pYiPQYIPXa6X/e9nTAOZg== X-Google-Smtp-Source: AGHT+IGoJjfa4C5DdliJCbG+osb7MAzUUIyn1AdmUPHJBfpUohTprKO3D+GfDEGzGneTDG/kNKQt X-Received: by 2002:a62:d416:0:b0:6e0:4b09:a9c4 with SMTP id a22-20020a62d416000000b006e04b09a9c4mr7349121pfh.2.1707785506200; Mon, 12 Feb 2024 16:51:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707785506; cv=pass; d=google.com; s=arc-20160816; b=KeLby+BQEnKqnWR3VN7cHZMkn/p28aBb2+GDIcXjy2c8uCWZDD+uuu4w77cmvXFL0x J1qx9TYtjT0d4/wSHNNJTsPdoUWTWIl3gpLs8SyQcMpwQGW+q73vE0HGmM4g8NcxW4Si FQXuOFA0s6vMC+y9rcvxh9c2bkq/7dn8r7SlcY9MrKh+FR6gpmokK6Ou+9dtABKUHlOz 0ao60y2ShB9bPbfjM9rabJXQmi8wQqDkTfpSbTOfHVYS7papEsP5CrZo3ROqIuBk4SxB 8ICkqjUP8ewGRiS9nX1wFdq+fqB/j8gLy5PYCr0syujISzwzFR6SphdlrHAA4tUVXMfw StlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=UPV0aCwlKX1Dk4vu/Q0RUBqCJFxSZVhBiCiypSpR4U8=; fh=9tOw2Hum04SJ91s66ZCTWTNijQpAAB6R5I8LaHSBEZs=; b=Kz/EwCYi4PggNQ6TEo9HItixVnbSnPfBoe4YnXAI6vIWzPdcZad12AaoBcBMoNtKbU WT7adLaCf/fZs9l+WubdYE1CgHiVheM+bbHoWF9lpAVc50mnBvOI7nZ3Xq+FT4GNKgqA BEniR3AyWBYAcoFYxFv2gyokL+XeC2O4Y4m6A6S8Q/lngeu4HxfI6GtVCtwGNmWf8swL qxrc/QibTTqjknP0d6poLGuYAJx7vvJUuhk5mcE8eRzU/4WvxcvwqQp1YhGkq9jYJzLy kp3rSGFznR5/kOT6199eOzKRNsVg0CZFC9SL5Z1VMSoBVpaEiJYYS1K4YThU1OesUico SRWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DB+tyBhC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUtzge4nCRfM11JjZfisdqdlBU22KFACgbSBcxcZIiuwPjluovORqXxBjfw1wVbLP64yWUYYK3ZpLECZzbT5vt/j/w4BMYNmBxh2u5Z+g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t8-20020a056a00138800b006e0cff575c1si3601235pfg.397.2024.02.12.16.51.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 16:51:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DB+tyBhC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62692-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62692-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D6B442849C7 for ; Tue, 13 Feb 2024 00:51:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D4D678690; Tue, 13 Feb 2024 00:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DB+tyBhC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5EDB677F36; Tue, 13 Feb 2024 00:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783766; cv=none; b=byOuGRvxLGZ0o56hpERHDxrqqIb+E4CebqvGg3PNKdxjR9Loer29rd+pMOb/yz412b7ULkQXAvr1NSNxHBXSqJ2AVqeGljorcY9EdXQ36IKPBnbaZtCyjtzdAj6/Cwik9rlM97D0T1rqeADFp+WBOcTt2tEOEJiCM5AoTJN9iVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783766; c=relaxed/simple; bh=J2SE+Ih7VnzchNRQ9pGI4BiDERZdkrb5xNWU37/3B68=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DXYsiLXrzOOfwCKY5qAHUdxIrR9dBCJi+FSrbrU3u/6tnumlyRjNRoanmcuC8/IBlw4kjWEf18390o8dWLFWwN9y7VdPQD1N0tRKoCaE9Hd97hPorYZaQWAF3SAzEKX07cHT78HPQbq34WuMCMa4YAWUtCyvYy45dHDaJw1mdUs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DB+tyBhC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28380C43390; Tue, 13 Feb 2024 00:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707783765; bh=J2SE+Ih7VnzchNRQ9pGI4BiDERZdkrb5xNWU37/3B68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DB+tyBhCNmiuslGG7r/m1COLafMDPWwwVrO/+O4qGqk5h5983FO7Zgtbcbyq5f9Hz dD9U9q+LqfDE5B04t8qLnbj470jw1Yl/fuXBZwAQop6usIv711mlpapSoVSnfoWpDJ LraQhy8BSHKCJomok53AfpfrvQR2v2PLCmS+dUODPAHuK+CBljEsWVJKxc2v8AMKsg +8DHp0KWmDvE3vK8tVy+7Gk6RloC2L8NlRzbSEerVIH+bs2q6GfOFhcjdcKzbvV+Q8 GC5dvcOYW3/yFwcdRg6sJDgJqs8TdddbXl5ulBtT61rQeUhAtPTR9CO3bmFiOIHPrl E3goYMIM72cww== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ism Hong , Konstantin Komarov , Sasha Levin , ntfs3@lists.linux.dev Subject: [PATCH AUTOSEL 6.1 08/28] fs/ntfs3: use non-movable memory for ntfs3 MFT buffer cache Date: Mon, 12 Feb 2024 19:22:06 -0500 Message-ID: <20240213002235.671934-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213002235.671934-1-sashal@kernel.org> References: <20240213002235.671934-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.77 Content-Transfer-Encoding: 8bit From: Ism Hong [ Upstream commit d6d33f03baa43d763fe094ca926eeae7d3421d07 ] Since the buffer cache for ntfs3 metadata is not released until the file system is unmounted, allocating from the movable zone may result in cma allocation failures. This is due to the page still being used by ntfs3, leading to migration failures. To address this, this commit use sb_bread_umovable() instead of sb_bread(). This change prevents allocation from the movable zone, ensuring compatibility with scenarios where the buffer head is not released until unmount. This patch is inspired by commit a8ac900b8163("ext4: use non-movable memory for the ext4 superblock"). The issue is found when playing video files stored in NTFS on the Android TV platform. During this process, the media parser reads the video file, causing ntfs3 to allocate buffer cache from the CMA area. Subsequently, the hardware decoder attempts to allocate memory from the same CMA area. However, the page is still in use by ntfs3, resulting in a migrate failure in alloc_contig_range(). The pinned page and allocating stacktrace reported by page owner shows below: page:ffffffff00b68880 refcount:3 mapcount:0 mapping:ffffff80046aa828 index:0xc0040 pfn:0x20fa4 aops:def_blk_aops ino:0 flags: 0x2020(active|private) page dumped because: migration failure page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48 (GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), page_owner tracks the page as allocated prep_new_page get_page_from_freelist __alloc_pages_nodemask pagecache_get_page __getblk_gfp __bread_gfp ntfs_read_run_nb ntfs_read_bh mi_read ntfs_iget5 dir_search_u ntfs_lookup __lookup_slow lookup_slow walk_component path_lookupat Signed-off-by: Ism Hong Signed-off-by: Konstantin Komarov Signed-off-by: Sasha Levin --- fs/ntfs3/ntfs_fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index 8c9abaf139e6..977e1422f904 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -1015,7 +1015,7 @@ static inline u64 bytes_to_block(const struct super_block *sb, u64 size) static inline struct buffer_head *ntfs_bread(struct super_block *sb, sector_t block) { - struct buffer_head *bh = sb_bread(sb, block); + struct buffer_head *bh = sb_bread_unmovable(sb, block); if (bh) return bh; -- 2.43.0