Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp993875imu; Tue, 11 Dec 2018 10:49:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/XxsYxkJJ2VwAfDw8uS58nGlkDEhaFmkXL3TS2wsC0mQk2EU/BJt+WI1hsorO7DjYR3dzVx X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr16282541plu.122.1544554189882; Tue, 11 Dec 2018 10:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544554189; cv=none; d=google.com; s=arc-20160816; b=lYM3wUbA7qPdKKbFq/YgMR3eATFK4kkF/sAbiiXuEP59TPZSfJ+OaoWYjgaG7kmryi ohNhHrG5hy/gvkj/cMCTcDldlr+ERR0TvJ+XMcTXG+DoyAGmWbOSpxACfv6fkgUu1Mfo wpONMwdO081SHOdpB3HVxQy+DQPkzD2yuxbry3ZF1HzsQQQovEvgG0vbWh/oi1ihei8G UIbEqYrjIkUm/IJYwXp3oozFnJT5EviN4S0iNDClCFdNU5I03eUzs53VM8Uv7AyjqO05 a14nZenG3pJfeb56Ofji67b8UQiLkwIfbUjjinrSNINlu+m2QA74h7F4bLSgBB71NgEh k4bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=5sP8BrMmGL+4vp6LwQoT7fF2LtbFDXTIdgV2PMryJ6s=; b=RDAkPJ25LEpWEIdR7JQtSNn/T1ekXgrmZjyUDtu8UKcWyAmPkxXpDdFMOkIBQq6K8y AUR9hMMg0P2Nd4zFnxfhvO0Z2cPNAKNtLrcIebIk2z9AYvOe4x8OxeTZ3gnrd7JOYDMC kUIuCIC74yw6G5SDsakL5H+f/DP1yywo+MfW11Nl9s72c/V6bTRAgs09q+6/nPW9lyOX BK6Sx3sOVwwucAkZySnw+AnWd7CQCUa+FGl0NRU+X15W2wsxVJxPixyHXXh69eweEFO0 bUCnDllofZXICAZsC0EglVVI/5HNjORmylASKlcWyO49pBqabz7pauqgBqz4bIBTAVM+ W+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=DaLh2nJY; 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 d12si13099338pgf.470.2018.12.11.10.49.35; Tue, 11 Dec 2018 10:49:49 -0800 (PST) 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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=DaLh2nJY; 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 S1726945AbeLKSgp (ORCPT + 99 others); Tue, 11 Dec 2018 13:36:45 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:55540 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbeLKSgo (ORCPT ); Tue, 11 Dec 2018 13:36:44 -0500 Received: by mail-it1-f195.google.com with SMTP id o19so5094385itg.5 for ; Tue, 11 Dec 2018 10:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5sP8BrMmGL+4vp6LwQoT7fF2LtbFDXTIdgV2PMryJ6s=; b=DaLh2nJYv16RjOVbiqUfw64V7HqRZ4Tv9ZE8i1cLCdu4ECmmGypLrJo0w5FF8VMNq+ nwtIzkmV3ZmuxoBzdqZMQdIm3ZkOUMccDTqaOvCdZoblcOxrJ0ETq0huIFOes2V/k8Vp 54PxF/rTN/QB6yIsmHvFtEEAN78y2zVMr5X3NY+s9QpfPHwD0fFwFD+Ryqw7IJCfPtec LU8k0/7V2n3wOC/gW9ol0qm0Lv2Xup3LQqXrWtfeyESgQ7xkpxjIN6O2nBLv5BvhlHZJ WnumZjlSkQQzvIVk7jqahycGxCN4Fst5UD2xWkNnACtgFlxqV317PiC2NlyyzMivjxoB qn5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5sP8BrMmGL+4vp6LwQoT7fF2LtbFDXTIdgV2PMryJ6s=; b=WIROiXv1m55ruzIvOdwezl4h7chpfwFOrHUbOl10der7EbmBf037n/l6VTT3SOV6kY f4lE3ZxeTp7d8/5RiN9OlA6ank3Gb4+PyejtCuvfQX8KSVhI01MZqkIEfYTYmlccm5Xj 3kvqyDcYxcd6i2ePXUShF/n17up1a9zm4n8vflWi9DeLu79lkFJbffKapcI3zGvQLUoV h7mYmnZU04l0dyvUQmi4biTn2AFc1R/iWQopO9RXEA15TVU/xa95If25H5idXtw7LdhK wYypjRqjyycTEwWJnFJnEx35FBD9X+o59m+4HEGTZ5RADNNvkMAWbKnlVehnmP2TiL5P 4ySA== X-Gm-Message-State: AA+aEWa0djudYARePv0mwDly7iMIYXqVjurs+vTcItpCdU4utn2KP7Nc 1yodLzIcDCcWK1u72DtdTeyJB1qHflDiSQ== X-Received: by 2002:a02:1b1d:: with SMTP id l29mr16620921jad.98.1544553403731; Tue, 11 Dec 2018 10:36:43 -0800 (PST) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id a17sm702500ioc.67.2018.12.11.10.36.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:36:42 -0800 (PST) Subject: Re: [PATCH] aio: Convert ioctx_table to XArray From: Jens Axboe To: Jeff Moyer , Matthew Wilcox Cc: Alexander Viro , Benjamin LaHaise , Andrew Morton , Kees Cook , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dan Carpenter , kent.overstreet@gmail.com References: <20181128183531.5139-1-willy@infradead.org> <20181211175156.GF6830@bombadil.infradead.org> <0f77a532-0d88-78bc-b9cc-06bb203a0405@kernel.dk> <6b9a45c4-47a2-4c44-aa7e-6e5e90eff9df@kernel.dk> Message-ID: <78dfbfa3-b2d1-4e9d-f59c-b263678a9866@kernel.dk> Date: Tue, 11 Dec 2018 11:36:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <6b9a45c4-47a2-4c44-aa7e-6e5e90eff9df@kernel.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/11/18 11:32 AM, Jens Axboe wrote: > On 12/11/18 11:05 AM, Jens Axboe wrote: >> On 12/11/18 11:02 AM, Jeff Moyer wrote: >>> Matthew Wilcox writes: >>> >>>> On Tue, Dec 11, 2018 at 12:21:52PM -0500, Jeff Moyer wrote: >>>>> I'm going to submit this version formally. If you're interested in >>>>> converting the ioctx_table to xarray, you can do that separately from a >>>>> security fix. I would include a performance analysis with that patch, >>>>> though. The idea of using a radix tree for the ioctx table was >>>>> discarded due to performance reasons--see commit db446a08c23d5 ("aio: >>>>> convert the ioctx list to table lookup v3"). I suspect using the xarray >>>>> will perform similarly. >>>> >>>> There's a big difference between Octavian's patch and mine. That patch >>>> indexed into the radix tree by 'ctx_id' directly, which was pretty >>>> much guaranteed to exhibit some close-to-worst-case behaviour from the >>>> radix tree due to IDs being sparsely assigned. My patch uses the ring >>>> ID which _we_ assigned, and so is nicely behaved, being usually a very >>>> small integer. >>> >>> OK, good to know. I obviously didn't look too closely at the two. >>> >>>> What performance analysis would you find compelling? Octavian's original >>>> fio script: >>>> >>>>> rw=randrw; size=256k ;directory=/mnt/fio; ioengine=libaio; iodepth=1 >>>>> blocksize=1024; numjobs=512; thread; loops=100 >>>>> >>>>> on an EXT2 filesystem mounted on top of a ramdisk >>>> >>>> or something else? >>> >>> I think the most common use case is a small number of ioctx-s, so I'd >>> like to see that use case not regress (that should be easy, right?). >>> Kent, what were the tests you were using when doing this work? Jens, >>> since you're doing performance work in this area now, are there any >>> particular test cases you care about? >> >> I can give it a spin, ioctx lookup is in the fast path, and for "classic" >> aio we do it twice for each IO... > > Don't see any regressions. But if we're fiddling with it anyway, can't > we do something smarter? Make the fast path just index a table, and put > all the big hammers in setup/destroy. We're spending a non-substantial > amount of time doing lookups, that's really no different before and > after the patch. Looks like it's the percpu ref get, in terms of "lookup" we already look pretty good. -- Jens Axboe