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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 397CDC4727F for ; Wed, 7 Oct 2020 20:38:15 +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 9F1A420760 for ; Wed, 7 Oct 2020 20:38:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="gkOESIFv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F1A420760 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C27F6E2BC; Wed, 7 Oct 2020 20:38:13 +0000 (UTC) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 656F76E2BC for ; Wed, 7 Oct 2020 20:38:12 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 07 Oct 2020 13:36:22 -0700 Received: from [10.2.85.86] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Oct 2020 20:38:07 +0000 Subject: Re: [PATCH 03/13] misc/habana: Stop using frame_vector helpers To: Daniel Vetter , DRI Development , LKML References: <20201007164426.1812530-1-daniel.vetter@ffwll.ch> <20201007164426.1812530-4-daniel.vetter@ffwll.ch> From: John Hubbard Message-ID: <3ad0e02d-4ab1-6fe1-6f4d-e381e4f37afe@nvidia.com> Date: Wed, 7 Oct 2020 13:38:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201007164426.1812530-4-daniel.vetter@ffwll.ch> Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602102982; bh=yuAqwELlY3ofogWejN6SHZgdy41opvCmSytBHCnrmlM=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=gkOESIFvST6yyyeEgFKkiQRXYOtpgRUWeYyLwOa1FV2fmm34StbJHEvT6/hefXbTF xQ5nn+kqRWOwunENSo9IP5Lo5y5nN9tPB4tTxUUuOz36HzzB8u4YUokcoSih1paZp1 iqDA4flNnMiDdmuvv8CAmblsoAkRum7AwT19P0coSQH2qKBBXTUhdPsklGBWwXSHQX 7efraicZvRAnr9vc/8TadqcYL//GjjpaAZ1oQSTjhKsV1h5QKMX5Hs9Pn90pDZZX7J IoWfb1Cuv66sCbIsRxg7Q4JDNsMnO9gIotzTS7WBwb4gZZBJmE6cjlekHA3M2H2VFv vsHWewdIAlmrA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Jan Kara , kvm@vger.kernel.org, Jason Gunthorpe , Pawel Piskorski , Greg Kroah-Hartman , Ofir Bitton , linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Tomer Tayar , Omer Shpigelman , Daniel Vetter , Andrew Morton , Moti Haimovski , Dan Williams , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 10/7/20 9:44 AM, Daniel Vetter wrote: ... > @@ -1414,15 +1410,10 @@ void hl_unpin_host_memory(struct hl_device *hdev, struct hl_userptr *userptr) > userptr->sgt->nents, > userptr->dir); > > - pages = frame_vector_pages(userptr->vec); > - if (!IS_ERR(pages)) { > - int i; > - > - for (i = 0; i < frame_vector_count(userptr->vec); i++) > - set_page_dirty_lock(pages[i]); > - } > - put_vaddr_frames(userptr->vec); > - frame_vector_destroy(userptr->vec); > + for (i = 0; i < userptr->npages; i++) > + set_page_dirty_lock(userptr->pages[i]); > + unpin_user_pages(userptr->pages, userptr->npages); > + kvfree(userptr->pages); Same thing here as in patch 1: you can further simplify by using unpin_user_pages_dirty_lock(). > > list_del(&userptr->job_node); > > thanks, -- John Hubbard NVIDIA _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel