Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp406250ybi; Wed, 19 Jun 2019 01:23:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJNkkHg3K1vZ1alkncC7W0JOZNsnfigmS7evCBE6q0+zml837FjsXwdTddOv5xCov8ZW8j X-Received: by 2002:a63:1622:: with SMTP id w34mr6696302pgl.45.1560932603674; Wed, 19 Jun 2019 01:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560932603; cv=none; d=google.com; s=arc-20160816; b=D9AcbkpZB88DIgMcr6Gr1CZv8uBCTpABPu/uak3//H8b844PXpi2+RuL3c6hmkEFYq nEEVC1XOCgKOJyyUdQ3a2gib93wzX8i75rifDsGDJP2FOCoasCnRiOisyrSFTiGEHp2o 8w7lK5is2Umqst4WK8Ksx6KOQzmuHU8UdinEhCudnQZLDz1/L8+8iWf9v8nM+DfD0taJ Vqa/wPMSzawGbGwfK5fj6tUjYoQJpHJl2kIdsB3073cGEfoJzhvSG6GPI+aypw0L+Rsr ZfxkmGo+OB0wBshzEy8c1VfmBzaG0LGfvP3rg51jI2hqiIwNFPfOJGJrlpecXkNz9aLq Ek3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dgIpC5pd7bFP3JN0KHmAz8QZudYW+mSEaTR6R4qcEW4=; b=1HF9RyAus5Q4m4+HUA+rl8dgBrC6pbECs1o/yCVPskKahSm7yTwCy38Qszbq/fMeyN 34C4nWlD3kIeHgFgpC5BOvKmRqeyeLQ/oPCqnOkwBbsXojLCyh0d5DY5yw0gcu0kWLcC p9VN0J7unN+/yt0Lh7pMAOoUcDuCK3dxKUwCIun4c6KTT0KzJ7/aynLcKMZKKNT7guRG IEfZS+LqOcl4ZivoPB9t2S1wSj1DVL/a936j9WDsDuFcJmvgK9wU2grezpNGwxI8VY8P MiScmsKOUCD3GrmO3R3gKqepyBgCxfsH1mZu8bl+XjaIXtYrBzW11ZjQiXGjkQgydGvS Jw1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o68si14986609pfo.184.2019.06.19.01.23.08; Wed, 19 Jun 2019 01:23:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731244AbfFSIVp (ORCPT + 99 others); Wed, 19 Jun 2019 04:21:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:49250 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726142AbfFSIVp (ORCPT ); Wed, 19 Jun 2019 04:21:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 853F1AF30; Wed, 19 Jun 2019 08:21:43 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 502821E0492; Wed, 19 Jun 2019 10:21:41 +0200 (CEST) Date: Wed, 19 Jun 2019 10:21:41 +0200 From: Jan Kara To: Dave Chinner Cc: Kent Overstreet , Linus Torvalds , Dave Chinner , Waiman Long , Peter Zijlstra , Linux List Kernel Mailing , linux-fsdevel , linux-bcache@vger.kernel.org, "Darrick J . Wong" , Zach Brown , Jens Axboe , Josef Bacik , Alexander Viro , Andrew Morton , Tejun Heo Subject: Re: bcachefs status update (it's done cooking; let's get this sucker merged) Message-ID: <20190619082141.GA32409@quack2.suse.cz> References: <20190610191420.27007-1-kent.overstreet@gmail.com> <20190611011737.GA28701@kmo-pixel> <20190611043336.GB14363@dread.disaster.area> <20190612162144.GA7619@kmo-pixel> <20190612230224.GJ14308@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190612230224.GJ14308@dread.disaster.area> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 13-06-19 09:02:24, Dave Chinner wrote: > On Wed, Jun 12, 2019 at 12:21:44PM -0400, Kent Overstreet wrote: > > This would simplify things a lot and eliminate a really nasty corner case - page > > faults trigger readahead. Even if the buffer and the direct IO don't overlap, > > readahead can pull in pages that do overlap with the dio. > > Page cache readahead needs to be moved under the filesystem IO > locks. There was a recent thread about how readahead can race with > hole punching and other fallocate() operations because page cache > readahead bypasses the filesystem IO locks used to serialise page > cache invalidation. > > e.g. Readahead can be directed by userspace via fadvise, so we now > have file->f_op->fadvise() so that filesystems can lock the inode > before calling generic_fadvise() such that page cache instantiation > and readahead dispatch can be serialised against page cache > invalidation. I have a patch for XFS sitting around somewhere that > implements the ->fadvise method. > > I think there are some other patches floating around to address the > other readahead mechanisms to only be done under filesytem IO locks, > but I haven't had time to dig into it any further. Readahead from > page faults most definitely needs to be under the MMAPLOCK at > least so it serialises against fallocate()... Yes, I have patch to make madvise(MADV_WILLNEED) go through ->fadvise() as well. I'll post it soon since the rest of the series isn't really dependent on it. Honza -- Jan Kara SUSE Labs, CR