Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp212747pxu; Tue, 6 Oct 2020 04:48:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsfiIGiA+P5MFFccRRVPPyo1AwwJVmguX6gzbt6oESPyctyLJCk+JWE+lm+V+p6higbFe5 X-Received: by 2002:a17:906:bea:: with SMTP id z10mr4882123ejg.286.1601984903036; Tue, 06 Oct 2020 04:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601984903; cv=none; d=google.com; s=arc-20160816; b=M92rZD7Lw4TgYJXGteFYH8knz3cfoxLQ4kcAkTF/Bp9pmD+eWmvFjC0pUTq+96k7dP jtahBllUYhK1CMNXXig2jAIE2OVg8utWidDV1YYTknjXViWyS1jFfNHrQQAQeVc5DD6D TcKlAHIPO0tC+anU3KV/S9iZVrafkhe2gDKOVfFnMw8YJcZCGsusi56kFBbZ6jnR6a8B ZHUQjv2fULXc6MmqdHvM5hZb3ROHpDXeorZ9OkGIdakgon5UbRzExWo5+MisexxAMRhq FsPals8WDgxGvpwwbLg4jXsAc1j99wh62UwHFgG0eH3sABKID2o+UD3X5GfyC4/2+7lj 7fsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=khls/uJRiiihhpviNhiZwsjCwrKDMmXzS3nICWnkoE0=; b=luMAscCOev0/+3lenuOhcw5qBho8tGlqBvlOhd4684bWpxcKCC1gesfrXqqYPi/TuP ipSnw/WkroNo4Wbby2vVa7iVEdDrvPl++xd9/4kfIvwk0fxWZuqZAcevb4HqnuN0GgFP NNmmp/VNCgXM2XaU7hpNDGfxoydXWrxZklsqPTwzWx3A62g8N1Y7/3n4lJP9J2ublkQw dmCuh3BHmrbXwA9mALsw2IZVwx9E8thaIePAMeHDPDotuMlc5ctNh0hT8MDEVIs5wO/v gB2HTW/uqk4lJWETQdn4tFS98VrrbErIVR+ZLjuXA758i6KEHYmhUBLhu/ZDbdtJN+xi xHxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=agizYAIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w4si2229221ede.468.2020.10.06.04.47.59; Tue, 06 Oct 2020 04:48:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=agizYAIK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726214AbgJFLqc (ORCPT + 99 others); Tue, 6 Oct 2020 07:46:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726164AbgJFLqc (ORCPT ); Tue, 6 Oct 2020 07:46:32 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FF2C061755 for ; Tue, 6 Oct 2020 04:46:30 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id s7so10327462qkh.11 for ; Tue, 06 Oct 2020 04:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=khls/uJRiiihhpviNhiZwsjCwrKDMmXzS3nICWnkoE0=; b=agizYAIKwE8nBdCa5FoqruUUgBMZurpzsRC/wNwcTfsnDpXFpX+QcbtpQZNad/gVxa Ejl6u02QYnFEvkiLjpKZ89TQcWssfDx6i1puGgdAIuUB6ND5BzNSJb8mCyvibixY/EdF pgB/nl85OHsSwiBYpCSL7eI4xgkqvC8eyTW5baeGzGZtamDu1VrTEVHS2Fh2e5EwIdCa l+bmTT2IpUpEbcBgO/Vn+7GdNx0SxYlBrsPTJWV6ElQQYg1Sr5wjBNab9QjBywAk8rRQ P2SnLftBpoJJDcabtclfyifyvMC+FfaH8IiaW3kaxddjvGyMpMoG34dBGPgpiVQuLKfY N8wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=khls/uJRiiihhpviNhiZwsjCwrKDMmXzS3nICWnkoE0=; b=Ov9TjM0mt+f+Uws/353dmzDQgkSulKqsya8S38V4+Y1G8jDwMZv66DCKoAQScsox3L a98AJYT0K4Jg6E9EmdG3gud3dPH88CRNJh4saN3nyKxiWj3tU5gXF9hl0bxut5ndd2Y/ KvURUHF7ObUSS1RRvWodLCPWE0M5zKJG/6e5s0Icuzu/hE3iIFkOFZNsF5X7O4Iv/80y tJ/LpwFhC+d+HmKzLExq1LakoJ+2ZmSqN72/VbLTB8fRwiLJoNv/c4j6qCty587FkpLM u9RNV2nzz7pnwv4V2AvPwiHgEuM26uycn/PzaLECBtAN7Kf3zokbqYi8Un9J+8+z1+9G k2Hg== X-Gm-Message-State: AOAM531/+dpXgJTGJEeIjj4ifvK9fUi4NWu8jkdMcsxKECcZWSh4LWGb z/v18gg8g650qX2CPjny16V2Rw== X-Received: by 2002:a37:4e45:: with SMTP id c66mr4918962qkb.36.1601984789486; Tue, 06 Oct 2020 04:46:29 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id j88sm1989818qte.96.2020.10.06.04.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 04:46:28 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kPlQJ-000VYo-SU; Tue, 06 Oct 2020 08:46:27 -0300 Date: Tue, 6 Oct 2020 08:46:27 -0300 From: Jason Gunthorpe To: Leon Romanovsky , Doug Ledford , Leon Romanovsky , Christoph Hellwig , David Airlie , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Maor Gottlieb , Rodrigo Vivi , Roland Scheidegger , Tvrtko Ursulin , VMware Graphics Subject: Re: [PATCH rdma-next v5 0/4] Dynamicaly allocate SG table from the pages Message-ID: <20201006114627.GE5177@ziepe.ca> References: <20201004154340.1080481-1-leon@kernel.org> <20201005235650.GA89159@nvidia.com> <20201006104122.GA438822@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006104122.GA438822@phenom.ffwll.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2020 at 12:41:22PM +0200, Daniel Vetter wrote: > On Mon, Oct 05, 2020 at 08:56:50PM -0300, Jason Gunthorpe wrote: > > On Sun, Oct 04, 2020 at 06:43:36PM +0300, Leon Romanovsky wrote: > > > This series extends __sg_alloc_table_from_pages to allow chaining of > > > new pages to already initialized SG table. > > > > > > This allows for the drivers to utilize the optimization of merging contiguous > > > pages without a need to pre allocate all the pages and hold them in > > > a very large temporary buffer prior to the call to SG table initialization. > > > > > > The second patch changes the Infiniband driver to use the new API. It > > > removes duplicate functionality from the code and benefits the > > > optimization of allocating dynamic SG table from pages. > > > > > > In huge pages system of 2MB page size, without this change, the SG table > > > would contain x512 SG entries. > > > E.g. for 100GB memory registration: > > > > > > Number of entries Size > > > Before 26214400 600.0MB > > > After 51200 1.2MB > > > > > > Thanks > > > > > > Maor Gottlieb (2): > > > lib/scatterlist: Add support in dynamic allocation of SG table from > > > pages > > > RDMA/umem: Move to allocate SG table from pages > > > > > > Tvrtko Ursulin (2): > > > tools/testing/scatterlist: Rejuvenate bit-rotten test > > > tools/testing/scatterlist: Show errors in human readable form > > > > This looks OK, I'm going to send it into linux-next on the hmm tree > > for awhile to see if anything gets broken. If there is more > > remarks/tags/etc please continue > > An idea that just crossed my mind: A pin_user_pages_sgt might be useful > for both rdma and drm, since this would avoid the possible huge interim > struct pages array for thp pages. Or anything else that could be coalesced > down into a single sg entry. > > Not sure it's worth it, but would at least give a slightly neater > interface I think. We've talked about it. Christoph wants to see this area move to a biovec interface instead of sgl, but it might still be worthwhile to have an interm step at least as an API consolidation. Avoiding the page list would be complicated as we'd somehow have to code share the page table iterator scheme. Jason