Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3653453ybg; Mon, 28 Oct 2019 16:39:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjQ4/GaJLcf5I7rT1TY4u1zl8gapkE8cv3kkiJECQlpS1lc2oA4TkOcPuYAXmnKCr8Y1AC X-Received: by 2002:a17:906:85da:: with SMTP id i26mr487914ejy.186.1572305973148; Mon, 28 Oct 2019 16:39:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572305973; cv=none; d=google.com; s=arc-20160816; b=KQCjIO0EnBMYoPjGbrmkT/TIH/JqQyobxiKcqxeNw8ns4q0BTQnlWkTQQCyGILun+z rOqg4iAOE4GEPSP1YiwnVMa/IyHUgYeKr71nL7Uqsdz/qH2JFKFaUK0fciHOrSmay+wf vWYtrtn2906+eajM/pghHz13G6k5kBnXvhOAg2rI2Ksfsdt9I9rVHS6WnAi6Nnk8hRsw lthOQf5NAMOmohy5T4D9GX7M0ePSej3H8zZbEjGZuFjTmPIGF6iZxAPbiX3YcjbUv4ta cazTTWA1pUlXtbYB9yw09qugMC3q/ZoLqt9e1Fp8oXQ7Lbbj5+RTOG8+OMsvO/ZyIkh8 rbPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=UtGhKKNcMrwHGBNHOnspoVolNucvfChffjDhkf56Qew=; b=hRQF/KFDdG0+a5S7cgS2hriLVh8YQekUv+C52rg4Kmeyz7zgClSKkvZOTpVpnk3Yn+ lUJ6tHpIrkCy5S3EvWONfeQCJg0Lct5cVH26Dgz9uqAtV3a8koNJhXO3Ss4CCeVcKG3S tjQpUkTTxdLLW+kAN10m1L/dnMUkG2KtVB+enqbaEEMmWPOh9iqCW+Y7ii9hlxsDizDS Y1lVP5nGNM0k404KD3toOURgCjRZiWcVrkigGSnfxVv0ecErOJrOiKm05W5fcsRAG81i +VwxDn9gyLmcuLny6PM3OgGiEnN2W1oHbgfMiQRylzzKzfNKeIAyCwmfhpPTlUm4q0MM veKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ou+FqvgY; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x51si8274056edd.393.2019.10.28.16.39.10; Mon, 28 Oct 2019 16:39:33 -0700 (PDT) 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=@google.com header.s=20161025 header.b=ou+FqvgY; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388806AbfJ1V4w (ORCPT + 99 others); Mon, 28 Oct 2019 17:56:52 -0400 Received: from mail-pg1-f202.google.com ([209.85.215.202]:55561 "EHLO mail-pg1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729738AbfJ1V4w (ORCPT ); Mon, 28 Oct 2019 17:56:52 -0400 Received: by mail-pg1-f202.google.com with SMTP id b14so9363379pgm.22 for ; Mon, 28 Oct 2019 14:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=UtGhKKNcMrwHGBNHOnspoVolNucvfChffjDhkf56Qew=; b=ou+FqvgYLi5WelaPVkj2Yc12VFdOY5Sq5OnD59DIPUDn94kwQEAaAvFKhCE3f1iRbN stxWQs0AgsbsTbv52NZDnB6eKbw0SzWTzU3DOkvmo5ZXg/jJvq2h3ORptPM3mzZSYjyM gDgkgHLKafzlcO2/4ysSfhDgyrvP4u+EJIMM0YVSY8zBJ6SJgiFNArBx/uCTO7YkfqJ2 qSGX6AAOlcrq+O6n8p67xzlv+3k0DZ++D74N2sW3WASuFtw9nfpTsVtAt7W3qJw50fKK U7VSkW/avTGiWXhFg3OJoaE6G6r7yqqpQskouef6RDevPsTdzxrc24Clq5NS9SVHn+Dh 7EIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=UtGhKKNcMrwHGBNHOnspoVolNucvfChffjDhkf56Qew=; b=qpG1uf6aVMdcBDrMVKrN7t5p1E9x+0jIVuXmwYuU6OoF5hqVXjrsFAPz9dHKRGzQWi pd9giz+4Spgl8atIPWFvwxyMCbE8mPKERkgZbA4tCKIs3MIk+pnsUEJmPO8H32foPMSn 6T/0+n+CerEQjFvqeAy1X6fFejtihtGQHKPOD+dc15sRE0yrMj+Hd210WmcpIhHF4fgr OP+c2mTFOLfjvSYIxujxSoji5dhMsXlLkjujpM2Waz31JtTE3W2rs8J+aUWuVjRTPUOa 5uDZLHzRM+8XjEle1Npieay7lIbjbhy3YWZIILTru+/Pj+XhdC35BXU/4v8I9enqIYMP fG7g== X-Gm-Message-State: APjAAAWiphl76aQkSrqJbaV5/5wwCxT0haK7Q6JN9stMPTr8WIH91Yd1 vOJkUwTLWqi3blYKUmC/v5/ocIa0ND/avg== X-Received: by 2002:a63:cf18:: with SMTP id j24mr13166518pgg.406.1572299810069; Mon, 28 Oct 2019 14:56:50 -0700 (PDT) Date: Mon, 28 Oct 2019 14:56:46 -0700 Message-Id: <20191028215646.16638-1-edumazet@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.24.0.rc0.303.g954a862665-goog Subject: [PATCH] dma-debug: add a schedule point in debug_dma_dump_mappings() From: Eric Dumazet To: Christoph Hellwig Cc: linux-kernel , Eric Dumazet , Eric Dumazet , Corentin Labbe , Marek Szyprowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/dma/debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 099002d84f466af0a8e421d035ac8eb119e08bd8..4ad74f5987ea9e95f9bb5e2d1592254e367d24fb 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(); } } -- 2.24.0.rc0.303.g954a862665-goog