From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753775AbbGaRPK (ORCPT ); Fri, 31 Jul 2015 13:15:10 -0400 Received: from casper.infradead.org ([85.118.1.10]:33973 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753214AbbGaRPI (ORCPT ); Fri, 31 Jul 2015 13:15:08 -0400 Date: Fri, 31 Jul 2015 19:14:57 +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 1/4] module: use rcu_read_lock() while walking over a RCU protected list Message-ID: <20150731171457.GZ25159@twins.programming.kicks-ass.net> References: <1438362488-29857-1-git-send-email-bigeasy@linutronix.de> <1438362488-29857-2-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-2-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:05PM +0200, Sebastian Andrzej Siewior wrote: > The `modules' list uses list_for_each_entry_rcu() itarator. > rcu_readlock() protects here against against module removal invoked from > another CPU while preempt_disable() does not. Not so, it does in fact. > I don't understand what syncs in CONFIG_MODULES_TREE_LOOKUP against > module removal. In the other (RCU) case there is synchronize_sched(). Its using rcu-sched aka preempt_disable. if you want to use rcu primitives, use rcu_read_lock_sched(), but that is in fact identical to preempt_disable(). Your patch breaks things.