question on using kiobuf stuff

Scott Henry (scotth@sgi.com)
22 Dec 1999 16:54:31 -0800


I'm working on porting our filesystem +
device-masquerading-as-filesystem to use kiobufs. I seem to have run
into a deadlock when trying to use map_user_kiobuf from in my nopage
function: do_page_fault() (arch/i386/mm/fault.c:140) takes a
down(&mm->mmap_sem), and then map_user_kiobuf() (mm/memory.c:~461)
also takes it. If I understand semaphores correctly, they sleep on
the second+ calls to down(), so I have a deadlock situation here.

So, what is the best way to work around this? Should I modify the
kiobuf stuff to determine if the semaphore is already taken (how)?
Write my own variant? re-architect the code (probably major work)?

thanks for any help!

-- 
 Scott Henry <scotth@sgi.com> /  Help! My disclaimer is missing!
 IRIX MTS,                   /  GIGO *really* means: Garbage in, Gospel Out
 Silicon Graphics, Inc      /  http://reality.sgi.com/scotth/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/