tech-kern archive

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

Re: [PATCH] Re: zero-filed page on VOP_PUTPAGES



YAMAMOTO Takashi <yamt%mwd.biglobe.ne.jp@localhost> wrote:

> > We would have a PNODE_IN_RESIZE flag for struct pnode's pn_stat, set and
> > cleared in dosetattr(), and use vp->v_size on uvm_vnp_setsize() calls
> > when set? Or just avoid uvm_vnp_setsize() calls?
> 
> just avoid the calls.

There is a problem if two threads enter dosetattr() at the same time:
the flag would be cleared on first thread completing the operation, and
we get the same race again.

Therefore I think a mutex must guard setattr/uvm_vnp_setsize in
dosettatr(). Does it makes sense to reuse an existing mutex (which
one?), or should I introduce a new one, for instance pn_inrewrite in
struct pnode?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index