Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756317AbcLQN24 (ORCPT ); Sat, 17 Dec 2016 08:28:56 -0500 Received: from mail-bl2nam02on0092.outbound.protection.outlook.com ([104.47.38.92]:40066 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754371AbcLQN2y (ORCPT ); Sat, 17 Dec 2016 08:28:54 -0500 X-Greylist: delayed 57891 seconds by postgrey-1.27 at vger.kernel.org; Sat, 17 Dec 2016 08:28:54 EST From: Matthew Wilcox To: Rasmus Villemoes CC: Tejun Heo , "linux-kernel@vger.kernel.org" , Lai Jiangshan , "Jens Axboe" , Greg Kroah-Hartman , "linux-block@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Andrew Morton" Subject: RE: [RFC 00/10] implement alternative and much simpler id allocator Thread-Topic: [RFC 00/10] implement alternative and much simpler id allocator Thread-Index: AQHSUme+SjIWPmjllE++nkCQM7WotKEKtg/QgABcHJ+AAAiNEIAACqdQ Date: Sat, 17 Dec 2016 13:28:50 +0000 Message-ID: References: <1481160187-9652-1-git-send-email-linux@rasmusvillemoes.dk> <20161209140140.5e0a68e2e1cf9861335bdf3b@linux-foundation.org> <87inqj8vjo.fsf@rasmusvillemoes.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=mawilcox@microsoft.com; x-originating-ip: [76.10.168.227] x-ms-office365-filtering-correlation-id: 37e642d8-4ea3-4b52-6696-08d42680a3b9 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR21MB0035; x-microsoft-exchange-diagnostics: 1;BY2PR21MB0035;7:b00mntrokmSzSNvpZDP/CxNQd/B+RPmgdP3xu0sFI4Tc0iU6a8rBfTA5jMxdZJu/jC3ADUHi8RDpuUqb4/pmD6i07xlVO1a7oEhSMDyB+BE+DNY9qobbn3iS2Fv8sbDNSjFTnylhuS9pTryy/0a3cn0B1I6ELZtz6F27Lq2ikw+I6KNxFb63bKYV2ESMbQ7oYSlgYwaIgIe75Tj6xwqQfk1OjxARWA639dgAXL9G+3jvB8+fkDjJ9xcNKCQwYvFDMzcQuDl5gTYYgs50a2KcN0695ErCA+DV2PbliLWJM/VkW2iunXJ9d7ydGsSS+xQLY5Y9cIEQznkf6Slo1JcOk7p1fwVtWP7IQPyeOciwVSe2fBnGb51p0COc6axFSX4zS4uErVvErrNSjkTZ+fwmeDRR1e+rXg5/C1sojew//JnDIo71WxJ7OMEfYOMlgD1nFEAtXgRcdwwgZfXIqoQewaD731J8JwiPNid1WOxeq9M= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6072148);SRVR:BY2PR21MB0035;BCL:0;PCL:0;RULEID:;SRVR:BY2PR21MB0035; x-forefront-prvs: 0159AC2B97 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39840400002)(39450400003)(39850400002)(39860400002)(39410400002)(199003)(189002)(305945005)(7736002)(50986999)(76176999)(229853002)(5660300001)(39060400001)(77096006)(86612001)(93886004)(6506006)(92566002)(5005710100001)(86362001)(74316002)(101416001)(38730400001)(25786008)(10090500001)(6436002)(54356999)(2900100001)(10290500002)(8990500004)(76576001)(122556002)(3280700002)(3660700001)(99286002)(106116001)(106356001)(3846002)(102836003)(6116002)(6916009)(105586002)(189998001)(33656002)(4326007)(2906002)(4001150100001)(8676002)(81156014)(81166006)(7696004)(66066001)(68736007)(8936002)(97736004)(110136003)(9686002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR21MB0035;H:BY2PR21MB0036.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2016 13:28:50.7386 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR21MB0035 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id uBHDT3jl009487 Content-Length: 1295 Lines: 16 From: Matthew Wilcox > From: Rasmus Villemoes [mailto:linux@rasmusvillemoes.dk] > > This sounds good. I think there may still be a lot of users that never > > allocate more than a handful of IDAs, making a 128 byte allocation still > > somewhat excessive. One thing I considered was (exactly as it's done for > > file descriptor tables) to embed a single word in the struct ida and > > use that initially; I haven't looked closely at newIDA, so I don't know > > how easy that would be or if its worth the complexity. > > Heh, I was thinking about that too. The radix tree supports "exceptional > entries" which have the bottom bit set. On a 64-bit machine, we could use 62 > of the bits in the radix tree root to store the ID bitmap. I'm a little wary of the > potential complexity, but we should try it out. Test patch here: http://git.infradead.org/users/willy/linux-dax.git/shortlog/refs/heads/idr-2016-12-16 It passes the test suite ... which I actually had to adjust because it now succeeds in cases where it hadn't (allocating ID 0 without preallocating), and it will now fail in cases where it hadn't previously (assuming a single preallocation would be enough). There shouldn't be any examples of that in the kernel proper; it was simply me being lazy when I wrote the test suite.