Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8801673imu; Tue, 4 Dec 2018 14:33:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WyHDKPacJDlFsU385cR9RhoVNUEljyIlY+3I+DNMrA/okCs9/OiDrvELH5LS7f1VzMc0R2 X-Received: by 2002:a17:902:4827:: with SMTP id s36mr21095198pld.168.1543962833704; Tue, 04 Dec 2018 14:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543962833; cv=none; d=google.com; s=arc-20160816; b=JBqFY0LOHskmJ9A6tzjsKsZZY9EA+nJofq/ow/nyBcePkUXq/p0p9U0LU8F9vJiwlA tZI12lg4yLAvZ907RMGFgRQx+2QNuCGBRCcqBrCZe/pzXx+WnoF/EVytilgrKqMaW2gS KsNTuhV7e9ia/BdnWTwMcaUgI/UXs0NolqdCItJmpMbN8ApwoAmCwiD9LXkAjqlXLwmI s4lUnPk9GeVLgp/7gFdpIIFo11WgqhDGXpPI9DmqLCovzgQLUvSwS+uwonJ9aHB4zFDS DapRzRVA8J75RERXXg4Sk3Bcrwgrwhtkyi+f0u1xE69HwRQ/0mq8BFkZcoy7sU5DZ2Wh a6DQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=oDUoXlbvHDh/vin2PdepG7YwploGVx8kzl7eV27pHkE=; b=09SDa3RexfoCkHURBOT5/IayjVGwfo4B+1k0AVN00B96TZ5PFP6xxAuqPgdt2OjQnx HNeVTkWVNdRyYIhnlBw7H8if8baqzNLwQh/IBvARsEDf6zA9r2BpNVkjIvhU3hz8aPUH RTlS2S68Ey+e1Sk18i67t9PUxQzvjBpyAsCU6mAXjhCILQNo7VQnLcfFIQIhFCj0sn/o wRvUFr4hYmL9ap/tihbEXkXcE8D0vV3OFspu7BuLQXphv/o+VfLS7g92IWAqiz4tap1T zGlZQFDjl/pfZhIOtVLHI1plxgaaVOhlkIf+E02MaSKnuX83I5pkYnLh/atZ6WiSHeam XUXw== ARC-Authentication-Results: i=1; mx.google.com; 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 d14si17663084pgn.390.2018.12.04.14.33.37; Tue, 04 Dec 2018 14:33:53 -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; 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 S1726273AbeLDWdC (ORCPT + 99 others); Tue, 4 Dec 2018 17:33:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:57650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbeLDWdC (ORCPT ); Tue, 4 Dec 2018 17:33:02 -0500 Received: from vmware.local.home (unknown [208.91.3.26]) (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 8CA1820850; Tue, 4 Dec 2018 22:33:01 +0000 (UTC) Date: Tue, 4 Dec 2018 17:32:58 -0500 From: Steven Rostedt To: Anders Roxell Cc: mingo@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, keescook@chromium.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3] tracing: add cond_resched to ftrace_replace_code() Message-ID: <20181204173258.6de70c66@vmware.local.home> In-Reply-To: <20181204194044.9506-1-anders.roxell@linaro.org> References: <20181204194044.9506-1-anders.roxell@linaro.org> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Dec 2018 20:40:44 +0100 Anders Roxell wrote: > When running in qemu on an kernel built with allmodconfig and debug > options (in particular kcov and ubsan) enabled, ftrace_replace_code > function call take minutes. The ftrace selftest calls > ftrace_replace_code to look >40000 through > ftrace_make_call/ftrace_make_nop, and these end up calling > __aarch64_insn_write/aarch64_insn_patch_text_nosync. > > Microseconds add up because this is called in a loop for each dyn_ftrace > record, and this triggers the softlockup watchdog unless we let it sleep > occasionally. > > Rework so that we call cond_resched() if !irqs_disabled() && !preempt_count(). This isn't urgent is it? That is, it doesn't need a stable tag? -- Steve