From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: linux-nfs-owner@vger.kernel.org Received: from cantor2.suse.de ([195.135.220.15]:47521 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756072Ab2DQMlD (ORCPT ); Tue, 17 Apr 2012 08:41:03 -0400 Date: Tue, 17 Apr 2012 13:40:56 +0100 From: Mel Gorman To: Fred Isaman Cc: Andrew Morton , Linux-MM , Linux-Netdev , Linux-NFS , LKML , David Miller , Trond Myklebust , Neil Brown , Christoph Hellwig , Peter Zijlstra , Mike Christie , Eric B Munson Subject: Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles Message-ID: <20120417124056.GI2359@suse.de> References: <1334578675-23445-1-git-send-email-mgorman@suse.de> <1334578675-23445-9-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 In-Reply-To: Sender: linux-nfs-owner@vger.kernel.org List-ID: > On Mon, Apr 16, 2012 at 9:44 AM, Mel Gorman wrote: > > On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote: > >> > > >> > -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx186.postini.com [74.125.245.186]) by kanga.kvack.org (Postfix) with SMTP id 7A5586B00EA for ; Tue, 17 Apr 2012 08:41:04 -0400 (EDT) Date: Tue, 17 Apr 2012 13:40:56 +0100 From: Mel Gorman Subject: Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles Message-ID: <20120417124056.GI2359@suse.de> References: <1334578675-23445-1-git-send-email-mgorman@suse.de> <1334578675-23445-9-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Fred Isaman Cc: Andrew Morton , Linux-MM , Linux-Netdev , Linux-NFS , LKML , David Miller , Trond Myklebust , Neil Brown , Christoph Hellwig , Peter Zijlstra , Mike Christie , Eric B Munson > On Mon, Apr 16, 2012 at 9:44 AM, Mel Gorman wrote: > > On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote: > >> > > >> > -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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mel Gorman Subject: Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles Date: Tue, 17 Apr 2012 13:40:56 +0100 Message-ID: <20120417124056.GI2359@suse.de> References: <1334578675-23445-1-git-send-email-mgorman@suse.de> <1334578675-23445-9-git-send-email-mgorman@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andrew Morton , Linux-MM , Linux-Netdev , Linux-NFS , LKML , David Miller , Trond Myklebust , Neil Brown , Christoph Hellwig , Peter Zijlstra , Mike Christie , Eric B Munson To: Fred Isaman Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org > On Mon, Apr 16, 2012 at 9:44 AM, Mel Gorman wrote: > > On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote: > >> > > >> > -static struct nfs_page *nfs_page_find_request_locked(struct pag= e *page) > >> > +static struct nfs_page * > >> > +nfs_page_find_request_locked(struct nfs_inode *nfsi, struct pag= e *page) > >> > =A0{ > >> > =A0 =A0 =A0 =A0struct nfs_page *req =3D NULL; > >> > > >> > - =A0 =A0 =A0 if (PagePrivate(page)) { > >> > + =A0 =A0 =A0 if (PagePrivate(page)) > >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0req =3D (struct nfs_page *)page_p= rivate(page); > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (req !=3D NULL) > >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 kref_get(&req->wb_= kref); > >> > + =A0 =A0 =A0 else if (unlikely(PageSwapCache(page))) { > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct nfs_page *freq, *t; > >> > + > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Linearly search the commit list= for the correct req */ > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 list_for_each_entry_safe(freq, t, = &nfsi->commit_list, wb_list) { > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (freq->wb_page = =3D=3D page) { > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 re= q =3D freq; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 br= eak; > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > >> > + > >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 BUG_ON(req =3D=3D NULL); > >> > >> I suspect I am missing something, but why is it guaranteed that th= e > >> req is on the commit list? > >> > > > > It's a fair question and a statement about what I expected to happe= n. > > 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 com= mit > > list and the BUG_ON was based on that expectation. Are there cases = where > > the req would not be found? > > >=20 > A req is on the commit list only if it actually needs to be scheduled > for COMMIT.=A0In other words, only after it has been sent via WRITE a= nd > the server did not return NFS_FILE_SYNC. >=20 > 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 --=20 Mel Gorman SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html