Received: by 10.213.65.68 with SMTP id h4csp1833738imn; Thu, 29 Mar 2018 11:54:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx49lFw1GNdTLPgunWpERYfGVIiQKRrX7wtLOnSva2PODqthsfpRVYpIhQxtfxZRUdc9cqNZN X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr9701764pll.264.1522349697057; Thu, 29 Mar 2018 11:54:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522349697; cv=none; d=google.com; s=arc-20160816; b=h0KZ1j45X1bbe7NwmpZ98nk3r5aOUDy6KiX8Sl+AlYFOQnf9D2KDG3saKOhyyItBuJ d6z0lzH/xYr0qR8Lgp3NAot18btgwirSYxCAb/4MRbD1raNOmg8YWNdJFgyVi/L3ZYyx Ww7WKzrbWOKkD/TVFWJoH6yNP1IxU0p9ARpJLFuOdUTr4fxQuAaByGKrNIgu/w2Ye/kI XGGgp9poSRgPowm+1rqoIs2/KYEalyxh08gve1q5m/T7k6tIMbWW+xCmxHSB2H99wJZ4 8FgSdv+o+duYSzSOumAty8XnSZtqsIUhfwJoDkf7ZxckaUc+BcqvFm2SAyQoAv9/Jwe2 FlxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from :arc-authentication-results; bh=Ui7Rx/bSCYa5QgS553WwHIe0eOvtFAPo1sTk3q3Uu7w=; b=BsTua656VqMOJymmtq+U34gXCa9OafEhHJ48/p3aD3xsFclqxWahjr+A42FJ1N2+AL s3dCQ5H/eLdF9qZtqdKLpjw3OYbM3aY+kzhJUJvdDWMeMm+mKgEbfqCdYf3MXgPOdKLX TQ0lG3EzaqzSYQFYGANwmg5LTrshNSpNqVratLSxs1AZgQH78wic4lJe2oLNauqVFaYi GNvEbUemsTaV8NYmKskgs6vAAqhAX63ok0ZIO5a5RBQ5drvzdGC8cJVPUd3/cliX4I2C 4vy8RCJWGPWGOpl+09FJGJqcs3AaqBcNCYqasGMA5hRH19uZE7O/McgPJjQBV6Y12SUy ZaqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q61-v6si6352061plb.719.2018.03.29.11.54.42; Thu, 29 Mar 2018 11:54:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbeC2Sxd (ORCPT + 99 others); Thu, 29 Mar 2018 14:53:33 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:42501 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbeC2Sxa (ORCPT ); Thu, 29 Mar 2018 14:53:30 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f1cfx-00087R-Sf; Thu, 29 Mar 2018 12:53:29 -0600 Received: from 67-3-145-25.omah.qwest.net ([67.3.145.25] helo=x220.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1f1cfw-0007S9-7G; Thu, 29 Mar 2018 12:53:29 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Manfred Spraul Cc: Matthew Wilcox , Davidlohr Bueso , Waiman Long , Michael Kerrisk , "Luis R. Rodriguez" , Kees Cook , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Al Viro , Stanislav Kinsbursky , Linux Containers , linux-api@vger.kernel.org References: <87woyfyh57.fsf@xmission.com> <5d4a858a-3136-5ef4-76fe-a61e7f2aed56@redhat.com> <87o9jru3bf.fsf@xmission.com> <935a7c50-50cc-2dc0-33bb-92c000d039bc@redhat.com> <87woyego2u.fsf_-_@xmission.com> <047c6ed6-6581-b543-ba3d-cadc543d3d25@redhat.com> <87h8ph6u67.fsf@xmission.com> <7d3a1f93-f8e5-5325-f9a7-0079f7777b6f@redhat.com> <20180329021409.gcjjrmviw2lckbfk@linux-n805> <3e201de2-bed2-6f7d-0783-700d095142e0@colorfullife.com> <20180329105601.GA597@bombadil.infradead.org> <05772f83-d680-aea1-b222-cef2430dcc83@colorfullife.com> Date: Thu, 29 Mar 2018 13:52:25 -0500 In-Reply-To: <05772f83-d680-aea1-b222-cef2430dcc83@colorfullife.com> (Manfred Spraul's message of "Thu, 29 Mar 2018 20:07:44 +0200") Message-ID: <87lgea7lzq.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=1f1cfw-0007S9-7G;;;mid=<87lgea7lzq.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.145.25;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1/nhjXEhtPM8/7tS7f5/3jXtV3Kr7+5Pok= X-SA-Exim-Connect-IP: 67.3.145.25 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa06.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,TVD_RCVD_IP,T_TM2_M_HEADER_IN_MSG, T_XMDrugObfuBody_14 autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 TR_Symld_Words too many words that have symbols inside * 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.4999] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 0.2 T_XMDrugObfuBody_14 obfuscated drug references X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Manfred Spraul X-Spam-Relay-Country: X-Spam-Timing: total 1226 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.7 (0.2%), b_tie_ro: 1.78 (0.1%), parse: 0.78 (0.1%), extract_message_metadata: 10 (0.8%), get_uri_detail_list: 1.25 (0.1%), tests_pri_-1000: 5 (0.4%), tests_pri_-950: 1.17 (0.1%), tests_pri_-900: 0.99 (0.1%), tests_pri_-400: 22 (1.8%), check_bayes: 21 (1.7%), b_tokenize: 7 (0.6%), b_tok_get_all: 8 (0.6%), b_comp_prob: 2.2 (0.2%), b_tok_touch_all: 2.6 (0.2%), b_finish: 0.55 (0.0%), tests_pri_0: 1176 (96.0%), check_dkim_signature: 0.49 (0.0%), check_dkim_adsp: 2.8 (0.2%), tests_pri_500: 4.2 (0.3%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFC][PATCH] ipc: Remove IPCMNI 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 in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Manfred Spraul writes: > Hello Mathew, > > On 03/29/2018 12:56 PM, Matthew Wilcox wrote: >> On Thu, Mar 29, 2018 at 10:47:45AM +0200, Manfred Spraul wrote: >>>>>>>> This can be implemented trivially with the current code >>>>>>>> using idr_alloc_cyclic. >>> Is there a performance impact? >>> Right now, the idr tree is only large if there are lots of objects. >>> What happens if we have only 1 object, with id=INT_MAX-1? >> The radix tree uses a branching factor of 64 entries (6 bits) per level. >> The maximum ID is 31 bits (positive signed 32-bit integer). So the >> worst case for a single object is 6 pointer dereferences to find the >> object anywhere in the range (INT_MAX/2 - INT_MAX]. That will read 12 >> cachelines. If we were to constrain ourselves to a maximum of INT_MAX/2 >> (30 bits), we'd reduce that to 5 pointer dereferences and 10 cachelines. > I'm concerned about the up to 6 branches. > But this is just guessing, we need a test with a realistic workload. Yes. My primary purpose with the patch was to show that the issues with the current limits could be resolved in a straght forward manner. I really don't know if idrs are the appropriate data structure. It is possible rbtrees are a better fit. I think my algorithm I proposed for generating identifiers is as likely as any to be a good one. It does need testing on a wide variety of applications to see what applications actually care about and for that I think my proposed patch is more than sufficient. By not keeping a generation counters in the slots themselves linux already differs substantially from traditional implementations. Doing something to free us from using a fixed number of bits for the counter and a fixed number of bits to encode the slot we can support much larger use of this API. Eric