From patchwork Thu Jan 2 22:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234712 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 9F9D5C3276C for ; Thu, 2 Jan 2020 22:31:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 683AF22314 for ; Thu, 2 Jan 2020 22:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004301; bh=jfEC8rJhOwM5jSDSuLARnYGItx2PhCRc3wve5ssCMK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=odsMQy9C6AT3CajrID37Kf341U3sY71fVsTthrnZBsG3c1cCS6m+l7g07j1PhAzYk Zrw0yI3XcdI9TAGWsBbb1j6XItkWqKQlW8wws+Ki1b7Y+GHMq5E6KxqdHOnhJMLz2g ZBaspQ2zcmG0d9op8hDyXjIlghl/YsMn02x6dapg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730310AbgABWbk (ORCPT ); Thu, 2 Jan 2020 17:31:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:37046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730306AbgABWbj (ORCPT ); Thu, 2 Jan 2020 17:31:39 -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 C2FFF21835; Thu, 2 Jan 2020 22:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004299; bh=jfEC8rJhOwM5jSDSuLARnYGItx2PhCRc3wve5ssCMK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2JVPjEf+Yi3R3pl7e1/msrzjN5+OHX5AJPnOM08FHvkxA7kcdiwjKWWSYrcshjy1 Xsfuq3gQ0Qcodv3j2Z5Bmgv2Jw1oOfoPaorBVLwbMmCN89VZEF11hfMur//ZHLQkz4 68Q6RmWZOqgb+KmdMBEslMQBXiiUGUibdQC3XS30= 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.9 120/171] dma-debug: add a schedule point in debug_dma_dump_mappings() Date: Thu, 2 Jan 2020 23:07:31 +0100 Message-Id: <20200102220603.732883004@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 8971370bfb16..4435bec55fb5 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -435,6 +435,7 @@ void debug_dma_dump_mappings(struct device *dev) } spin_unlock_irqrestore(&bucket->lock, flags); + cond_resched(); } } EXPORT_SYMBOL(debug_dma_dump_mappings);