Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbZAZQEp (ORCPT ); Mon, 26 Jan 2009 11:04:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751394AbZAZQEh (ORCPT ); Mon, 26 Jan 2009 11:04:37 -0500 Received: from fg-out-1718.google.com ([72.14.220.159]:32998 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbZAZQEg convert rfc822-to-8bit (ORCPT ); Mon, 26 Jan 2009 11:04:36 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oRj+1AXSLnFqxCEHQnjeL6ECSi2xSLTZdWAcoS4J6FtbyMoauuDcINbrQ6DOgAkdVe 4JrfQ5efIOMz7Xrp65ETGzKpVZ6g+0Fl1cVG1XfeIeP30uJyWQNyr/zAZDr9rcONH40q ZqRwCi/r3LyYQSxQi7io+kgUH0mZDcF1+Hm6w= MIME-Version: 1.0 In-Reply-To: <1232984248.4863.106.camel@laptop> References: <497cd08f.0c11660a.33a7.ffffdf39@mx.google.com> <1232977715.4863.81.camel@laptop> <1232984248.4863.106.camel@laptop> Date: Mon, 26 Jan 2009 17:04:34 +0100 Message-ID: Subject: Re: [RFC][PATCH 2/2] add a counter for writers spinning on a rwlock From: =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Andrew Morton , Mandeep Singh Baines 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: 1566 Lines: 39 2009/1/26 Peter Zijlstra : > On Mon, 2009-01-26 at 16:25 +0100, Fr?d?ric Weisbecker wrote: >> 2009/1/26 Peter Zijlstra : >> > On Sun, 2009-01-25 at 12:50 -0800, Frederic Weisbecker wrote: >> >> This patch adds a counter for writers that enter a rwlock slow path. >> >> For example it can be useful for slow background tasks which perform some jobs >> >> on the tasklist, such as the hung_task detector (kernel/hung_task.c). >> >> >> >> It adds a inc/dec pair on the slow path and 4 bytes for each rwlocks, so the overhead >> >> is not null. >> >> >> >> Only x86 is supported for now, writers_spinning_lock() will return 0 on other archs (which >> >> is perhaps not a good idea). >> >> >> >> Comments? >> > >> > _why_ ? >> >> The hung task detector runs a periodic loop through the task_list, and >> currently it doesn't run >> over an arbitrary threshold of tasks to not hold the task_list lock >> for too long. >> >> So we thought about a way to detect if there are some writers waiting >> for the lock, anf if so, release >> the lock, schedule and retry. > > Ah, if it can do that, then it can also use RCU, no? Only users who > really have to hold off new tasks need the read-task_lock. The rest can > use RCU. Really? That sounds a good news. Mandeep, what do you think? -- 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/