From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: workqueues and percpu (was: [PATCH] dm: remake of the verity target) Date: Tue, 14 Aug 2012 10:54:31 -0700 Message-ID: <20120814175431.GR25632@google.com> References: <1330648393-20692-1-git-send-email-msb@chromium.org> <20120306215947.GB27051@google.com> <20120308143909.bfc4cb4d.akpm@linux-foundation.org> <20120308231521.GA2968@htj.dyndns.org> <20120309211512.GL27051@google.com> <20120309212049.GD24890@google.com> <20120309220623.GM27051@google.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20120309220623.GM27051@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mandeep Singh Baines Cc: Steffen Klassert , Will Drewry , Rusty Russell , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Elly Jones , Mikulas Patocka , Andrew Morton , Olof Johansson , Alasdair G Kergon , Milan Broz List-Id: dm-devel.ids Hello, On Fri, Mar 09, 2012 at 02:06:23PM -0800, Mandeep Singh Baines wrote: > > I think the right thing to do for now is to add cpu hotplug notifier > > and do flush_work_sync() on the work item. We can later move that > > logic into workqueue and remove it from crypto. > > > > That seems like the correct solution. I will implement that. So, I've been looking at it and now am not so sure whether moving it to workqueue core is necessary. With the proposed workqueue updates, workqueue's behavior is now closely aligned with the timer which also considers the specified affinity overridable (to avoid reentrancy and during CPU offlining) and I don't think it's reasonable to require users which need strict affinity to implement proper CPU up/down notifiers - in many cases, they need them anyway. I'll try to review the current users and think more about it. Thanks. -- tejun From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757189Ab2HNR52 (ORCPT ); Tue, 14 Aug 2012 13:57:28 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:57746 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756919Ab2HNRyk (ORCPT ); Tue, 14 Aug 2012 13:54:40 -0400 Date: Tue, 14 Aug 2012 10:54:31 -0700 From: Tejun Heo To: Mandeep Singh Baines Cc: Andrew Morton , Mikulas Patocka , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Alasdair G Kergon , Will Drewry , Elly Jones , Milan Broz , Olof Johansson , Steffen Klassert , Rusty Russell Subject: Re: workqueues and percpu (was: [PATCH] dm: remake of the verity target) Message-ID: <20120814175431.GR25632@google.com> References: <1330648393-20692-1-git-send-email-msb@chromium.org> <20120306215947.GB27051@google.com> <20120308143909.bfc4cb4d.akpm@linux-foundation.org> <20120308231521.GA2968@htj.dyndns.org> <20120309211512.GL27051@google.com> <20120309212049.GD24890@google.com> <20120309220623.GM27051@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120309220623.GM27051@google.com> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, Mar 09, 2012 at 02:06:23PM -0800, Mandeep Singh Baines wrote: > > I think the right thing to do for now is to add cpu hotplug notifier > > and do flush_work_sync() on the work item. We can later move that > > logic into workqueue and remove it from crypto. > > > > That seems like the correct solution. I will implement that. So, I've been looking at it and now am not so sure whether moving it to workqueue core is necessary. With the proposed workqueue updates, workqueue's behavior is now closely aligned with the timer which also considers the specified affinity overridable (to avoid reentrancy and during CPU offlining) and I don't think it's reasonable to require users which need strict affinity to implement proper CPU up/down notifiers - in many cases, they need them anyway. I'll try to review the current users and think more about it. Thanks. -- tejun