From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E03DDC433EF for ; Mon, 30 May 2022 14:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241448AbiE3OtV (ORCPT ); Mon, 30 May 2022 10:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240996AbiE3OaP (ORCPT ); Mon, 30 May 2022 10:30:15 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9133056200; Mon, 30 May 2022 06:51:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 99CB8CE0FC9; Mon, 30 May 2022 13:51:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68E55C385B8; Mon, 30 May 2022 13:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653918707; bh=q4/TRkFKO17K5S6Q52l+i8SN+KZng04nsE2jNUt5RHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fw08vm2LX254cGBcuK0/wLdBKXYUHDB/H51sFlBjHGNHzOofMgWZWgraZFucwGT4K ZgBV11gP2OGGyDqmbF26usQDB7jxTVlCiQa1RF4VyZnLWwmaw29g/6gyNTn2kfM83u fIEaDNCJ5a5OVfvSgI5D/w49bW6YE2Ctlso9OR5Td7c9e3FumLQ6UAq1hqYJZoohRF x4tABMdweSPiRNLSWDeQwFqbGwA86C7hkRr1D18RlPHxjK/JRcZIH4CMe4k+Q1iFr4 p7mxWFhqJgHvwG4H3tmVIQ/Hg6+fxlBbRHFmdEj5QveNYY5KmQfYBYLeUy4Hpus46Q u8vKzKO9N2c5w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mikulas Patocka , Christoph Hellwig , Sasha Levin Subject: [PATCH AUTOSEL 4.14 19/29] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC Date: Mon, 30 May 2022 09:50:46 -0400 Message-Id: <20220530135057.1937286-19-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220530135057.1937286-1-sashal@kernel.org> References: <20220530135057.1937286-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikulas Patocka [ Upstream commit 84bc4f1dbbbb5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT allocation - so it can't access the emergency memory reserves and it fails as soon as anybody reaches the watermark. This patch changes GFP_NOWAIT to GFP_ATOMIC, so that it can access the emergency memory reserves. Signed-off-by: Mikulas Patocka Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- lib/dma-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 61e7240947f5..163e0e9b357f 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -465,7 +465,7 @@ EXPORT_SYMBOL(debug_dma_dump_mappings); * At any time debug_dma_assert_idle() can be called to trigger a * warning if any cachelines in the given page are in the active set. */ -static RADIX_TREE(dma_active_cacheline, GFP_NOWAIT); +static RADIX_TREE(dma_active_cacheline, GFP_ATOMIC); static DEFINE_SPINLOCK(radix_lock); #define ACTIVE_CACHELINE_MAX_OVERLAP ((1 << RADIX_TREE_MAX_TAGS) - 1) #define CACHELINE_PER_PAGE_SHIFT (PAGE_SHIFT - L1_CACHE_SHIFT) -- 2.35.1