Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752024AbdI0RSU (ORCPT ); Wed, 27 Sep 2017 13:18:20 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:40571 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbdI0RSS (ORCPT ); Wed, 27 Sep 2017 13:18:18 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Gargi Sharma Cc: linux-kernel@vger.kernel.org, riel@surriel.com, julia.lawall@lip6.fr, akpm@linux-foundation.org, mingo@kernel.org, pasha.tatashin@oracle.com, ktkhai@virtuozzo.com, oleg@redhat.com References: Date: Wed, 27 Sep 2017 12:18:08 -0500 In-Reply-To: (Gargi Sharma's message of "Wed, 27 Sep 2017 01:06:01 -0400") Message-ID: <87ing4vz5b.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1dxFyQ-0005TY-M8;;;mid=<87ing4vz5b.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=67.3.200.44;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/hOwmLefOSkkmFwCTICsmFfS+5Q65FTPQ= X-SA-Exim-Connect-IP: 67.3.200.44 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 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 * [sa03 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Gargi Sharma X-Spam-Relay-Country: X-Spam-Timing: total 778 ms - load_scoreonly_sql: 0.19 (0.0%), signal_user_changed: 9 (1.1%), b_tie_ro: 7 (0.8%), parse: 1.58 (0.2%), extract_message_metadata: 9 (1.1%), get_uri_detail_list: 3.8 (0.5%), tests_pri_-1000: 8 (1.0%), tests_pri_-950: 2.6 (0.3%), tests_pri_-900: 2.3 (0.3%), tests_pri_-400: 39 (5.1%), check_bayes: 37 (4.7%), b_tokenize: 14 (1.8%), b_tok_get_all: 9 (1.2%), b_comp_prob: 6 (0.8%), b_tok_touch_all: 3.4 (0.4%), b_finish: 0.91 (0.1%), tests_pri_0: 668 (85.9%), check_dkim_signature: 1.42 (0.2%), check_dkim_adsp: 9 (1.1%), tests_pri_500: 14 (1.8%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v2 0/2] Replace PID bitmap allocation with IDR API X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3016 Lines: 77 Gargi Sharma writes: > This patch series replaces kernel bitmap implementation of PID allocation > with IDR API. These patches are written to simplify the kernel by replacing custom code with calls to generic code. > > The following are the stats for pid and pid_namespace object files > before and after the replacement. There is a noteworthy change between > the IDR and bitmap implementation. > > Before > text data bss dec hex filename > 8447 3894 64 12405 3075 kernel/pid.o > After > text data bss dec hex filename > 3301 304 0 3605 e15 kernel/pid.o > > Before > text data bss dec hex filename > 5692 1842 192 7726 1e2e kernel/pid_namespace.o > After > text data bss dec hex filename > 2870 216 16 3102 c1e kernel/pid_namespace.o > > There wasn't a considerable difference between the time required for > allocation of PIDs to the processes. How about the time to call readdir on /proc? How many processes were you testing with? Why just the bitmap? Why not update the hash table as well. An rbtree or an rhashtable might be better. Hmm. Oh look there is patch 2/2 and you do replace the hashtable with the idr as well. Now I am very interested in a comparison of data structures. How does the runtime memory footprint of your new pid hash implementation compare to the old memory footprint? There are a lot of options in this space and it does not sound like you have looked at the options very thoroughly. I am a little worried that in the quest to reuse code you may have made the total amount of code executed larger and more susceptible to more cache line misses. >From what Oleg has pointed out and from your the holes in your description I am generally leery of this patchset as the attention to detail was appears lower than necessary for this to be more than a proof of concept. Eric > --- > Changes in v2: > - Removed redundant IDR function that was introduced > in the previous patchset. > - Renamed PIDNS_HASH_ADDING > - Used idr_for_each_entry_continue() > - Used idr_find() to lookup pids > > Gargi Sharma (2): > pid: Replace pid bitmap implementation with IDR API > pid: Remove pidhash > > arch/powerpc/platforms/cell/spufs/sched.c | 2 +- > fs/proc/loadavg.c | 2 +- > include/linux/init_task.h | 1 - > include/linux/pid.h | 2 - > include/linux/pid_namespace.h | 18 +-- > init/main.c | 3 +- > kernel/fork.c | 2 +- > kernel/pid.c | 239 +++++------------------------- > kernel/pid_namespace.c | 54 +++---- > 9 files changed, 68 insertions(+), 255 deletions(-)