Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755845AbZJARFZ (ORCPT ); Thu, 1 Oct 2009 13:05:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755797AbZJARFZ (ORCPT ); Thu, 1 Oct 2009 13:05:25 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:49640 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755782AbZJARFY (ORCPT ); Thu, 1 Oct 2009 13:05:24 -0400 Date: Thu, 1 Oct 2009 10:03:19 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Tejun Heo cc: jeff@garzik.org, Ingo Molnar , Linux Kernel Mailing List , Andrew Morton , Jens Axboe , rusty@rustcorp.com.au, cl@linux-foundation.org, dhowells@redhat.com, arjan@linux.intel.com Subject: Re: [PATCH 15/19] workqueue: reimplement workqueue flushing using color coded works In-Reply-To: <1254384558-1018-16-git-send-email-tj@kernel.org> Message-ID: References: <1254384558-1018-1-git-send-email-tj@kernel.org> <1254384558-1018-16-git-send-email-tj@kernel.org> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 22 On Thu, 1 Oct 2009, Tejun Heo wrote: > > Reimplement workqueue flushing using color coded works. There are two > colors and each cwq has the current color which is painted on the > works being issued via the cwq. Flushing a workqueue is achieved by > flipping the current colors of each cwq and wait for the works which > have the old color to drain. Is there any reason for the "two colors" choice? I could imagine that it could end up being a limitation (and possible deadlock?) to allow just a single flush pending at any time. Could the color be an 8-bit counter or something like that instead? Linus -- 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/