[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190307190910.GE3835@redhat.com>
Date: Thu, 7 Mar 2019 14:09:10 -0500
From: Jerome Glisse <jglisse@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Jason Wang <jasowang@...hat.com>, kvm@...r.kernel.org,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, peterx@...hat.com,
linux-mm@...ck.org, aarcange@...hat.com
Subject: Re: [RFC PATCH V2 5/5] vhost: access vq metadata through kernel
virtual address
On Thu, Mar 07, 2019 at 10:34:39AM -0500, Michael S. Tsirkin wrote:
> On Thu, Mar 07, 2019 at 10:45:57AM +0800, Jason Wang wrote:
> >
> > On 2019/3/7 上午12:31, Michael S. Tsirkin wrote:
> > > > +static void vhost_set_vmap_dirty(struct vhost_vmap *used)
> > > > +{
> > > > + int i;
> > > > +
> > > > + for (i = 0; i < used->npages; i++)
> > > > + set_page_dirty_lock(used->pages[i]);
> > > This seems to rely on page lock to mark page dirty.
> > >
> > > Could it happen that page writeback will check the
> > > page, find it clean, and then you mark it dirty and then
> > > invalidate callback is called?
> > >
> > >
> >
> > Yes. But does this break anything?
> > The page is still there, we just remove a
> > kernel mapping to it.
> >
> > Thanks
>
> Yes it's the same problem as e.g. RDMA:
> we've just marked the page as dirty without having buffers.
> Eventually writeback will find it and filesystem will complain...
> So if the pages are backed by a non-RAM-based filesystem, it’s all just broken.
>
> one can hope that RDMA guys will fix it in some way eventually.
> For now, maybe add a flag in e.g. VMA that says that there's no
> writeback so it's safe to mark page dirty at any point?
I thought this patch was only for anonymous memory ie not file back ?
If so then set dirty is mostly useless it would only be use for swap
but for this you can use an unlock version to set the page dirty.
Cheers,
Jérôme
Powered by blists - more mailing lists