From: "Thomas Hellström" <thomas@shipmail.org>
To: Dave Airlie <airlied@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Jerome Glisse <jglisse@redhat.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.sf.net
Subject: Re: [PATCH] radeon: use vmalloc instead of kmalloc
Date: Tue, 23 Jun 2009 17:14:23 +0200 [thread overview]
Message-ID: <4A40F14F.5050403@shipmail.org> (raw)
In-Reply-To: <21d7e9970906230442n3dcfeff8le0ffc3b8ea0c3bd0@mail.gmail.com>
Dave Airlie skrev:
> On Tue, Jun 23, 2009 at 9:35 PM, Peter Zijlstra<peterz@infradead.org> wrote:
>
>> On Mon, 2009-06-22 at 19:26 +0200, Jerome Glisse wrote:
>>
>>> We don't need to allocated contiguous pages in cs codepath
>>> so use vmalloc instead.
>>>
>> Best would be to not require >PAGE_SIZE allocations at all of course.
>>
>
> It gets messy when you have copy from user and spinlocks, it would be nice
> to just parse the userspace PAGE_SIZE at a time, but it would mean dropping
> a lock we probably need to hold.
>
>
>> But barring that, it would be great to have something like:
>>
>> ptr = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
>> if (!ptr)
>> ptr = vmalloc(size);
>>
>
> we have a drm_calloc_large workaround already for the Intel driver which also
> need this.
>
One problem with multiple vmallocs per command submission is
performance. Judging from previous work, drivers that are doing this
tend to get very cpu-hungry. Since Radeon is only allowing a single
process into the command submission path at once, what about
pre-allocating a single larger vmalloced buffer at first command
submission and take care to flush user-space before the submitted
command stream gets too big.
>> Also, how long do these allocations live? vmalloc space can be quite
>> limited (i386) and it can fragment too.
>>
>
> Only an ioctl lifetime so they aren't that bad. We however do have some vmaps
> that might be quite large, mainly the fbcon framebuffer (up to 8MB in
> some cases)
>
That one would be ioremapped, not vmapped right? Not that it matters
because it's using vmalloc space anyway, but it wouldn't be worse than a
traditionally ioremapped framebuffer.
Thomas
> Dave.
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> --
> _______________________________________________
> Dri-devel mailing list
> Dri-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>
prev parent reply other threads:[~2009-06-23 15:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-22 17:26 [PATCH] radeon: use vmalloc instead of kmalloc Jerome Glisse
2009-06-23 11:35 ` Peter Zijlstra
2009-06-23 11:42 ` Dave Airlie
2009-06-23 12:23 ` Jerome Glisse
2009-06-23 12:34 ` Peter Zijlstra
2009-06-23 15:14 ` Thomas Hellström [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A40F14F.5050403@shipmail.org \
--to=thomas@shipmail.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.sf.net \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.