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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51521C3276C for ; Thu, 2 Jan 2020 22:41:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2459720863 for ; Thu, 2 Jan 2020 22:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004872; bh=K7SE10bigZvxGl43MedsdOZk/x9XA9Zvd33+Z36It54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t4y9R0jqBmnkg+Co/qaCqkIqugSiYo1CgebZaLgp8qenchZQS3M6XGC6NBnVEBlBD FY1apQzjsWrfBcMZBL7jDFI5JeNobF09w5qGdw5mE9G2aKu76S146pepoY79djbnEh fFkKIgMP9xMx68fXhGlnOLE+3z6UzqztofCsoHH0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731232AbgABWlK (ORCPT ); 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