From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753486AbbGaRW4 (ORCPT ); Fri, 31 Jul 2015 13:22:56 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:50978 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbbGaRWz (ORCPT ); Fri, 31 Jul 2015 13:22:55 -0400 Date: Fri, 31 Jul 2015 19:22:46 +0200 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Rusty Russell , Ananth N Mavinakayanahalli , Anil S Keshavamurthy , tglx@linutronix.de Subject: Re: [RFC 0/4] use rcu_read_lock() during module list walk Message-ID: <20150731172246.GB25159@twins.programming.kicks-ass.net> References: <1438362488-29857-1-git-send-email-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438362488-29857-1-git-send-email-bigeasy@linutronix.de> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 31, 2015 at 07:08:04PM +0200, Sebastian Andrzej Siewior wrote: > Hi Peter, > > this series was made before I noticed that you introduced a RB tree for > lookup but the old way still remains under !CONFIG_MODULES_TREE_LOOKUP. > In the old way the caller had preempt_disable() while invoking > list_for_each_safe_rcu() which is (according to the RCU checklist) not a > substitute for rcu_readlock(). This is true. preempt_disable() != rcu_read_lock(). > With your CONFIG_MODULES_TREE_LOOKUP I fail to understand what blocks > free_module() until all mod_find() callers have dropped their refrence to > the obtained struct mod. We had synchronize_sched() in RCU case. We still have synchronize_sched(), but that is not RCU, that is RCU-sched, and rcu_read_lock_sched() == preempt_disable() (+- some debugging bits). The code used to be broken in this regard, see 0be964be0d45 ("module: Sanitize RCU usage and locking"), that fixed things to be consistent.