Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936927AbWLFRn2 (ORCPT ); Wed, 6 Dec 2006 12:43:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S936933AbWLFRn2 (ORCPT ); Wed, 6 Dec 2006 12:43:28 -0500 Received: from mx1.redhat.com ([66.187.233.31]:44043 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936927AbWLFRn2 (ORCPT ); Wed, 6 Dec 2006 12:43:28 -0500 From: David Howells In-Reply-To: References: <1165125055.5320.14.camel@gullible> <20061203011625.60268114.akpm@osdl.org> <20061205123958.497a7bd6.akpm@osdl.org> <6FD5FD7A-4CC2-481A-BC87-B869F045B347@freescale.com> <20061205132643.d16db23b.akpm@osdl.org> <20061205135753.9c3844f8.akpm@osdl.org> <20061206075729.b2b6aa52.akpm@osdl.org> To: Linus Torvalds Cc: Andrew Morton , David Howells , "Maciej W. Rozycki" , Roland Dreier , Andy Fleming , Ben Collins , Linux Kernel Mailing List , Jeff Garzik Subject: Re: [PATCH] Export current_is_keventd() for libphy X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Wed, 06 Dec 2006 17:43:13 +0000 Message-ID: <21690.1165426993@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 40 Linus Torvalds wrote: > How about something like this? At first glance, this looks reasonable. It also looks like it should be used to replace a lot of the cancel_delayed_work() calls that attempt to cancel _undelayed_ work items. That would allow a number of work items to be downgraded from delayed_work to work_struct. Also, the name "run_scheduled_work" sort of suggests that the work *will* be run regardless of whether it was pending or not. Given the confusion over cancel_delayed_work(), I imagine this will rain confusion too. + if (get_wq_data(work) == cwq + && test_bit(WORK_STRUCT_PENDING, &work->management) I wonder if those can be combined, perhaps: + if ((work->management & ~WORK_STRUCT_NOAUTOREL) == + ((unsigned long) cwq | (1 << WORK_STRUCT_PENDING)) Otherwise for i386 the compiler can't combine them because test_bit() is done with inline asm. And: + if (!test_bit(WORK_STRUCT_PENDING, &work->management)) Should possibly be: + if (!work_pending(work)) David - 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/