linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* invalidate_complete_page()
@ 2006-09-07 19:00 Andrew Morton
  2006-09-07 19:41 ` invalidate_complete_page() Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2006-09-07 19:00 UTC (permalink / raw)
  To: Nick Piggin, Hugh Dickins; +Cc: linux-mm

This is buggy, isn't it?  If someone faults the page into pagetables after
invalidate_mapping_pages() checked page_mapped(), the faulter-inner gets an
anonymous, not-up-to-date page which he didn't expect.

Locking the page in the pagefault handler will fix that, but meanwhile I
think we need to be checking page_count() in invalidate_complete_page(),
after taking tree_lock?

--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: invalidate_complete_page()
  2006-09-07 19:00 invalidate_complete_page() Andrew Morton
@ 2006-09-07 19:41 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2006-09-07 19:41 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Nick Piggin, linux-mm

On Thu, 7 Sep 2006, Andrew Morton wrote:
> 
> This is buggy, isn't it?  If someone faults the page into pagetables after
> invalidate_mapping_pages() checked page_mapped(), the faulter-inner gets an
> anonymous, not-up-to-date page which he didn't expect.

You're right.  ("anonymous" meaning "detached" rather than PageAnon.)

> 
> Locking the page in the pagefault handler will fix that,

(I thought I scared you off that?  Just for a while perhaps.
If Nick plugs the hole(s?) he noticed in his earlier patch,
and wider performance testing shows that the hit is acceptable,
then we'd all agree it's the best way to go.)

> but meanwhile I
> think we need to be checking page_count() in invalidate_complete_page(),
> after taking tree_lock?

Yes, that should do nicely: it's already happy to skip on lots of
transient circumstances, no harm in adding another such, to avoid
the more serious inconsistency you notice above.

Hugh

--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2006-09-07 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-07 19:00 invalidate_complete_page() Andrew Morton
2006-09-07 19:41 ` invalidate_complete_page() Hugh Dickins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox