From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751201AbdANPT1 (ORCPT ); Sat, 14 Jan 2017 10:19:27 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34610 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbdANPTZ (ORCPT ); Sat, 14 Jan 2017 10:19:25 -0500 Date: Sat, 14 Jan 2017 10:19:21 -0500 From: Tejun Heo To: Vladimir Davydov Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, jsvana@fb.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 2/9] slab: remove synchronous rcu_barrier() call in memcg cache release path Message-ID: <20170114151921.GA32693@mtj.duckdns.org> References: <20170114055449.11044-1-tj@kernel.org> <20170114055449.11044-3-tj@kernel.org> <20170114131939.GA2668@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170114131939.GA2668@esperanza> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Vladimir. On Sat, Jan 14, 2017 at 04:19:39PM +0300, Vladimir Davydov wrote: > On Sat, Jan 14, 2017 at 12:54:42AM -0500, Tejun Heo wrote: > > This patch updates the cache release path so that it simply uses > > call_rcu() instead of the synchronous rcu_barrier() + custom batching. > > This doesn't cost more while being logically simpler and way more > > scalable. > > The point of rcu_barrier() is to wait until all rcu calls freeing slabs > from the cache being destroyed are over (rcu_free_slab, kmem_rcu_free). > I'm not sure if call_rcu() guarantees that for all rcu implementations > too. If it did, why would we need rcu_barrier() at all? Yeah, I had a similar question and scanned its users briefly. Looks like it's used in combination with ctors so that its users can opportunistically dereference objects and e.g. check ids / state / whatever without worrying about the objects' lifetimes. Thanks. -- tejun