Messages in this thread Patch in this message | | | Date | Fri, 30 Apr 2004 01:02:13 -0700 | From | Andrew Morton <> | Subject | Re: ~500 megs cached yet 2.6.5 goes into swap hell |
| |
Jeff Garzik <jgarzik@pobox.com> wrote: > > > fadvise(POSIX_FADV_DONTNEED) is ideal for this. Run it once per megabyte > > or so. > > > Sweet. I'm so happy you added posix_fadvise (way back when), and even > happier to hear this.
There are a number of other goodies we could add to it, as linux extensions.
> Does our fadvise support len==0 ("I mean the whole file")? That's > defined in POSIX, and would allow a compliant app to simply > POSIX_FADV_DONTNEED once at the beginning.
Well I'll be darned.
--- 25/mm/fadvise.c~fadvise-len-fix 2004-04-30 00:58:00.437598504 -0700 +++ 25-akpm/mm/fadvise.c 2004-04-30 00:59:03.237051536 -0700 @@ -38,6 +38,9 @@ asmlinkage long sys_fadvise64_64(int fd, goto out; } + if (len == 0) /* 0 == "all data following offset" */ + len = -1; + bdi = mapping->backing_dev_info; switch (advice) { _
- 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/
| |