From patchwork Thu Jan 2 22:05:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234474 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=unavailable 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 44DACC3276C for ; Thu, 2 Jan 2020 23:00:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1192D20866 for ; Thu, 2 Jan 2020 23:00:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578006003; bh=vHYiEBm4hwCcFW+UIiBtvdtdp4O3/P1BrzrnoP0+PRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UwWTtZOsbrpXHvjjZTC8sbU14F8DBo/EJQYPy+SN1LPttNM4nN9j49Njn8P4HgUiR tbpIT6GIDbRH4Ma+EfnYd6rSBGjWKorR1+sSMtO3CmD8mo7g/kM5GY5jLoXeTMBMhU a1+RcynfdgVNWlZhQe6oCuAF9ZlKh+sk53uoXJI8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbgABWNb (ORCPT ); Thu, 2 Jan 2020 17:13:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:53268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727700AbgABWN2 (ORCPT ); Thu, 2 Jan 2020 17:13:28 -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 03E8122314; Thu, 2 Jan 2020 22:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003208; bh=vHYiEBm4hwCcFW+UIiBtvdtdp4O3/P1BrzrnoP0+PRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EnqsdYLIMeh3EORTKPAnO0DQyXIuMhXVumuSsu8phTX53UZmxqvQZgqsONjMlF+wc 8JIEwb6wKomQ8bn72AEMTWcc5Z64cRJE1pGOWDQVRVeQjUrEtV29MI0Im/+qr++Oww nu2VrDHAS4jXEWE7F8MiTiy0YgYuC4fiGwmtNwCg= 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 5.4 029/191] dma-debug: add a schedule point in debug_dma_dump_mappings() Date: Thu, 2 Jan 2020 23:05:11 +0100 Message-Id: <20200102215833.093514241@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@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 --- kernel/dma/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 099002d84f46..4ad74f5987ea 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -420,6 +420,7 @@ void debug_dma_dump_mappings(struct device *dev) } spin_unlock_irqrestore(&bucket->lock, flags); + cond_resched(); } }