mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Kernel lock order
@ 2002-06-28 13:29 Zoltan Menyhart
  2002-06-28 16:33 ` Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: Zoltan Menyhart @ 2002-06-28 13:29 UTC (permalink / raw)
  To: linux-kernel

Is there a list describing the lock hierarchy ?
If not:
Does do_swap_page() (in mm/memory.c) release mm->page_table_lock because
one cannot hold this lock when lookup_swap_cache() ... __find_get_page()
takes pagecache_lock ? Or does it do only for shorten the locked path ?
(Can I keep mm->page_table_lock when I call __find_get_page() ?)

Thanks,

Zoltan Menyhart

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

* Re: Kernel lock order
  2002-06-28 13:29 Kernel lock order Zoltan Menyhart
@ 2002-06-28 16:33 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2002-06-28 16:33 UTC (permalink / raw)
  To: Zoltan Menyhart; +Cc: linux-kernel

On Fri, 28 Jun 2002, Zoltan Menyhart wrote:
> Is there a list describing the lock hierarchy ?

There is indeed Documentation/vm/locking - but I wouldn't trust it
for an instant!  These details change from time to time, Documentation
is likely to lag far behind, the source must be your reference.

There is also a very useful "NOTE:" in the 2.4 mm/filemap.c, which did
get updated in 2.4.14; but that doesn't mention the page_table_lock.

> Does do_swap_page() (in mm/memory.c) release mm->page_table_lock because
> one cannot hold this lock when lookup_swap_cache() ... __find_get_page()
> takes pagecache_lock ? Or does it do only for shorten the locked path ?
> (Can I keep mm->page_table_lock when I call __find_get_page() ?)

I deduce from "pagecache_lock" that you're asking about current 2.4,
though I think an equivalent answer would apply to current 2.5. It does
it to shorten the locked path, you could hold mm->page_table_lock when
you call __find_get_page(): a precedent is where do_swap_page() holds
page_table_lock while calling remove_exclusive_swap_page(), which may
take the pagecache_lock.

But tomorrow... who knows?

Hugh


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

end of thread, other threads:[~2002-06-28 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-28 13:29 Kernel lock order Zoltan Menyhart
2002-06-28 16:33 ` Hugh Dickins

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

all inboxes | Powered by JetHome®