On Fri, 2008-08-01 at 11:57 +0100, Hugh Dickins wrote:Cool. Using shmem saved a huge amount of code in DRM and allows the GEM objects to be paged to disk if necessary. We haven't added the shrinker API calls to finish this work, but that shouldn't take much additional code. We use it to get a struct page within a shmem object; we don't need the sgp types exposed as we only ever use SGP_DIRTY. We could use a narrower interface like: int shmem_file_page(struct file *file, int idx, struct page **page) { struct inode *inode =3D file->f_path.dentry->d_inode; return shmem_getpage(inode, idx, page, SGP_DIRTY, NULL); } EXPORT_SYMBOL(shmem_file_page); Seems like the simpler interface should be supportable from ramfs: int shmem_file_page(struct file *file, int idx, struct page **page) { struct inode *inode =3D file->f_path.dentry->d_inode; struct address_space *mapping =3D inode->i_mapping; struct page *filepage; =20 filepage =3D find_lock_page(mapping, idx); if (!filepage) return -ENOSPC; *page =3D filepage; return 0; } (no, I didn't try this) I don't know; I'm running without swap on several netbooks these days, and I can easily believe that TINY would be a reasonable option there. Thanks for the suggestions. --=20 keith.packard@intel.com
| Andy Whitcroft | clam |
| Jon Smirl | Re: 463 kernel developers missing! |
| Trent Piepho | [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Jarek Poplawski | Re: HTB accuracy for high speed |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
