Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408586
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Oded Gabbay <oded.gabbay@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] gpu: drm: amd: amdkfd: Remove create_workqueue() |
| Date | Sun, 29 May 2016 17:10:01 +0200 |
| Message-ID | <rEavL-7SI-7@gated-at.bofh.it> (permalink) |
| References | <rD9iq-1Yf-25@gated-at.bofh.it> |
| X-Original-To | Bhaktipriya Shridhar <bhaktipriya96@gmail.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1r7n/N+BufR9jwZAPG4H4CEzwuiSEe3SXvkJAXMP2X0=; b=HmtF4nVh8EejmT1M4WX1r1Sn4TecKZ5Ghw9pVwFC9dl6owQgB6m4of3YXAwgexVviI oxzGcMc1jWkfkprTb5C4y7ymhz2fieZzWbTPTZTfy+fzBfthrPrX59ghDAHoKQdg/hOF JrMeGQow1Sbmg2d3Wfwy11Eq3dDRT8l9pwACZLqtPNV9cnABlpjYk83kUDy8O2awFcwL V14FmaFuFdex7/zgnDm6/9Z3Fn42NblErV7WbXrMknuLkNB0dDdApFiiW9pvAOVCvOZB bqydqw2rBEXCsflhtJCO2oTtIQOMEpiDxcXMfekSQyv3pdUupNJsVtxmh7f01fdVigbP sM4w== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1r7n/N+BufR9jwZAPG4H4CEzwuiSEe3SXvkJAXMP2X0=; b=V+2aDegR02aApUcnTsP5fRzG2DKjQsnkAm/XrJ68qQWHkP8HD7XfTpJeh3e+a3/cHd U9EeZVpEXl+WaR/oVcrU9IQskRHs0BPXJE8dUHyeHBhkvgAL53LcaIQAScml3p7y+B+H kUMyNTrF1+rvd2TfiCH53eQ5UAiS6v7CjUjcPT60inETwW4EHGLgFa/f+5jJw2TkYmRc W0KYtqxNRjJBdYYM9IQGqetRCqk2jvBzDXbSVpSASpgtreamNjX+HA8Wy/doWjiEU3SF eesyV8Z7Y/Umk+PaGdvLcuO31OYfwJLS3WqHOedLmoM/7xJrMreRWXTWw9rFqTGxYw3H YA0Q== |
| X-Gm-Message-State | ALyK8tLttVxo+NKLOVPcVN5MIubadWuuYcXwTo8Ljxb5eDij0CLtr704f6Bh2eyAz+n1Q4kvLFmWtvzsBoCG2A== |
| X-Received | by 10.28.4.79 with SMTP id 76mr7099996wme.41.1464534095338; Sun, 29 May 2016 08:01:35 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 69 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | tj@kernel.org, Alex Deucher <alexander.deucher@amd.com>, Christian König <christian.koenig@amd.com>, David Airlie <airlied@linux.ie>, Maling list - DRI developers <dri-devel@lists.freedesktop.org>, "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org> |
| X-Original-Date | Sun, 29 May 2016 18:01:05 +0300 |
| X-Original-Message-ID | <CAFCwf10cd41Q=0UQYy1koBLsVv5H9VmtgccC1ONa53ahsd-WEQ@mail.gmail.com> |
| X-Original-References | <20160526193733.GA9405@Karyakshetra> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1408586 |
Show key headers only | View raw
On Thu, May 26, 2016 at 10:37 PM, Bhaktipriya Shridhar
<bhaktipriya96@gmail.com> wrote:
> alloc_workqueue replaces deprecated create_workqueue().
>
> create_workqueue has been replaced with alloc_workqueue with max_active
> as 0 since there is no need for throttling the number of active work items.
>
> WQ_MEM_RECLAIM has not been set to because kfd_process_wq will not be used in
> memory reclaim path.
>
> 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.
>
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
> ---
> Changes in v2:
> - added explanation for setting concurrency value to
> WQ_DFL_ACTIVE
> - added explanation for dropping WQ_MEM_RECLAIM
>
> drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> index ac00579..b21d3fc8 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
> @@ -63,13 +63,12 @@ static struct kfd_process *create_process(const struct task_struct *thread);
> void kfd_process_create_wq(void)
> {
> if (!kfd_process_wq)
> - kfd_process_wq = create_workqueue("kfd_process_wq");
> + kfd_process_wq = alloc_workqueue("kfd_process_wq",0,0);
You are missing a space between the arguments. Seem you forgot to run
checkpatch.pl ;)
Send a new patch and I'll add it to amdkfd's tree.
Thanks,
Oded
> }
>
> void kfd_process_destroy_wq(void)
> {
> if (kfd_process_wq) {
> - flush_workqueue(kfd_process_wq);
> destroy_workqueue(kfd_process_wq);
> kfd_process_wq = NULL;
> }
> --
> 2.1.4
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] gpu: drm: amd: amdkfd: Remove create_workqueue() Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-05-26 21:40 +0200
Re: [PATCH v2] gpu: drm: amd: amdkfd: Remove create_workqueue() Tejun Heo <tj@kernel.org> - 2016-05-26 22:20 +0200
Re: [PATCH v2] gpu: drm: amd: amdkfd: Remove create_workqueue() Oded Gabbay <oded.gabbay@gmail.com> - 2016-05-29 17:10 +0200
Re: [PATCH v2] gpu: drm: amd: amdkfd: Remove create_workqueue() Bhaktipriya Shridhar <bhaktipriya96@gmail.com> - 2016-05-29 17:50 +0200
csiph-web