Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757342AbXFOTA4 (ORCPT ); Fri, 15 Jun 2007 15:00:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753641AbXFOTAs (ORCPT ); Fri, 15 Jun 2007 15:00:48 -0400 Received: from nz-out-0506.google.com ([64.233.162.233]:9742 "EHLO nz-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbXFOTAr (ORCPT ); Fri, 15 Jun 2007 15:00:47 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=UQtgyJfFHfqqbtyjmxEYGKj5svPHpOrLl200FNABIfjCCw/nOymF/VI86hHFmBH8dYZNSFeX+rn0aRlRT264b5wDtNs+mz27gqwlCiBzfIqUSxDbmk+iRhiP0zlztGlpKxPG2RzTpcjlfnrXMNyYEWEZFJj1yRIzdUv7QVv8dD4= Message-ID: Date: Fri, 15 Jun 2007 15:00:46 -0400 From: "Dmitry Torokhov" To: LKML , "Paul E. McKenney" Subject: Using RCU with rcu_read_lock()? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 27 Hi, I have a piece of code that is always called under a spinlock with interrups disabled. Within that piece of code I iterate through a list. I have another piece of code that wants to modify that list. I have 2 options: 1) Have the other piece of code acquire the same spinlock 2) Use RCU I don't want to do 1) because the otheir piece of code does not really care about object owning the spinlock and so acquiring the spinlock is "not nice". However it is guaranteed that the piece of code that accesses lock runs atomically with interrupts disabled. So rcu_read_lock() would be superfluos there. Is it possible to still use list_for_each_rcu() and friends to access that list without rcu_read_lock()? Or it is betteruse complete RCU interface and eat cost of couple of extra instrctions? -- Dmitry - 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/