From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: linux-nfs-owner@vger.kernel.org Received: from mail-pa0-f42.google.com ([209.85.220.42]:57808 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753602AbaLVHci (ORCPT ); Mon, 22 Dec 2014 02:32:38 -0500 Received: by mail-pa0-f42.google.com with SMTP id et14so5435839pad.1 for ; Sun, 21 Dec 2014 23:32:38 -0800 (PST) Date: Sun, 21 Dec 2014 23:32:34 -0800 From: Omar Sandoval To: Al Viro Cc: Andrew Morton , Trond Myklebust , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Mel Gorman Subject: Re: [PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter Message-ID: <20141222073234.GA14207@mew> References: <20141220061337.GB22149@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20141220061337.GB22149@ZenIV.linux.org.uk> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Sat, Dec 20, 2014 at 06:13:37AM +0000, Al Viro wrote: > On Fri, Dec 19, 2014 at 07:18:28PM -0800, Omar Sandoval wrote: > > > + ret = swap_file->f_op->read_iter(&kiocb, &to); > > + if (ret == PAGE_SIZE) { > > + SetPageUptodate(page); > > count_vm_event(PSWPIN); > > + ret = 0; > > + } else { > > + ClearPageUptodate(page); > > + SetPageError(page); > > + } > > + unlock_page(page); > > Umm... What's to guarantee that ->read_iter() won't try lock_page() on what > turns out to be equal to page? Ergh. I don't see why ->read_iter would be screwing around in the swap cache or with the pages in the iterator, anything in particular you can see happening? -- Omar From mboxrd@z Thu Jan 1 00:00:00 1970 From: Omar Sandoval Subject: Re: [PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter Date: Sun, 21 Dec 2014 23:32:34 -0800 Message-ID: <20141222073234.GA14207@mew> References: <20141220061337.GB22149@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Trond Myklebust , Christoph Hellwig , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mel Gorman To: Al Viro Return-path: Content-Disposition: inline In-Reply-To: <20141220061337.GB22149-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Sat, Dec 20, 2014 at 06:13:37AM +0000, Al Viro wrote: > On Fri, Dec 19, 2014 at 07:18:28PM -0800, Omar Sandoval wrote: > > > + ret = swap_file->f_op->read_iter(&kiocb, &to); > > + if (ret == PAGE_SIZE) { > > + SetPageUptodate(page); > > count_vm_event(PSWPIN); > > + ret = 0; > > + } else { > > + ClearPageUptodate(page); > > + SetPageError(page); > > + } > > + unlock_page(page); > > Umm... What's to guarantee that ->read_iter() won't try lock_page() on what > turns out to be equal to page? Ergh. I don't see why ->read_iter would be screwing around in the swap cache or with the pages in the iterator, anything in particular you can see happening? -- Omar -- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by kanga.kvack.org (Postfix) with ESMTP id 678F86B006E for ; Mon, 22 Dec 2014 02:32:40 -0500 (EST) Received: by mail-pd0-f181.google.com with SMTP id v10so5253335pde.26 for ; Sun, 21 Dec 2014 23:32:40 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com. [209.85.220.52]) by mx.google.com with ESMTPS id cn5si24035006pdb.137.2014.12.21.23.32.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Dec 2014 23:32:39 -0800 (PST) Received: by mail-pa0-f52.google.com with SMTP id eu11so5410472pac.39 for ; Sun, 21 Dec 2014 23:32:38 -0800 (PST) Date: Sun, 21 Dec 2014 23:32:34 -0800 From: Omar Sandoval Subject: Re: [PATCH v2 4/5] swapfile: use ->read_iter and ->write_iter Message-ID: <20141222073234.GA14207@mew> References: <20141220061337.GB22149@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141220061337.GB22149@ZenIV.linux.org.uk> Sender: owner-linux-mm@kvack.org List-ID: To: Al Viro Cc: Andrew Morton , Trond Myklebust , Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Mel Gorman On Sat, Dec 20, 2014 at 06:13:37AM +0000, Al Viro wrote: > On Fri, Dec 19, 2014 at 07:18:28PM -0800, Omar Sandoval wrote: > > > + ret = swap_file->f_op->read_iter(&kiocb, &to); > > + if (ret == PAGE_SIZE) { > > + SetPageUptodate(page); > > count_vm_event(PSWPIN); > > + ret = 0; > > + } else { > > + ClearPageUptodate(page); > > + SetPageError(page); > > + } > > + unlock_page(page); > > Umm... What's to guarantee that ->read_iter() won't try lock_page() on what > turns out to be equal to page? Ergh. I don't see why ->read_iter would be screwing around in the swap cache or with the pages in the iterator, anything in particular you can see happening? -- Omar -- 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/ . Don't email: email@kvack.org