From: Tejun Heo <tj@kernel.org>
To: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
alexander.deucher@amd.com, christian.koenig@amd.com
Subject: Re: [PATCH] gpu: drm: amd: amdkfd: Remove create_workqueue()
Date: Thu, 26 May 2016 14:50:29 -0400 [thread overview]
Message-ID: <20160526185029.GA23194@mtj.duckdns.org> (raw)
In-Reply-To: <20160526184517.GA8758@Karyakshetra>
On Fri, May 27, 2016 at 12:15:17AM +0530, Bhaktipriya Shridhar wrote:
> alloc_workqueue replaces deprecated create_workqueue().
>
> kfd_process_wq is used for delay destruction. A work item embedded in
> kfd_process gets queued to kfd_process_wq and when it executes it
> destroys and frees the containing kfd_process and thus itself.
>
> This requires a dedicated workqueue because a work item once queued, may
> get freed at any point of time and any external entity cannot
> flush the work item. So, in order to wait for such a work item,
> it needs to be put on a dedicated workqueue.
>
> kfd_module_exit() calls kfd_process_destroy_wq which ensures that all
> pending work items are finished before the module is removed.
>
> flush_workqueue is unnecessary since destroy_workqueue() itself calls
> drain_workqueue() which flushes repeatedly till the workqueue becomes empty.
>
> Hence flush_workqueue has been removed.
create_workqueue(NAME) maps to alloc_workqueue(NAME, WQ_MEM_RECLAIM, 1),
so the change is effectively dropping WQ_MEM_RECLAIM and changing
concurrency value from 1 to WQ_DFL_ACTIVE. It'd be nice to explain
why these changes are safe and I think they're. It just needs
explanations.
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Other than that, Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Cc: oded.gabbay@gmail.com, alexander.deucher@amd.com,
christian.koenig@amd.com, airlied@linux.ie,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpu: drm: amd: amdkfd: Remove create_workqueue()
Date: Thu, 26 May 2016 14:50:29 -0400 [thread overview]
Message-ID: <20160526185029.GA23194@mtj.duckdns.org> (raw)
In-Reply-To: <20160526184517.GA8758@Karyakshetra>
On Fri, May 27, 2016 at 12:15:17AM +0530, Bhaktipriya Shridhar wrote:
> alloc_workqueue replaces deprecated create_workqueue().
>
> kfd_process_wq is used for delay destruction. A work item embedded in
> kfd_process gets queued to kfd_process_wq and when it executes it
> destroys and frees the containing kfd_process and thus itself.
>
> This requires a dedicated workqueue because a work item once queued, may
> get freed at any point of time and any external entity cannot
> flush the work item. So, in order to wait for such a work item,
> it needs to be put on a dedicated workqueue.
>
> kfd_module_exit() calls kfd_process_destroy_wq which ensures that all
> pending work items are finished before the module is removed.
>
> flush_workqueue is unnecessary since destroy_workqueue() itself calls
> drain_workqueue() which flushes repeatedly till the workqueue becomes empty.
>
> Hence flush_workqueue has been removed.
create_workqueue(NAME) maps to alloc_workqueue(NAME, WQ_MEM_RECLAIM, 1),
so the change is effectively dropping WQ_MEM_RECLAIM and changing
concurrency value from 1 to WQ_DFL_ACTIVE. It'd be nice to explain
why these changes are safe and I think they're. It just needs
explanations.
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Other than that, Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2016-05-26 18:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 18:45 [PATCH] gpu: drm: amd: amdkfd: Remove create_workqueue() Bhaktipriya Shridhar
2016-05-26 18:45 ` Bhaktipriya Shridhar
2016-05-26 18:50 ` Tejun Heo [this message]
2016-05-26 18:50 ` Tejun Heo
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=20160526185029.GA23194@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=alexander.deucher@amd.com \
--cc=bhaktipriya96@gmail.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.