From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755042AbcEZSuf (ORCPT ); Thu, 26 May 2016 14:50:35 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:34239 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754692AbcEZSuc (ORCPT ); Thu, 26 May 2016 14:50:32 -0400 Date: Thu, 26 May 2016 14:50:29 -0400 From: Tejun Heo To: Bhaktipriya Shridhar 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() Message-ID: <20160526185029.GA23194@mtj.duckdns.org> References: <20160526184517.GA8758@Karyakshetra> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160526184517.GA8758@Karyakshetra> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Other than that, Acked-by: Tejun Heo Thanks. -- tejun