Re: [PATCH] Export shmem_file_setup and shmem_getpage for DRM-GEM

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Keith Packard <keithp@...>
Cc: Nick Piggin <nickpiggin@...>, Christoph Hellwig <hch@...>, Eric Anholt <eric@...>, <linux-kernel@...>
Date: Monday, August 4, 2008 - 2:39 pm

On Mon, 4 Aug 2008, Keith Packard wrote:

Could, yes, but should? I wouldn't presume to answer with any authority.


Well, I guess put the check on ->readpage into your code for now, and
by the time GEM gets into Linus's tree, we should have -EINVAL checks
on NULL filler() in __read_cache_page() and read_cache_page_async(),
so remove check at your end before final submission.

(You could leave it there, and strictly we ought to update GEM if we
make any change to our implementation; but it is the kind of detail
that gets overlooked - witness the way I failed to grasp the readahead
side-effects of adding ->readpage into tmpfs until recently.  I'm just
afraid we'd break you unwittingly: better not, though easily fixed.)

I'm not sending the patch right now, waiting to see if this direction
wins general favour.


I think you should drop the mark_page_accessed(): that's done in
read_cache_page_async() as part of the initial read_mapping_page().
But do it again when releasing if you think there's a good chance
that object will be wanted again shortly.  set_page_dirty() if
modified by GPU, yes, that would still be needed.

For how long are these objects' pages pinned in memory like this?
I ask because Rik & Lee have patches in -mm, trying to avoid long
scans of LRUs cluttered with unevictable pages.  I've no idea
whether you're adding a lot or a little to that problem.

Hugh
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] PCI: Add pci_read_base() API, Eric Anholt, (Fri Aug 1, 2:58 am)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:30 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Hugh Dickins, (Mon Aug 4, 2:39 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 12:20 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:34 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 10:16 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 1:32 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Stephane Marchesin, (Wed Aug 6, 2:09 pm)
Re: [PATCH] Export shmem_file_setup and shmem_getpage for DR..., Christoph Hellwig, (Sun Aug 10, 9:23 pm)
Re: [PATCH] Export shmem_file_setup for DRM-GEM, Keith Packard, (Sun Aug 10, 11:03 pm)