I'd much rather set this up by splitting up __GFP_IO into two parts (ie
__GFP_IO and __GFP_IO_BOUNCE), and avoiding have "negative" bits in the
gfp_mask. That way the bits in gfp_mask always end up increasing things we
can do, not ever decreasing them.
Also, your test is really wrong:
page->zone != &pgdat_list->node_zones[ZONE_HIGHMEM]
is bogus and assumes MUCH too intimate knowledge of there being only one
particular zone that is "highmem" (think NUMA machines where each node may
have its own highmem setup). So it SHOULD be something along the lines of
#ifdef CONFIG_HIGHMEM
if (!(gfp_mask & __GFP_HIGHIO) && PageHighMem(page))
return;
#endif
inside the write case of sync_page_buffers() (we can, and probably should,
still _wait_ for highmem buffers - but whether we do it inside
sync_page_buffers() or inside try_to_free_buffers() is probably mostly a
matter of taste - I won't argue too much with your choice there).
Other than that, the basic approach looks sane, I would just prefer for
the testing and bits to be done more regularly.
Linus
-
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/