Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jun 1999 10:16:15 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: The clean and dirty buffer list of a vnode
Message-ID:  <199906131716.KAA04387@apollo.backplane.com>
References:   <Pine.GSO.3.96.990611215349.1397A-100000@sol.cs.binghamton.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
:>From the source code of vtruncbuf() in file vfs_subr.c, I find out that
:the code deals with the case when a buffer linked on the clean or dirty
:list of a vnode can change its identity (b_xflags flag, b_vp field, or
:B_DELWRI flag). For example, a buffer's B_VNCLEAN flag is cleared even if
:it is found on the clean list. Or a buffer's B_DELWRI flag is cleared
:even if it is found on the dirty list. This is new in FreeBSD 3.x.
:
:Can anyone explain to me how can this happen?
:
:Any help is appreciated.
:
:--------------------------------------------------
:Zhihui Zhang.  Please visit http://www.freebsd.org
:--------------------------------------------------

    Ah, I know what this is.... I was confused by your description.

    What is going on here is that vtruncbuf() is scanning a linked
    list and potentially sleeping in the middle of the scan.  It is possible
    for the current buffer in the scan to be ripped out from under the
    scan during the sleep and move to a different queue.

    So, in fact, if B_VNCLEAN is set we know that the buffer is on the clean
    list, and vise versa, and we use this to check whether we've been
    transported to a different queue during the scan.

    Even though the code looks messy, it works as advertised.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906131716.KAA04387>