Re: [PATCH] s390/oprofile: Remove deprecated create_workqueue

From: Heiko Carstens
Date: Thu Jun 09 2016 - 05:01:49 EST


On Wed, Jun 08, 2016 at 03:29:12AM +0530, Bhaktipriya Shridhar wrote:
> A dedicated workqueue has been used since the workqueue hws_wq with
> workitem &cb->worker, is involved in hardware based sampling
> on System z processors.
>
> Since, these are long-running work items and aren't involved in memory
> reclaim in any way, system_long_wq has been used.
>
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@xxxxxxxxx>
> ---
> arch/s390/oprofile/hwsampler.c | 21 +++------------------
> 1 file changed, 3 insertions(+), 18 deletions(-)

Besides that your patch doesn't compile... ;)

Removing the flush_workqueue is probably wrong, since the oprofile module
can now be unloaded while there could still be a reference to a worker
structure owned by the oprofile module.

However I'm wondering if we shouldn't simply remove at least the s390
specific hwswampler code from the oprofile module. This would still leave
the common code timer based sampling mode for oprofile working on s390.

It looks like the oprofile user space utility nowadays (since 2012) uses
the kernel perf interface instead of the oprofile interface anyway, if
present. So the oprofile module itself doesn't seem to have too many users
left.

Any opinions?

>
> - if (hws_wq)
> - flush_workqueue(hws_wq);
> -
> mutex_lock(&hws_sem);
>
> if (hws_state == HWS_STOPPED) {
> @@ -1059,10 +1048,6 @@ int hwsampler_shutdown(void)
> hws_alert = 0;
> deallocate_sdbt();
> }
> - if (hws_wq) {
> - destroy_workqueue(hws_wq);
> - hws_wq = NULL;
> - }
>
> unregister_external_irq(EXT_IRQ_MEASURE_ALERT, hws_ext_handler);
> hws_state = HWS_INIT;
> --
> 2.1.4
>