Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1249017lfc; Wed, 1 Jun 2022 13:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxouHpylLIkLusSjgaSyz9nmz39rCYvGuHIbtYaplrw6CRO1ok13Xwnt8xERhcV19CjnXni X-Received: by 2002:a17:902:8687:b0:161:f0ac:723a with SMTP id g7-20020a170902868700b00161f0ac723amr1140751plo.128.1654113806795; Wed, 01 Jun 2022 13:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113806; cv=none; d=google.com; s=arc-20160816; b=qDgUOsoFGZSpNmWf4AC0q+j9EonEyMbGbovlfbxeogERN7DV5Mbp8DRjamHPU4KWPz Soy12U58vZVprntIMXnRxaxqNhnyNP0bJI3lUULPO4LqP1/WvBBSEQevBsQo86q5fakA LSTyS/CEATbTHzJoVGUUxsiZQDMCHN3EHl/mYUTx23jUCSv/zbji3N44sHyrm1hhtqgJ MKepUer2NqD8tIeCJgtkfBpPaYDOfMfy3VwEqKFq9a1k/8+Zh9tqE4mArQZSNf4qhfiJ zzyhktc0a+Q3JqIb8oHHu7sWbgnRFjsaw26UQgxteKXyxa/PNLbW1lRcOfcpsKCniul3 CjkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1y5ylgv/LaPdmR2p+PzFCxYhtcgwDu5iz/UxC0i0OK0=; b=CdcddMOWdDHi4+/UdJbmT+qdvXDVDiXJ4Rp8MA1m1AKeVOmtYnvqzfCjuO8ulj19Jg //yWFrg9G0AQeHKAyW1NdAW+qqcOf4hoVwnDzYfINyHWA5H/o5h5wlAlC5130i/Z6jtR AwO/3qVRzVRb+uYNUEkqaW8auJhCwHMSXMy3cNY0rWdgzO9IapSe6qKVctgASlT2tBJa L8B/C/sj+cIZS5jo7oz6NCfuTJFD+p8WY6MP9hq9TX6HNmLlbw+c4qe4x0rnC39PA7iO 7ioeM10gNdJLVSbkLT4/yCv/UtNUY7HmxlYViiTkNBq3G7ZGxix26zd9DR1yCRjr/b8s zTIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LqoCDTZJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k3-20020a17090a3e8300b001e070f1ddabsi3431835pjc.65.2022.06.01.13.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:03:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LqoCDTZJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1CE1A21E33C; Wed, 1 Jun 2022 12:20:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242342AbiE3Og6 (ORCPT + 99 others); Mon, 30 May 2022 10:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241969AbiE3OSP (ORCPT ); Mon, 30 May 2022 10:18:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D48FC9CF60; Mon, 30 May 2022 06:48:46 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3B30960EDF; Mon, 30 May 2022 13:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD0A5C385B8; Mon, 30 May 2022 13:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653918518; bh=oIEXLVnaBHL1UC4eBn/F21itkcHXK9tGlrGvnWM0VjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LqoCDTZJGya7nzdhHSMfHyXkmHX3/l7R6PzWR8zwIwFpZ6FG0bVqEMl/OmeN3jPpd GgyAooYnG0B2jqTKFH/MP70YpLv1/sfeN54hfX/8uvP3XOa+6cY3Ss4ushkfRal9r2 0aJAjuHS9CiUXlp7uTdOvt3OrUVuWek+HR1O+/gbCopUlId8cK4nJ6HhV86trB126r q0GM3rhGHlc+Wyc3It0qUXWIbL1NrpduzrDUvySoN39nQspOPBho7vcdgL/HmzIXcr vr0cCwW0ueRJs1FFDD6v4V3B5vGXXqGOtHdsvc5QnB4hJIHcr5VHnt7pik5hwYWeH0 /gyppMC9X6yVQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mikulas Patocka , Christoph Hellwig , Sasha Levin , m.szyprowski@samsung.com, iommu@lists.linux-foundation.org Subject: [PATCH AUTOSEL 5.4 37/55] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC Date: Mon, 30 May 2022 09:46:43 -0400 Message-Id: <20220530134701.1935933-37-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220530134701.1935933-1-sashal@kernel.org> References: <20220530134701.1935933-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- kernel/dma/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 4dc3bbfd3e3f..1c133f610f59 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -450,7 +450,7 @@ void debug_dma_dump_mappings(struct device *dev) * 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