On Mon, 4 Aug 2008, Keith Packard wrote:Yes, that's a good suggestion from Nick, should work with shmem/tmpfs (with *proviso below) and others, and big improvement to your generality. Whether such usage conforms to VFS API I'm not so sure: as I understand it, it's really for internal use by a filesystem - if it's going to be used beyond that, we ought to add a check that the filesystem it's used upon really has a ->readpage method (and I'd rather we add such a check than you do it at your end, in case we change the implementation later to use something other than a ->readpage method - Nick, you'll be nauseated to hear I was looking to see if ->fault with a pseudo-vma could do it). But if the layering police are happy with this, I am. The *proviso is that for tmpfs itself this actually isn't as convenient as directly using shmem_getpage: because this way passes a page in to shmem_getpage, when maybe the page wanted is already here but currently marked as swapcache rather than filecache. It's an awkward extension that allows tmpfs to support ->readpage at all. But that route is in use and well-tested, and only an inefficiency when swapping, so should not cause you any problems. (I have been agonizing over the way __read_cache_page, like your original i915_gem_object_get_page_list, uses find_get_page: whereas shmem_getpage uses find_lock_page. I remember the latter is important, but don't quite remember all the why. I'm believing that it's really only the ->fault usage where it becomes vital: things get confused, on 2.4 more than 2.6, if a swapcache tmpfs page is mapped into userspace.) You don't examine page->mapping at all: good, there's a race by which it could go to NULL after you acquired the page by read_mapping_page: not by file truncation, but by swapping out at the wrong instant. Don't worry, you have the right page, just don't rely on page->mapping. (Sorry if I'm rather talking aloud to myself here.) Hugh --
| Hiten Pandya | Re: up? (emacs docbook xml ide) |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| James Bottomley | Re: [Ksummit-2008-discuss] Fixing the Kernel Janitors project |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
