Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850AbbHCSKJ (ORCPT ); Mon, 3 Aug 2015 14:10:09 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:56768 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644AbbHCSKH (ORCPT ); Mon, 3 Aug 2015 14:10:07 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Waiman Long Cc: Andrew Morton , Nicolas Dichtel , Al Viro , Alexey Dobriyan , linux-kernel@vger.kernel.org, Scott J Norton , Douglas Hatch References: <1438201199-2809-1-git-send-email-Waiman.Long@hp.com> <55BADA98.3000304@hp.com> <55BAE31D.6060004@hp.com> Date: Mon, 03 Aug 2015 13:03:20 -0500 In-Reply-To: <55BAE31D.6060004@hp.com> (Waiman Long's message of "Thu, 30 Jul 2015 22:53:17 -0400") Message-ID: <87wpxcdzbr.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX19T7+TuEiN961s0POgc206LqTIo78V+9mE= X-SA-Exim-Connect-IP: 97.119.22.40 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Waiman Long X-Spam-Relay-Country: X-Spam-Timing: total 1503 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 4.2 (0.3%), b_tie_ro: 3.0 (0.2%), parse: 1.19 (0.1%), extract_message_metadata: 119 (7.9%), get_uri_detail_list: 2.2 (0.1%), tests_pri_-1000: 75 (5.0%), tests_pri_-950: 1.97 (0.1%), tests_pri_-900: 14 (0.9%), tests_pri_-400: 127 (8.5%), check_bayes: 125 (8.3%), b_tokenize: 62 (4.1%), b_tok_get_all: 15 (1.0%), b_comp_prob: 16 (1.1%), b_tok_touch_all: 12 (0.8%), b_finish: 1.09 (0.1%), tests_pri_0: 1129 (75.1%), tests_pri_500: 27 (1.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] proc: change proc_subdir_lock to a rwlock X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1647 Lines: 39 Waiman Long writes: > 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. I had forgotten we had switch proc directories to rbtrees. So on that note. Acked-by: "Eric W. Biederman" Eric -- 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/