linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: linux-kernel@vger.kernel.org, acme@kernel.org,
	akpm@linux-foundation.org, alexander.shishkin@linux.intel.com,
	catalin.marinas@arm.com, davem@davemloft.net, jolsa@redhat.com,
	jthierry@redhat.com, keescook@chromium.org, kernelfans@gmail.com,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	linux-perf-users@vger.kernel.org, mark.rutland@arm.com,
	masahiroy@kernel.org, matthias.bgg@gmail.com, maz@kernel.org,
	mcgrof@kernel.org, mingo@redhat.com, namhyung@kernel.org,
	nixiaoming@huawei.com, peterz@infradead.org,
	sparclinux@vger.kernel.org, sumit.garg@linaro.org,
	wangqing@vivo.com, will@kernel.org, yj.chiang@mediatek.com
Subject: Re: [PATCH v4 6/6] arm64: Enable perf events based hard lockup detector
Date: Fri, 20 May 2022 11:47:37 +0200	[thread overview]
Message-ID: <YodjucHQ3Nab5J/f@alley> (raw)
In-Reply-To: <20220427161340.8518-7-lecopzer.chen@mediatek.com>

On Thu 2022-04-28 00:13:40, Lecopzer Chen wrote:
> With the recent feature added to enable perf events to use pseudo NMIs
> as interrupts on platforms which support GICv3 or later, its now been
> possible to enable hard lockup detector (or NMI watchdog) on arm64
> platforms. So enable corresponding support.
> 
> One thing to note here is that normally lockup detector is initialized
> just after the early initcalls but PMU on arm64 comes up much later as
> device_initcall(). To cope with that, overriding watchdog_nmi_probe() to
> let the watchdog framework know PMU not ready, and inform the framework
> to re-initialize lockup detection once PMU has been initialized.
> 
> [1]: http://lore.kernel.org/linux-arm-kernel/1610712101-14929-1-git-send-email-sumit.garg@linaro.org
> 
> --- a/arch/arm64/kernel/perf_event.c
> +++ b/arch/arm64/kernel/perf_event.c
> @@ -1390,10 +1391,15 @@ static struct platform_driver armv8_pmu_driver = {
>  
>  static int __init armv8_pmu_driver_init(void)
>  {
> +	int ret;
> +
>  	if (acpi_disabled)
> -		return platform_driver_register(&armv8_pmu_driver);
> +		ret = platform_driver_register(&armv8_pmu_driver);
>  	else
> -		return arm_pmu_acpi_probe(armv8_pmuv3_pmu_init);
> +		ret = arm_pmu_acpi_probe(armv8_pmuv3_pmu_init);
> +
> +	retry_lockup_detector_init();

Does it makes sense to call retry_lockup_detector_init() when
the above returned an error? Should it be?

	if (!ret)
		retry_lockup_detector_init();

> +	return ret;
>  }
>  device_initcall(armv8_pmu_driver_init)


I am not qualified to ack the arm-specific code. But otherwise
the change looks reasonable.

Best Regards,
Petr

  reply	other threads:[~2022-05-20  9:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 16:13 [PATCH v4 0/6] Support hld delayed init based on Pseudo-NMI for arm64 Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 1/6] kernel/watchdog: remove WATCHDOG_DEFAULT Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 2/6] kernel/watchdog: change watchdog_nmi_enable() to void Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 3/6] kernel/watchdog_hld: Ensure CPU-bound context when creating hardlockup detector event Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 4/6] kernel/watchdog: Adapt the watchdog_hld interface for async model Lecopzer Chen
2022-05-20  9:38   ` Petr Mladek
2022-05-26  9:39     ` Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 5/6] arm64: add hw_nmi_get_sample_period for preparation of lockup detector Lecopzer Chen
2022-04-27 16:13 ` [PATCH v4 6/6] arm64: Enable perf events based hard " Lecopzer Chen
2022-05-20  9:47   ` Petr Mladek [this message]
2022-05-26  9:35     ` Lecopzer Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YodjucHQ3Nab5J/f@alley \
    --to=pmladek@suse.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=jolsa@redhat.com \
    --cc=jthierry@redhat.com \
    --cc=keescook@chromium.org \
    --cc=kernelfans@gmail.com \
    --cc=lecopzer.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=maz@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nixiaoming@huawei.com \
    --cc=peterz@infradead.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=sumit.garg@linaro.org \
    --cc=wangqing@vivo.com \
    --cc=will@kernel.org \
    --cc=yj.chiang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).