From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbbCJSfr (ORCPT ); Tue, 10 Mar 2015 14:35:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39766 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752827AbbCJSfp (ORCPT ); Tue, 10 Mar 2015 14:35:45 -0400 Date: Tue, 10 Mar 2015 19:33:12 +0100 From: Oleg Nesterov To: Linus Torvalds Cc: Peter Zijlstra , "linux-tip-commits@vger.kernel.org" , Davidlohr Bueso , Peter Anvin , Sasha Levin , Thomas Gleixner , Linux Kernel Mailing List , Jason Low , Michel Lespinasse , Andrew Morton , Ingo Molnar , Paul McKenney , Dave Jones , Ming Lei , Tim Chen , Kirill Tkhai Subject: Re: [tip:locking/core] locking/rwsem: Fix lock optimistic spinning when owner is not running Message-ID: <20150310183312.GA13665@redhat.com> References: <1425714331.2475.388.camel@j-VirtualBox> <20150307171347.GA30365@redhat.com> <20150310172816.GA9058@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10, Linus Torvalds wrote: > > So I'm not a huge fan of SLAB_DESTROY_BY_RCU in general, but for > really core data structures like this, I think it's worth it. I agree, but we have other users which can't be fixed if we just add SLAB_DESTROY_BY_RCU to task_struct_cachep. So we need something else anyway. > The > overhead of "call_rcu()" can be quite noticeable, Yes, this was my concern too, > and the other > alternative solutions (like that suggested task_rcu_dereference()) are > even *more* complex and subtle Yes, but at least the ugliness is hidden inside task_rcu_dereference(). The usage is simple. > and generally perform worse. Well, task_rcu_dereference() should be cheap enough. probe_slab_address() is a plain LOAD unless CONFIG_DEBUG_PAGEALLOC. But! > I'm not claiming it's perfect, Same here, it is not that I think task_rcu_dereference() is very nice. So I leave this to you and Peter ;) Oleg.