From: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [RFC PATCH] drm/nouveau: use vmalloc for pgt allocation
Date: Tue, 19 Mar 2013 19:18:05 +0100 [thread overview]
Message-ID: <20130319181805.GB3038@joi.lan> (raw)
In-Reply-To: <1362509833-28968-1-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Tue, Mar 05, 2013 at 07:57:08PM +0100, Marcin Slusarz wrote:
> Page tables on nv50 take 48kB, which can be hard to allocate in one piece.
> Let's use vmalloc.
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [3.7+]
> ---
> drivers/gpu/drm/nouveau/core/subdev/vm/base.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
> index 77c67fc..e66fb77 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c
> @@ -362,7 +362,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
> vm->fpde = offset >> (vmm->pgt_bits + 12);
> vm->lpde = (offset + length - 1) >> (vmm->pgt_bits + 12);
>
> - vm->pgt = kcalloc(vm->lpde - vm->fpde + 1, sizeof(*vm->pgt), GFP_KERNEL);
> + vm->pgt = vzalloc((vm->lpde - vm->fpde + 1) * sizeof(*vm->pgt));
> if (!vm->pgt) {
> kfree(vm);
> return -ENOMEM;
> @@ -371,7 +371,7 @@ nouveau_vm_create(struct nouveau_vmmgr *vmm, u64 offset, u64 length,
> ret = nouveau_mm_init(&vm->mm, mm_offset >> 12, mm_length >> 12,
> block >> 12);
> if (ret) {
> - kfree(vm->pgt);
> + vfree(vm->pgt);
> kfree(vm);
> return ret;
> }
> @@ -446,7 +446,7 @@ nouveau_vm_del(struct nouveau_vm *vm)
> }
>
> nouveau_mm_fini(&vm->mm);
> - kfree(vm->pgt);
> + vfree(vm->pgt);
> kfree(vm);
> }
>
> --
What's up with this patch?
Marcin
next prev parent reply other threads:[~2013-03-19 18:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 18:57 [RFC PATCH] drm/nouveau: use vmalloc for pgt allocation Marcin Slusarz
[not found] ` <1362509833-28968-1-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-03-19 18:18 ` Marcin Slusarz [this message]
2013-06-11 8:58 ` [Nouveau] " Maarten Lankhorst
2013-06-11 9:51 ` Zlatko Calusic
2013-06-12 20:15 ` Marcin Ślusarz
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=20130319181805.GB3038@joi.lan \
--to=marcin.slusarz-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.