From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7059AC47420 for ; Wed, 30 Sep 2020 09:53:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 14CDE2076B for ; Wed, 30 Sep 2020 09:53:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zlp5hRjX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14CDE2076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30B7A89CB9; Wed, 30 Sep 2020 09:53:27 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2F7289CB9; Wed, 30 Sep 2020 09:53:25 +0000 (UTC) Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 155502075F; Wed, 30 Sep 2020 09:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601459605; bh=n7b9ZN9lWXqAAXqpvYhEZTZkNVvQeHxENX4KKFd7s9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zlp5hRjXAbo8Cb3tqMZFlDt2iXHugyplO5KpoQHA35xj21Luw9UV2SE1NMbzEn1Th NWaA9Dh177egigRZUNdHfS116GxaJNzvsoz+pogGkCK+t++5wVfb/Ldv+IEQ+Etwrw kiqvESwSIgjPGPTiDha1J90UvqA0M/RzaxWRdgvQ= Date: Wed, 30 Sep 2020 12:53:21 +0300 From: Leon Romanovsky To: Jason Gunthorpe Message-ID: <20200930095321.GL3094@unreal> References: <20200927064647.3106737-1-leon@kernel.org> <20200927064647.3106737-5-leon@kernel.org> <20200929195929.GA803555@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200929195929.GA803555@nvidia.com> Subject: Re: [Intel-gfx] [PATCH rdma-next v4 4/4] RDMA/umem: Move to allocate SG table from pages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, Roland Scheidegger , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, Doug Ledford , VMware Graphics , Maor Gottlieb , Christoph Hellwig Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Sep 29, 2020 at 04:59:29PM -0300, Jason Gunthorpe wrote: > On Sun, Sep 27, 2020 at 09:46:47AM +0300, Leon Romanovsky wrote: > > @@ -296,11 +223,17 @@ static struct ib_umem *__ib_umem_get(struct ib_device *device, > > goto umem_release; > > > > cur_base += ret * PAGE_SIZE; > > - npages -= ret; > > - > > - sg = ib_umem_add_sg_table(sg, page_list, ret, > > - dma_get_max_seg_size(device->dma_device), > > - &umem->sg_nents); > > + npages -= ret; > > + sg = __sg_alloc_table_from_pages( > > + &umem->sg_head, page_list, ret, 0, ret << PAGE_SHIFT, > > + dma_get_max_seg_size(device->dma_device), sg, npages, > > + GFP_KERNEL); > > + umem->sg_nents = umem->sg_head.nents; > > + if (IS_ERR(sg)) { > > + unpin_user_pages_dirty_lock(page_list, ret, 0); > > + ret = PTR_ERR(sg); > > + goto umem_release; > > + } > > } > > > > sg_mark_end(sg); > > Does it still need the sg_mark_end? It is preserved here for correctness, the release logic doesn't rely on this marker, but it is better to leave it. Thanks > > Jason _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx