All of lore.kernel.org
 help / color / mirror / Atom feed
* isolate_lru_page on !head pages
@ 2015-12-09 13:02 ` Michal Hocko
  0 siblings, 0 replies; 12+ messages in thread
From: Michal Hocko @ 2015-12-09 13:02 UTC (permalink / raw)
  To: Kirill A. Shutemov; +Cc: Andrew Morton, Minchan Kim, linux-mm, LKML

Hi Kirill,
while looking at the issue reported by Minchan [1] I have noticed that
there is nothing to prevent from "isolating" a tail page from LRU because
isolate_lru_page checks PageLRU which is
PAGEFLAG(LRU, lru, PF_HEAD)
so it is checked on the head page rather than the given page directly
but the rest of the operation is done on the given (tail) page.

This is really subtle because this expects that every caller of this
function checks for the tail page otherwise we would clobber statistics
and who knows what else (I haven't checked that in detail) as the page
cannot be on the LRU list and the operation makes sense only on the head
page.

Would it make more sense to make PageLRU PF_ANY? That would return
false for PageLRU on any tail page and so it would be ignored by
isolate_lru_page.

I haven't checked other flags but there might be a similar situation. I
am wondering whether it is really a good idea to perform a flag check on
a different page then the operation which depends on the result of the
test in general. It sounds like a maintenance horror to me.

[1] http://lkml.kernel.org/r/20151201133455.GB27574@bbox
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-12-22 15:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 13:02 isolate_lru_page on !head pages Michal Hocko
2015-12-09 13:02 ` Michal Hocko
2015-12-14 12:04 ` Kirill A. Shutemov
2015-12-14 12:04   ` Kirill A. Shutemov
2015-12-15  8:52   ` Michal Hocko
2015-12-15  8:52     ` Michal Hocko
2015-12-15 12:03     ` Kirill A. Shutemov
2015-12-15 12:03       ` Kirill A. Shutemov
2015-12-15 16:59       ` Michal Hocko
2015-12-15 16:59         ` Michal Hocko
2015-12-22 15:47         ` Vlastimil Babka
2015-12-22 15:47           ` Vlastimil Babka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.