[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190830111605.twzssycagmjhfa45@sirius.home.kraxel.org>
Date: Fri, 30 Aug 2019 13:16:05 +0200
From: Gerd Hoffmann <kraxel@...hat.com>
To: David Riley <davidriley@...omium.org>
Cc: dri-devel@...ts.freedesktop.org,
virtualization@...ts.linux-foundation.org,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Gurchetan Singh <gurchetansingh@...omium.org>,
Stéphane Marchesin <marcheu@...omium.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/virtio: Use vmalloc for command buffer allocations.
Hi,
> > > - kfree(vbuf->data_buf);
> > > + kvfree(vbuf->data_buf);
> >
> > if (is_vmalloc_addr(vbuf->data_buf)) ...
> >
> > needed here I gues?
> >
>
> kvfree() handles vmalloc/kmalloc/kvmalloc internally by doing that check.
Ok.
> - videobuf_vmalloc_to_sg in drivers/media/v4l2-core/videobuf-dma-sg.c,
> assumes contiguous array of scatterlist and that the buffer being converted
> is page aligned
Well, vmalloc memory _is_ page aligned.
sg_alloc_table_from_pages() does alot of what you need, you just need a
small loop around vmalloc_to_page() create a struct page array
beforehand.
Completely different approach: use get_user_pages() and don't copy the
execbuffer at all.
cheers,
Gerd
Powered by blists - more mailing lists