Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11812081pjo; Thu, 2 Jan 2020 14:42:32 -0800 (PST) X-Google-Smtp-Source: APXvYqzFsjGFFZZyGW3eyQYE6YwHjt0QpcZG/zCPbu3VMAo3T+RBEeyPkEYNgatucp7gaTP+5IaH X-Received: by 2002:a9d:7cd9:: with SMTP id r25mr88477814otn.326.1578004952343; Thu, 02 Jan 2020 14:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578004952; cv=none; d=google.com; s=arc-20160816; b=fULzYT70SP8P28tZauLvq3Ef/1xhRKFMN8ZYH8blkEi45NZjLs4qASNFpClYnqMXg2 MheONV3i4rVOSod+CIk2j+aipPUywqVQh4gN+nsroD2LmBfpBYUD6HRIfSVH5+fLSFfC BXUJmWFz9PEjEfXRAqBsaLxybfgmT89kTWw3Ccxr877G5IvMT59WYR5o+O4F/6nKpTmC 8g3JkJTtjeNuLeMNDG3QbjyrDtepUOTgxALm+AAuitQUYjgfvKBedVnKT8N1CCubYamE InZayWKXJZL9lKpIQkotATr5f00DZmuZwb0YWlEwMzjsUZf5NM2fl7Wn0BXsyaDa5lp9 KdWg== 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=AQggqMVCoU4nz5VcjOrLTwhKA9ACsMyAY3bnOxmmYyc=; b=aurIKI+JhyTiwXf+LMiFyOamD+7yGcYugpni8we6WSe79Pvbe5/TFkbLPQDNvXIota br3y+W7Zpeiue56RLEQz7w8HGFYPib5EAT77GclTMhjOMhqjxG105flkaxUTS+IItNMl bLP7lqNM3r/VpRbzm8Hu6vcy3iA+I0pPx5McIK0wp51+i4cptKeB6tHMZkmV/ECCmrUS 6lEq89QaPEfUMyYQW64QvoVVtZCgr+YGyRuB2CTH5efoiZYaKt9Qudjobq9VSvJOa0YG tSXqYkGjNWnMtMzymOv6h8D/V+1n/KwidR8ZmzmZEYh6xwH1JExUIGTbzD2lo7iXhBva +GZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2J4sjLkA; 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 i12si26698150oik.171.2020.01.02.14.42.20; Thu, 02 Jan 2020 14:42:32 -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=2J4sjLkA; 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 S1731226AbgABWlK (ORCPT + 99 others); Thu, 2 Jan 2020 17:41:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:50274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730932AbgABWhf (ORCPT ); Thu, 2 Jan 2020 17:37:35 -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 BB1CE20863; Thu, 2 Jan 2020 22:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004655; bh=K7SE10bigZvxGl43MedsdOZk/x9XA9Zvd33+Z36It54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2J4sjLkAvZAoivMjO+UB/3aSuwitkPwP5iQk1uGq/Pe2jkov0VnNGReOYldKPnAvL v5o1Uy3MeMkQP9l/J0W8boSk0lhoOI5EuSVUeQG1dTRoeA8u5mfiClrmTFg5jxIZLz zSk9wL8YwhqvhpXu/4ywaPG/hQ3nYrXG7vHE7Yvs= 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.4 098/137] dma-debug: add a schedule point in debug_dma_dump_mappings() Date: Thu, 2 Jan 2020 23:07:51 +0100 Message-Id: <20200102220600.245410965@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@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 --- lib/dma-debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 51a76af25c66..173013f5e41b 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -427,6 +427,7 @@ void debug_dma_dump_mappings(struct device *dev) } spin_unlock_irqrestore(&bucket->lock, flags); + cond_resched(); } } EXPORT_SYMBOL(debug_dma_dump_mappings); -- 2.20.1