Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11791587pjo; Thu, 2 Jan 2020 14:21:00 -0800 (PST) X-Google-Smtp-Source: APXvYqz/DQ2OaFyNnYxYm6LTszhIwLcfChZrGiyghxXDgCtrIsC8EXsId5bwQElMwT2T2zrnOBKe X-Received: by 2002:a9d:6481:: with SMTP id g1mr96780849otl.180.1578003660380; Thu, 02 Jan 2020 14:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003660; cv=none; d=google.com; s=arc-20160816; b=DEieg0hwV64mGzj07z2wPy+kW4tN+E3jFJdisy2McSqR5HkSrYyeRf7AyCFthBxMD6 g+Umm2xijM9mXbOYmajxl/NT/tPT4QTvhS7n/U36ZRjwqZQy5+VVUZ2pCrDEqC+edUeU KdbPrEIO6RxVdV24GBYMLrrbJDiB2lqC24xgJP64S+UlQflqNdpwSgZcgGqHti6vZ5Mh GgCNV1sHm0S5qoGw0CJyyJTuFe+8BaJ/nA7fC9uwe3tbkHA7t7bxom9JFtdhMpVJjxhg 4BVT22NO5qAZL9iQgQ3fVQxOo/wfCtH71Z+ux2SkDtc8MAPtakk5RP633nbAsbUZkbY9 euFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mpaEQaFn7GFmhebCMq+dQtHEIaA4WT1KkLtTeB+enCs=; b=psNRbvGDCUSAUEM1nFwMs2YSxgNuFem0L52/DkQDEFfmKLpJd7yRTvUYUxUFaUq8hU GwqSTq27Srfjd6qybxHtDk/0uulJWTPyoE7PDFIEks1Phr6u02uLDM6nyoe6WgJFXnOU zHRIbLZCJ8ZJ9VvQOnLEJhFa911EADfQ38pDc9qAc8mGDwnb0/DaN6JDXWUZM7k5ZwuR MFrzZvY7FZ1fU8wf+KnXjWs/nlQUDXuYgfW/OA2sAjT71PFEjVECz1t2g/ivMJOPtX9/ rSmvvZShE09BT2n5QCQhwoOIcrpjs3Kq2m/KSSXE0+K1Rf9lMSdyWrOBg33pArlYhm1e M5LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NDpwJCma; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z65si18367852oia.33.2020.01.02.14.20.48; Thu, 02 Jan 2020 14:21:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NDpwJCma; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728024AbgABWTO (ORCPT + 99 others); Thu, 2 Jan 2020 17:19:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:35102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbgABWTL (ORCPT ); Thu, 2 Jan 2020 17:19:11 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ABA12253D; Thu, 2 Jan 2020 22:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003550; bh=KcelGyWJAYZ6r/myYq/loWbcnlucF4JKI0LqQ0izcgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NDpwJCma5+6TJYgpokpAeUC5SKj3XiGW2wMRwSrtVpra7NJ7GPXZfs/HhNzHCY/R+ oA9juyCqI5oinOQR8bg6r0vym5/snWSvEa0Dbcw8b7VSMeQ4YZDbVhIvEAddBtKjLX M0/UxE87VKeyh+MbO5QyOcl1OlBCGJHfFblUAvsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , Corentin Labbe , Christoph Hellwig , Marek Szyprowski , Sasha Levin Subject: [PATCH 4.19 016/114] dma-debug: add a schedule point in debug_dma_dump_mappings() Date: Thu, 2 Jan 2020 23:06:28 +0100 Message-Id: <20200102220030.772529004@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ Upstream commit 9ff6aa027dbb98755f0265695354f2dd07c0d1ce ] debug_dma_dump_mappings() can take a lot of cpu cycles : lpk43:/# time wc -l /sys/kernel/debug/dma-api/dump 163435 /sys/kernel/debug/dma-api/dump real 0m0.463s user 0m0.003s sys 0m0.459s Let's add a cond_resched() to avoid holding cpu for too long. Signed-off-by: Eric Dumazet Cc: Corentin Labbe Cc: Christoph Hellwig Cc: Marek Szyprowski Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- kernel/dma/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index c007d25bee09..3a2397444076 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -442,6 +442,7 @@ void debug_dma_dump_mappings(struct device *dev) } spin_unlock_irqrestore(&bucket->lock, flags); + cond_resched(); } } -- 2.20.1