tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: page busy vs. glock



Juergen Hannken-Illjes wrote:

> On Fri, Sep 05, 2008 at 07:29:04PM +0300, Antti Kantee wrote:
> > Simon reported a problem where he's writing to a file (log of build -j4)
> > and repeatedly doing tail -5000.  He says that this causes hangs sooner
> > or later.
> > 
> > Upon examination, it seems that writing to the log goes through
> > ufs_balloc_range(), which busies the new pages it wants to enlarge the
> > file to and then takes the genfs node lock to do actual block allocation.
> > 
> > Meanwhile, tail coming in through mmap + genfs_getpages and holding the
> > genfs lock tries to uvn_findpages.
> >   ==> deadlock between PG_BUSY and glock
> 
> Is this deadlock really possible?
> Do you have a stack trace?

I can reproduce a case where nbmake has it's output redirected to a
file, and gets blocked in "tstile" with this backtrace (10 finger
cut'n'paste):

        sleepq_block
        turnstile_block
        rw_vector_enter
        genfs_node_wrlock
        ufs_balloc_range
        ffs_write
        VOP_WRITE
        vn_write
        dofilewrite
        sys_write
        syscall

and tail is blocked in "uvn_fp2" with this backtrace:

        sleepq_block
        mtsleep
        uvn_findpage
        uvn_findpages
        genfs_getpages
        VOP_GETPAGES
        uvn_get
        uvm_fault_internal
        trap

Simon.


Home | Main Index | Thread Index | Old Index