From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755979Ab3JJSne (ORCPT ); Thu, 10 Oct 2013 14:43:34 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:3215 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755322Ab3JJSnc (ORCPT ); Thu, 10 Oct 2013 14:43:32 -0400 Date: Thu, 10 Oct 2013 14:43:27 -0400 From: Steven Rostedt To: Linus Torvalds Cc: Andrew Morton , Peter Zijlstra , Oleg Nesterov , Ingo Molnar , "Srivatsa S. Bhat" , Paul McKenney , Mel Gorman , Rik van Riel , Srikar Dronamraju , Andrea Arcangeli , Johannes Weiner , Thomas Gleixner , Linux Kernel Mailing List Subject: Re: [PATCH 0/6] Optimize the cpu hotplug locking -v2 Message-ID: <20131010144327.5ded02ec@gandalf.local.home> In-Reply-To: References: <20131008102505.404025673@infradead.org> <20131009225006.7101379c.akpm@linux-foundation.org> <20131010121908.GB28601@twins.programming.kicks-ass.net> <20131010145738.GA5167@gmail.com> <20131010152612.GA13375@redhat.com> <20131010090044.7f12ddaf.akpm@linux-foundation.org> <20131010123631.1be60315@gandalf.local.home> <20131010094355.6f75e5a2.akpm@linux-foundation.org> <20131010165337.GT3081@twins.programming.kicks-ass.net> <20131010131305.58558079@gandalf.local.home> <20131010104856.8f042977112d5ac2693973ae@linux-foundation.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Oct 2013 11:10:35 -0700 Linus Torvalds wrote: .. now we can free all the percpu data and kill the CPU .. > > without any locking anywhere - not stop-machine, not anything. If > somebody is doing a "for_each_cpu()" (under just a regular > rcu_read_lock()) and they see the bit set while it's going down, who > cares? The CPU is still there, the data is accessible.. The problem is that rcu_read_lock() requires preemption disabled unless you are using the preemptable rcu tree version. There's always srcu_read_lock() but that's not so free. It's basically the same as what Peter is doing. There's places in the kernel that does for_each_cpu() that I'm sure you don't want to disable preemption for. Especially when you start having 4096 CPU machines! -- Steve