Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp980327imu; Tue, 11 Dec 2018 10:34:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/V9PDcnH3u4UpJ7rNovIuSS6dPPg4HHuPDwQGhLY2z7THwNGoWqMb6h64o2ytS5hZnhmIyr X-Received: by 2002:a62:1709:: with SMTP id 9mr17068751pfx.249.1544553257992; Tue, 11 Dec 2018 10:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544553257; cv=none; d=google.com; s=arc-20160816; b=Yyyvr7kR/5fznxyniGo0D3+ckbCg+wlqqjnbHApUplF3ciMOR/M+b8LzOHl27XIzId U60LqtddDMDHXO4sCEpvBheIEy8Y+CDm+Lml5vi+08kp6QnNcZKGqzH4vPL7d02HzVCJ IS8ufbOq71w/vmehmdy9asUou7p2AzgwTEVmVhyUlAkjrDhyZpJ05YKap5SiVJHoQMLW q92X51cY0Nt8eGaIfAHeVWVBaqGQcdf8PyBWeDN5+TjDgIGxH7R1jCWim+KX5kM95TsV qT2EJ4ZJbEzmn2DflfButMwOZQ0c11HPPYveYhbz03/RJEKTgGMKIsOW69H7YReuSah7 hBsA== 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=V678lObyQXAGDUycAkU7vh0Hh4W41IpIfx8gVzVLppE=; b=MtjgVTQE339KJ97RMEBn8HIai4NB0B9G9mdGNcFUEYMad6G8unGVTNhdTsI4CxcM/l nLPi3pSFicE6b3J0W59RMJM1RT6iJ1c5Sbx35NAuaYVWy953uDxr+CxOUU8I/u8R6wIl MtsDSmYx8MvBf0+Px8djqXwFzqKixVeztpVBbVsqBBqaS15OdhLCwqFmEfRNj8Av6sLo TPyjxF+rYZ9Z6vXL3kISBb4HC0GfzSF7LC6Xeszzl7KzvZD4ofwuXaVyTfdMdLKD4ikd QscXTUc+uplLPzfEj/qA8T/Lb0UbinILf+9euvhyD66QcT9/a7MWNnlHmkNJ9GJoftZJ +zzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=q0FIl0uM; 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 a185si12058716pge.404.2018.12.11.10.34.02; Tue, 11 Dec 2018 10:34:17 -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=q0FIl0uM; 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 S1726798AbeLKSc7 (ORCPT + 99 others); Tue, 11 Dec 2018 13:32:59 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:36406 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeLKSc6 (ORCPT ); Tue, 11 Dec 2018 13:32:58 -0500 Received: by mail-io1-f67.google.com with SMTP id m19so12655208ioh.3 for ; Tue, 11 Dec 2018 10:32:58 -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=V678lObyQXAGDUycAkU7vh0Hh4W41IpIfx8gVzVLppE=; b=q0FIl0uMgMf2gBeTHKcNI6rkQ1BswPFMi/ChD4qKXBJViUHXx0K3ZiJgP4W1LkXZGd fxVc5TTqv3mi2eiEauzLhd/pAgHI2T0apPkqggAzuobKd4oF9HAb98jAe6UHwviJxK1m OVq5tvUzclqBHRwYUd1CI4PeySoB64EVfYQi9PhMNaGcyFvbp0EqZvJG6RZHOodcNpAr 00c2ZFWHZmQtdKzROIHYMhfSzbLFMEloJoYHBKHtZD7rkHEDqTiWuMSuKq8I1WNKraVO bsdEhee/pw0e9F27yCClNV9zgQedIiZczBF9GjhKf6UmPBXFx9pRvbdWybeSaxNBbkfS 6ghA== 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=V678lObyQXAGDUycAkU7vh0Hh4W41IpIfx8gVzVLppE=; b=rJ/7zzN59NR9ktz6ugedlv1NP2hIHHIA6RJegmJm1ZlpoHgil7cX+qrKry/so3LiMV Dg2j/L7Ojyfjl0gdmNm3a77RNJxTgB3bTSW2vHXbBnnhTtI/oz7/WTJqkvLla3Q8MAqX 0rKoj4y+rg8NU/7B76aniCR5Xc/NhTCH3dueAGgOWUK7DjlvYmxd+ZTUv5IXEmx8kXsW O6KWlikpeQpVo4ornNk2j51YaqxXj7CPY6fXT9gwWKblLgDX04fbxm3p2SCoQdbHWliV R+YNdqsqn3uIIbTz9f6i9IysPkvY9NWjCUw3tqszAwH5JwJaTipOv477GpTPVlVbPyh7 E+Sw== X-Gm-Message-State: AA+aEWYWQMK2lNJJIRAFdXA7HXMd9XFOlCjE5/sBWHOlLM1PPxLFKH1T TD05wG7SmzKxSaDRaMjUi0vrHg== X-Received: by 2002:a6b:5804:: with SMTP id m4mr6753301iob.47.1544553177501; Tue, 11 Dec 2018 10:32:57 -0800 (PST) Received: from [192.168.1.56] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id v74sm1597657ita.27.2018.12.11.10.32.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:32:55 -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> Message-ID: <6b9a45c4-47a2-4c44-aa7e-6e5e90eff9df@kernel.dk> Date: Tue, 11 Dec 2018 11:32:54 -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: <0f77a532-0d88-78bc-b9cc-06bb203a0405@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: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. -- Jens Axboe