Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4178889pxk; Tue, 8 Sep 2020 12:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJhCB4PLmCgzZ73QpgGkGpD0BkQRcq/PZx9/JeL+VVkxnD/4mLOMfVUtk0gLIu1irH8u1v X-Received: by 2002:a17:906:ce3b:: with SMTP id sd27mr14382ejb.433.1599594278011; Tue, 08 Sep 2020 12:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599594278; cv=none; d=google.com; s=arc-20160816; b=CSdJYzea63QuBFgthJYEEg4i60Oekmzsjj0vDV35AactHInAjc+VzyHPSofgjkcTGl vJxkzP65k7BjHP8vG09hZFJYnC6o+t7+s9JTVGwIhDsK81XiW8RI+OrizzYTLIahXgfz dOp3x0jA2flWXmwnYhJYU1cxnXVx8db/LOrR1NWH4XYarnO0M6NpbN+Q/2MfDUAxLn9g PIsIH8a34C/BPastNpAis0ETCceJap2gjw9S0kBp7B8YAc8BPYPmCmRNcRWrbytstGfq M1gE+V6m2swA7KrCkcoOwb1FYon8bfqBl9iINzrqV0hwIYJOwTGLrvnFtcIBj1u7kPr0 dS3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dMSGW5vh35LAiU+W+S8PmQmFZwbFc39nndTpfzg5Lrk=; b=SKZ2SINxLziJz92NT42jYKlGxZEKrFCrAMZAUorIzzfKq59EJEk0wlV6F4gg38W4pD 4trl3Vk7tDoHnzlldubooexU6dgD5WPNEDf0qBdA/uAzK7aTuK5mLU/w07akiWJ+IktZ N+/OQhH0v1NBZ9TeCBa2nMTaH78jtdoZo15/GgyaUQVssQ1urgO8u4/idpqxniRj5xAb DPAI3rnODOA0PUwx8z9xDdhqJJweW/6d1KsAjwtfxrgh0MOl6DHUZwKGjLZzV68t7d7d MsCAvtc5z0kaDAH0x7i4lCDxvwP13GgEJ+85zsMxlf7SiKOj9GxjDPoYPzwRKyZODxsp 2yfA== ARC-Authentication-Results: i=1; mx.google.com; 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 g2si27928eji.132.2020.09.08.12.44.15; Tue, 08 Sep 2020 12:44:38 -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; 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 S1730954AbgIHTmg (ORCPT + 99 others); Tue, 8 Sep 2020 15:42:36 -0400 Received: from verein.lst.de ([213.95.11.211]:53187 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730890AbgIHPwt (ORCPT ); Tue, 8 Sep 2020 11:52:49 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B629F68B05; Tue, 8 Sep 2020 17:52:28 +0200 (CEST) Date: Tue, 8 Sep 2020 17:52:28 +0200 From: Christoph Hellwig To: Maor Gottlieb Cc: Christoph Hellwig , Leon Romanovsky , Doug Ledford , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH rdma-next 1/4] lib/scatterlist: Refactor sg_alloc_table_from_pages Message-ID: <20200908155228.GA13593@lst.de> References: <20200903121853.1145976-1-leon@kernel.org> <20200903155434.1153934-1-leon@kernel.org> <20200907072912.GA19875@lst.de> <2a4b0211-c7a0-2a82-1335-7ed935b92aa2@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2a4b0211-c7a0-2a82-1335-7ed935b92aa2@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 07, 2020 at 03:32:31PM +0300, Maor Gottlieb wrote: > > On 9/7/2020 10:29 AM, Christoph Hellwig wrote: >> On Thu, Sep 03, 2020 at 06:54:34PM +0300, Leon Romanovsky wrote: >>> From: Maor Gottlieb >>> >>> Currently, sg_alloc_table_from_pages doesn't support dynamic chaining of >>> SG entries. Therefore it requires from user to allocate all the pages in >>> advance and hold them in a large buffer. Such a buffer consumes a lot of >>> temporary memory in HPC systems which do a very large memory registration. >>> >>> The next patches introduce API for dynamically allocation from pages and >>> it requires us to do the following: >>> * Extract the code to alloc_from_pages_common. >>> * Change the build of the table to iterate on the chunks and not on the >>> SGEs. It will allow dynamic allocation of more SGEs. >>> >>> Since sg_alloc_table_from_pages allocate exactly the number of chunks, >>> therefore chunks are equal to the number of SG entries. >> Given how few users __sg_alloc_table_from_pages has, what about just >> switching it to your desired calling conventions without another helper? > > I tried it now. It didn't save a lot.? Please give me your decision and if > needed I will update accordingly. Feel free to keep it for now, we can sort this out later.