Messages in this thread | | | Date | Thu, 19 Jan 2006 17:20:32 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] shrink_list: Use of && instead || leads to unintended writing of pages |
| |
Christoph Lameter <clameter@engr.sgi.com> wrote: > > On Thu, 19 Jan 2006, Andrew Morton wrote: > > > The effects of this fix will be a) slightly improved memory allocator > > latency, b) somehat improved disk writeout patterns and c) somewhat > > increased risk of ooms. > > If we do not operate in laptop mode and are not using zone_reclaim > (!may_writepage) which is the common case then there will be no effect at > all.
Ah, I misremembered how the code works. Your patch will break laptop mode.
They way it works is:
laptop_mode=0: always write out dirty pages which come off the tail of the LRU.
laptop_mode=1: don't write out dirty pages if we're only performing light scanning. But do write them out once page reclaim starts getting into difficulty.
The idea is that in laptop mode we'll avoid spinning up the disk for occasional random dirty pages which are interspersed amongst a majority of clean, reclaimable pages. But once reclaim is getting into trouble, we need to spin that disk up anyway to clean out some memory.
Your patch means that in laptop moe we'll just never write out these dirty pages ever - we'll overscan and go oom.
I guess if zone reclaim wants to permanently disable writeback then it'll be needing a new scan_control flag for that. Which means that we need to remember to initialise that flag in lots of different places, which is why I dislike scan_control. A (separate, preceding) patch which converts scan_control initialisation to do memset+initialise-non-zero-members would be appreciated.
- 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/
| |