Messages in this thread Patch in this message | | | Date | Wed, 23 Jun 2004 15:22:21 -0700 | From | William Lee Irwin III <> | Subject | Re: [oom]: [1/4] add __GFP_WIRED to pinned allocations |
| |
William Lee Irwin III <wli@holomorphy.com> wrote: >> +#define __GFP_WIRED 0x8000 /* pinned */
On Wed, Jun 23, 2004 at 03:05:46PM -0700, Andrew Morton wrote: > This would be a nice thing to keep track of. > Isn't it the case that reclaimable slab pages (dentry, inode, mbcache, > dquot) should not be accounted as wired memory? Could perhaps use > SLAB_RECLAIM_ACCOUNT for that. > It would need to be overridden for, say, sysfs inodes and dentries, but > they're about to become reclaimable anyway so no prob. > It would need to be overridden for, say, ramfs dentries and inodes though. > rd.c's blockdev pagecache pages are wired.
It's difficult to come up with comprehensible semantic refinements. The trick with slab is whole slabs are frequently pinned by active references, so there's quite a bit of squishiness there even after SLAB_RECLAIM_ACCOUNT is figured out. A counter in the slab header for references is plausibly precise, but appears to too invasive to ever put into place. A less invasive refinement may be to clear_page_wired() for empty slab pages.
Thanks for spotting rd.c's blkdev pagecache; that's a bogon in my patches.
Also, I should mention this concept is based on code seen in RHEL3, which uses a __GFP_WIRED flag, albeit for a different purpose (it appears to be centered around removing dirty ramfs pagecache from the LRU lists(s) as opposed to accounting for OOM-related reasons).
-- wli
Index: linux-2.6.7/drivers/block/rd.c =================================================================== --- linux-2.6.7.orig/drivers/block/rd.c 2004-06-16 05:19:37.000000000 +0000 +++ linux-2.6.7/drivers/block/rd.c 2004-06-23 22:16:45.000000000 +0000 @@ -378,7 +378,7 @@ */ gfp_mask = mapping_gfp_mask(mapping); gfp_mask &= ~(__GFP_FS|__GFP_IO); - gfp_mask |= __GFP_HIGH; + gfp_mask |= __GFP_HIGH|__GFP_WIRED; mapping_set_gfp_mask(mapping, gfp_mask); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |