Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751577AbbGaCxW (ORCPT ); Thu, 30 Jul 2015 22:53:22 -0400 Received: from g2t2354.austin.hp.com ([15.217.128.53]:59678 "EHLO g2t2354.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750789AbbGaCxV (ORCPT ); Thu, 30 Jul 2015 22:53:21 -0400 Message-ID: <55BAE31D.6060004@hp.com> Date: Thu, 30 Jul 2015 22:53:17 -0400 From: Waiman Long User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12 MIME-Version: 1.0 To: "Eric W. Biederman" CC: Andrew Morton , Nicolas Dichtel , Al Viro , Alexey Dobriyan , linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch Subject: Re: [PATCH] proc: change proc_subdir_lock to a rwlock References: <1438201199-2809-1-git-send-email-Waiman.Long@hp.com> <55BADA98.3000304@hp.com> In-Reply-To: <55BADA98.3000304@hp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 34 On 07/30/2015 10:16 PM, Waiman Long wrote: > On 07/29/2015 06:21 PM, Eric W. Biederman wrote: >> Two quick questions. >> >> - What motivates this work? Are you seeing lots of >> parallel reads on proc? > > The micro-benchmark that I used was artificial, but it was used to > reproduce an exit hanging problem that I saw in real application. In > fact, only allow one task to do a lookup seems too limiting to me. >> - Why not rcu? Additions and removal of proc generic >> files is very rare. Conversion to rcu for reads should >> perform better and not take much more work. > > RCU is harder to verify its correctness, whereas rwlock is easier to > use and understand. If it is really a performance critical path where > every extra bit of performance counts, I will certainly think RCU may > be the right choice. However, in this particular case, I don't think > using RCU will give any noticeable performance gain compared with a > rwlock. One more thing, RCU is typically used with linked list. It is not easy to use RCU with rbtree and may require major changes to the code. Another alternative is to use seqlock + RCU, but it will still need more code changes than rwlock. Cheers, Longman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/