Re: [PATCH 34/49] gma500: the GEM and GTT code is deviceindependant
From: Alan Cox
Date: Fri Jul 08 2011 - 04:37:10 EST
> As example, below is the patch where I updated drm/i915 to be ready
> for the changeover. They set __GFP_RECLAIMABLE on the mapping because
> they've got a way to discard unpinned object pages when memory is tight;
> and sometimes add in __GFP_NORETRY|__GFP_NOWARN when allocating.
>
> I'm guessing you'd just want to use shmem_read_mapping_page() throughout,
> after initializing mapping with the appropriate flags (GFP_HIGHUSER_MOVABLE
> is fs/inode.c's default: maybe your pages aren't easily movable and you'd
> better say GFP_HIGHUSER, or maybe you have reason to need GFP_KERNEL).
I need the pages in the low 4GB ideally and have no way to release them
if they are pinned. For the usage pattern I have that's not a problem.
At the moment the 4G isn't a problem either as you can't attach enough
memory to cause problems to any of these devices.
What I don't entirely understand from your change is what stops another
user task with the shmemfs file handle open from doing something else
which changes the mapping flags, or is it guaranteed that only the
mapping owner gets to play ?
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/