lkml.org 
[lkml]   [2012]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles
> On Mon, Apr 16, 2012 at 9:44 AM, Mel Gorman <mgorman@suse.de> wrote:
> > On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote:
> >> > <SNIP>
> >> > -static struct nfs_page *nfs_page_find_request_locked(struct page *page)
> >> > +static struct nfs_page *
> >> > +nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page)
> >> >  {
> >> >        struct nfs_page *req = NULL;
> >> >
> >> > -       if (PagePrivate(page)) {
> >> > +       if (PagePrivate(page))
> >> >                req = (struct nfs_page *)page_private(page);
> >> > -               if (req != NULL)
> >> > -                       kref_get(&req->wb_kref);
> >> > +       else if (unlikely(PageSwapCache(page))) {
> >> > +               struct nfs_page *freq, *t;
> >> > +
> >> > +               /* Linearly search the commit list for the correct req */
> >> > +               list_for_each_entry_safe(freq, t, &nfsi->commit_list, wb_list) {
> >> > +                       if (freq->wb_page == page) {
> >> > +                               req = freq;
> >> > +                               break;
> >> > +                       }
> >> > +               }
> >> > +
> >> > +               BUG_ON(req == NULL);
> >>
> >> I suspect I am missing something, but why is it guaranteed that the
> >> req is on the commit list?
> >>
> >
> > It's a fair question and a statement about what I expected to happen.
> > The commit list replaces the nfs_page_tree radix tree that used to exist
> > and my understanding was that the req would exist in the radix tree until
> > the swap IO was completed. I expected it to be the same for the commit
> > list and the BUG_ON was based on that expectation. Are there cases where
> > the req would not be found?
> >
>
> A req is on the commit list only if it actually needs to be scheduled
> for COMMIT. In other words, only after it has been sent via WRITE and
> the server did not return NFS_FILE_SYNC.
>
> Thus dirtying a page, then trying to touch it again before the WRITE
> is sent will not find the corresponding req on the commit_list.

Thanks for the explanation. I'll remove the BUG_ON

--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-04-17 14:43    [W:0.132 / U:0.276 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site