Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752675Ab0DXFVh (ORCPT ); Sat, 24 Apr 2010 01:21:37 -0400 Received: from mail-iw0-f197.google.com ([209.85.223.197]:34892 "EHLO mail-iw0-f197.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752296Ab0DXFVf convert rfc822-to-8bit (ORCPT ); Sat, 24 Apr 2010 01:21:35 -0400 MIME-Version: 1.0 In-Reply-To: References: <1271984938-13920-1-git-send-email-arve@android.com> <1271984938-13920-3-git-send-email-arve@android.com> <1271984938-13920-4-git-send-email-arve@android.com> <1271984938-13920-5-git-send-email-arve@android.com> <1271984938-13920-6-git-send-email-arve@android.com> <1271984938-13920-7-git-send-email-arve@android.com> <1271984938-13920-8-git-send-email-arve@android.com> <4BD1576E.5070401@kernel.org> <20100423122032.GA23544@redhat.com> Date: Fri, 23 Apr 2010 22:21:34 -0700 Message-ID: Subject: Re: [PATCH 7/9] PM: Add suspend blocking work. From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: Oleg Nesterov Cc: Tejun Heo , linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Andrew Morton , Dmitri Vorobiev , Jiri Kosina , Thomas Gleixner , Ingo Molnar , Andi Kleen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1777 Lines: 39 2010/4/23 Arve Hj?nnev?g : > On Fri, Apr 23, 2010 at 5:20 AM, Oleg Nesterov wrote: >> On 04/23, Tejun Heo wrote: >>> >>> On 04/23/2010 03:08 AM, Arve Hj?nnev?g wrote: >>> > Allow work to be queued that will block suspend while it is pending >>> > or executing. To get the same functionality in the calling code often >>> > requires a separate suspend_blocker for pending and executing work, or >>> > additional state and locking. >>> >>> Hmm... I think this can be implemented as pure wrapper around >>> workqueue instead of injecting a flag and code into workqueue core. >>> Adding @fn field to suspend_blocking_work struct and using a custom >>> work function to call it and then invoke suspend_unblock() should be >>> enough, right? ?Oh, dedicated queue functions will be needed too. ?I >>> don't think it's wise to meddle with workqueue core code for this. >> >> Completely agreed. The patch adds very "strange" hacks into workqueue >> code to solve the very specific problems. >> > > I want the suspend blocker active when the work is pending or running. > I did not see a way to do this on top of the workqueue api without > adding additional locking. > I can remove the WORK_STRUCT_SUSPEND_BLOCKING flag and instead add an argument to __queue_work and __cancel_work_timer (or use separate copies) if you think that would be better. It would avoid increasing the alignment requirement of cpu_workqueue_struct, but it will probably add more code than the current patch. -- Arve Hj?nnev?g -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/