lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ad0e02d-4ab1-6fe1-6f4d-e381e4f37afe@nvidia.com>
Date:   Wed, 7 Oct 2020 13:38:06 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Daniel Vetter <daniel.vetter@...ll.ch>,
        DRI Development <dri-devel@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
CC:     <kvm@...r.kernel.org>, <linux-mm@...ck.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-samsung-soc@...r.kernel.org>, <linux-media@...r.kernel.org>,
        <linux-s390@...r.kernel.org>,
        Daniel Vetter <daniel.vetter@...el.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jérôme Glisse <jglisse@...hat.com>,
        Jan Kara <jack@...e.cz>,
        Dan Williams <dan.j.williams@...el.com>,
        Oded Gabbay <oded.gabbay@...il.com>,
        "Omer Shpigelman" <oshpigelman@...ana.ai>,
        Ofir Bitton <obitton@...ana.ai>,
        "Tomer Tayar" <ttayar@...ana.ai>,
        Moti Haimovski <mhaimovski@...ana.ai>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Pawel Piskorski <ppiskorski@...ana.ai>
Subject: Re: [PATCH 03/13] misc/habana: Stop using frame_vector helpers

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ