From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933926AbcI0Dku (ORCPT ); Mon, 26 Sep 2016 23:40:50 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47034 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933563AbcI0Dki (ORCPT ); Mon, 26 Sep 2016 23:40:38 -0400 Date: Tue, 27 Sep 2016 04:40:35 +0100 From: Al Viro To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Linus Torvalds Subject: Re: [PATCH 06/11] pipe: no need to confirm page cache buf Message-ID: <20160927034035.GG19539@ZenIV.linux.org.uk> References: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> <1473842236-28655-7-git-send-email-mszeredi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473842236-28655-7-git-send-email-mszeredi@redhat.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 14, 2016 at 10:37:11AM +0200, Miklos Szeredi wrote: > Things could happen to that page that make it not uptodate while sitting in > the pipe, but it's questionable whether we should care about that. > Checking for being uptodate in the face of such page state change is always > going to be racy. I'm not sure it's the right thing to do here; that area looks like a victim of serious bitrot - once upon a time it was ->map(), which used to lock page, verity that it's valid, and kmap it. ->unmap() did kunmap + unlock. Then the validate part got split off (->pin(), later renamed to ->confirm()), with lock _not_ held over the kmap/kunmap. That's the point when it got racy, AFAICS. OTOH, I would really hate to hold a page locked over e.g. copying to userland - too easy to get deadlocks that way. Jens, could you comment? Pages definitely shouldn't be getting into pipe without having been uptodate; the question is what (if anything) should be done about having a page go non-uptodate (on truncate, hole-punching, etc.) while a reference to it is sitting in a pipe buffer.