* Another wish item for your TODO list... @ 2000-10-23 16:54 Stephen C. Tweedie 2000-10-23 17:02 ` Rik van Riel 0 siblings, 1 reply; 9+ messages in thread From: Stephen C. Tweedie @ 2000-10-23 16:54 UTC (permalink / raw) To: Rik van Riel; +Cc: linux-mm, Stephen Tweedie Hi, Just a quick thought --- at some point it would be good if we could add logic to the core VM so that for sequentially accessed files, reclaiming any page of the file from cache would evict the _whole_ of the file from cache. For large files, we're not going to try to cache the whole thing anyway. For small files, reading the whole file back in later isn't much more expensive than reading back a few fragments if the rest still happens to be in cache. Cheers, Stephen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 16:54 Another wish item for your TODO list Stephen C. Tweedie @ 2000-10-23 17:02 ` Rik van Riel 2000-10-23 17:36 ` Stephen C. Tweedie 0 siblings, 1 reply; 9+ messages in thread From: Rik van Riel @ 2000-10-23 17:02 UTC (permalink / raw) To: Stephen C. Tweedie; +Cc: linux-mm On Mon, 23 Oct 2000, Stephen C. Tweedie wrote: > Just a quick thought --- at some point it would be good if we > could add logic to the core VM so that for sequentially accessed > files, reclaiming any page of the file from cache would evict > the _whole_ of the file from cache. I take it you mean "move all the pages from before the currently read page to the inactive list", so we preserve the pages we just read in with readahead ? > For large files, we're not going to try to cache the whole thing > anyway. For small files, reading the whole file back in later > isn't much more expensive than reading back a few fragments if > the rest still happens to be in cache. Indeed. regards, Rik -- "What you're running that piece of shit Gnome?!?!" -- Miguel de Icaza, UKUUG 2000 http://www.conectiva.com/ http://www.surriel.com/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 17:02 ` Rik van Riel @ 2000-10-23 17:36 ` Stephen C. Tweedie 2000-10-23 18:07 ` Rik van Riel 2000-10-23 22:28 ` Ingo Oeser 0 siblings, 2 replies; 9+ messages in thread From: Stephen C. Tweedie @ 2000-10-23 17:36 UTC (permalink / raw) To: Rik van Riel; +Cc: Stephen C. Tweedie, linux-mm Hi, On Mon, Oct 23, 2000 at 03:02:06PM -0200, Rik van Riel wrote: > > > Just a quick thought --- at some point it would be good if we > > could add logic to the core VM so that for sequentially accessed > > files, reclaiming any page of the file from cache would evict > > the _whole_ of the file from cache. > > I take it you mean "move all the pages from before the > currently read page to the inactive list", so we preserve > the pages we just read in with readahead ? No, I mean that once we actually remove a page, we should also remove all the other pages IF the file has never been accessed in a non-sequential manner. The inactive management is separate. It's an optimisation in CPU time as much as for anything else: there's just no point in doing expensive memory balancing/aging for pages which we know are next to useless. Cheers, Stephen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 17:36 ` Stephen C. Tweedie @ 2000-10-23 18:07 ` Rik van Riel 2000-10-23 19:38 ` Stephen C. Tweedie 2000-10-23 22:28 ` Ingo Oeser 1 sibling, 1 reply; 9+ messages in thread From: Rik van Riel @ 2000-10-23 18:07 UTC (permalink / raw) To: Stephen C. Tweedie; +Cc: linux-mm On Mon, 23 Oct 2000, Stephen C. Tweedie wrote: > On Mon, Oct 23, 2000 at 03:02:06PM -0200, Rik van Riel wrote: > > > > > Just a quick thought --- at some point it would be good if we > > > could add logic to the core VM so that for sequentially accessed > > > files, reclaiming any page of the file from cache would evict > > > the _whole_ of the file from cache. > > > > I take it you mean "move all the pages from before the > > currently read page to the inactive list", so we preserve > > the pages we just read in with readahead ? > > No, I mean that once we actually remove a page, we should also remove > all the other pages IF the file has never been accessed in a > non-sequential manner. The inactive management is separate. > > It's an optimisation in CPU time as much as for anything else: > there's just no point in doing expensive memory balancing/aging > for pages which we know are next to useless. The problem here is that we shouldn't remove the pages which are in the current readahead window, as those /will/ most likely be used in the near future. One option could be to free all inactive pages in the address space of that file, but we'd still need to go around and find them... regards, Rik -- "What you're running that piece of shit Gnome?!?!" -- Miguel de Icaza, UKUUG 2000 http://www.conectiva.com/ http://www.surriel.com/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 18:07 ` Rik van Riel @ 2000-10-23 19:38 ` Stephen C. Tweedie 2000-10-23 20:13 ` Rik van Riel 0 siblings, 1 reply; 9+ messages in thread From: Stephen C. Tweedie @ 2000-10-23 19:38 UTC (permalink / raw) To: Rik van Riel; +Cc: Stephen C. Tweedie, linux-mm Hi, On Mon, Oct 23, 2000 at 04:07:02PM -0200, Rik van Riel wrote: > > It's an optimisation in CPU time as much as for anything else: > > there's just no point in doing expensive memory balancing/aging > > for pages which we know are next to useless. > > The problem here is that we shouldn't remove the pages which are > in the current readahead window, as those /will/ most likely be > used in the near future. It probably only makes real sense to do this for inodes which are not in use, anyway, which avoids that problem completely. Cheers, Stephen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 19:38 ` Stephen C. Tweedie @ 2000-10-23 20:13 ` Rik van Riel 2000-10-23 20:44 ` Stephen C. Tweedie 0 siblings, 1 reply; 9+ messages in thread From: Rik van Riel @ 2000-10-23 20:13 UTC (permalink / raw) To: Stephen C. Tweedie; +Cc: linux-mm On Mon, 23 Oct 2000, Stephen C. Tweedie wrote: > On Mon, Oct 23, 2000 at 04:07:02PM -0200, Rik van Riel wrote: > > > > It's an optimisation in CPU time as much as for anything else: > > > there's just no point in doing expensive memory balancing/aging > > > for pages which we know are next to useless. > > > > The problem here is that we shouldn't remove the pages which are > > in the current readahead window, as those /will/ most likely be > > used in the near future. > > It probably only makes real sense to do this for inodes which > are not in use, anyway, which avoids that problem completely. FreeBSD has a neat solution for this: - if the memory item (file, shm segment, ...) is in use, move the page to the inactive list (equivalent to our inactive_dirty) - if the item isn't in use, move the page to the cache list (equivalent to our inactive_clean list) We could extend this by moving *every* page of an item which isn't in use to the inactive_clean list once we move ONE page of such an item to that list (or reclaim it?). [IMHO we don't want to free the page ... no need to throw away the data in the page too soon] regards, Rik -- "What you're running that piece of shit Gnome?!?!" -- Miguel de Icaza, UKUUG 2000 http://www.conectiva.com/ http://www.surriel.com/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 20:13 ` Rik van Riel @ 2000-10-23 20:44 ` Stephen C. Tweedie 0 siblings, 0 replies; 9+ messages in thread From: Stephen C. Tweedie @ 2000-10-23 20:44 UTC (permalink / raw) To: Rik van Riel; +Cc: Stephen C. Tweedie, linux-mm Hi, On Mon, Oct 23, 2000 at 06:13:48PM -0200, Rik van Riel wrote: > > - if the memory item (file, shm segment, ...) is in use, move > the page to the inactive list (equivalent to our inactive_dirty) > - if the item isn't in use, move the page to the cache list > (equivalent to our inactive_clean list) > > We could extend this by moving *every* page of an item which > isn't in use to the inactive_clean list once we move ONE page > of such an item to that list (or reclaim it?). For unused inodes which are never sequentially accessed, this should make a lot of sense. --Stephen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 17:36 ` Stephen C. Tweedie 2000-10-23 18:07 ` Rik van Riel @ 2000-10-23 22:28 ` Ingo Oeser 2000-10-23 22:32 ` Stephen C. Tweedie 1 sibling, 1 reply; 9+ messages in thread From: Ingo Oeser @ 2000-10-23 22:28 UTC (permalink / raw) To: Stephen C. Tweedie; +Cc: Rik van Riel, linux-mm On Mon, Oct 23, 2000 at 06:36:49PM +0100, Stephen C. Tweedie wrote: > On Mon, Oct 23, 2000 at 03:02:06PM -0200, Rik van Riel wrote: > > I take it you mean "move all the pages from before the > > currently read page to the inactive list", so we preserve > > the pages we just read in with readahead ? > No, I mean that once we actually remove a page, we should also remove > all the other pages IF the file has never been accessed in a > non-sequential manner. The inactive management is separate. *.h files, which are read in by the GCC are always accessed sequentielly (at least from the kernel POV) and while unmapping them is ok, they should at least remain in cache to speed up compiling. That's just one example for a workload which will suffer from this idea. If you are going to include stuff like this, please make it at least a sysctl. It would be nice, if I could tell the kernel the workload I have, that these weird access patterns are quite normal for me and how to handle them. Thanks & Regards Ingo Oeser -- Feel the power of the penguin - run linux@your.pc <esc>:x -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Another wish item for your TODO list... 2000-10-23 22:28 ` Ingo Oeser @ 2000-10-23 22:32 ` Stephen C. Tweedie 0 siblings, 0 replies; 9+ messages in thread From: Stephen C. Tweedie @ 2000-10-23 22:32 UTC (permalink / raw) To: Ingo Oeser; +Cc: Stephen C. Tweedie, Rik van Riel, linux-mm Hi, On Tue, Oct 24, 2000 at 12:28:51AM +0200, Ingo Oeser wrote: > On Mon, Oct 23, 2000 at 06:36:49PM +0100, Stephen C. Tweedie wrote: > > On Mon, Oct 23, 2000 at 03:02:06PM -0200, Rik van Riel wrote: > > > I take it you mean "move all the pages from before the > > > currently read page to the inactive list", so we preserve > > > the pages we just read in with readahead ? > > No, I mean that once we actually remove a page, we should also remove > > all the other pages IF the file has never been accessed in a > > non-sequential manner. The inactive management is separate. > > *.h files, which are read in by the GCC are always accessed > sequentielly (at least from the kernel POV) and while unmapping > them is ok, they should at least remain in cache to speed up > compiling. That's just one example for a workload which will > suffer from this idea. No. If they stay in cache, then that's fine: we won't change the caching behaviour at all. All we do is change what happens _after_ the kernel has already decided to start moving pages of the file out of cache because they are old. For small sequential files like header files, there's absolutely no point in having just a few of the pages in cache --- you know, for sure, that if you need one of the pages, you'll need all of them. So, once one of the pages is old enough to be evicted from the cache, there's no point in keeping any of the other pages around. Cheers, Stephen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2000-10-23 22:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2000-10-23 16:54 Another wish item for your TODO list Stephen C. Tweedie 2000-10-23 17:02 ` Rik van Riel 2000-10-23 17:36 ` Stephen C. Tweedie 2000-10-23 18:07 ` Rik van Riel 2000-10-23 19:38 ` Stephen C. Tweedie 2000-10-23 20:13 ` Rik van Riel 2000-10-23 20:44 ` Stephen C. Tweedie 2000-10-23 22:28 ` Ingo Oeser 2000-10-23 22:32 ` Stephen C. Tweedie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox