Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1303959pxk; Sat, 12 Sep 2020 20:19:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznH1cB6V+DqRZZaVC5gOS6PS+7wjIhpV7qjuob2U99RwETXjdgk8YDm9WvSBhSQGIZV4Mz X-Received: by 2002:a17:907:2456:: with SMTP id yw22mr8321781ejb.337.1599967163214; Sat, 12 Sep 2020 20:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599967163; cv=none; d=google.com; s=arc-20160816; b=d8+xA/ds0RliDoIKt4z7U23hOOCr7CwgTwX7h7S4TLYIBlG9QNl2KWXZfd89S0gv+m bAvnRaKO8Q0aP1KURr4TaNpWzRrny94ZcclkLuqjuYw0I/MR+sMdXJovgSPJ6TMVAleW 7F85OmTUE66abDkiKT6T4bCG+uUh8QV5bGfCZ37fiJGpM8OSzFudeQS1vN/20Ot/aNKQ NLQsoqHl0Ng/H7+w9oRnzpVSUTAbJaimdRyst9TtFmIdAIWovJxaMkB7rDeDiq4DfYP7 /UYDej41+ZcC7T5EQ0cX4CTXzNm5/DwfW3vNNKlqMVtkIdbNlV3ugcobwq6igL/i9W4I FJrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=07Yc9hlOZlK8jaubITpX1W4ZXVuDqM+qxh845euYi0Y=; b=Xi7ig+ORijdVDpa5aZEhmZWOn20kg0MDVClGWxsNyAQsJJedvRNvWDlYi9vbXTUedr jtWEQn1B5/mYNPEeNRVX0ETRz4ae63BuSUGIMgovxNWWNoQez86NfuzzG6bDyTB4ahSZ bGGiWlOjqeChEpKMXEsDTd0UgCMyDH0XrRRRf9F6T1/rv9fCFmBF03qOKzQnSU6r6H4V mysLSIKzV1y5BFBknm1hMDB83XmCxOzFoiRH/v406DCkXVCdQx1wajP6nVxSDGRF2iZI x5IFFIOy/5WARVAfYJPJ2Umyu9km0QSBVc7H6b9rlfbjJzw3m3a7w8wdg7s7nwuvfd11 Mk+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=ntMY+xGA; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si4387313edy.390.2020.09.12.20.18.50; Sat, 12 Sep 2020 20:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=ntMY+xGA; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725913AbgIMDSp (ORCPT + 99 others); Sat, 12 Sep 2020 23:18:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbgIMDSl (ORCPT ); Sat, 12 Sep 2020 23:18:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B60C061573; Sat, 12 Sep 2020 20:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=07Yc9hlOZlK8jaubITpX1W4ZXVuDqM+qxh845euYi0Y=; b=ntMY+xGArjDoNHYicjjvf/9a/3 +Mru0JqVS8VtG8cAGjzvDRaC2BadQvQlC/tM/4J5vju9X+Dk8ymqPI6t75Tu6nUZkAtJLMHc61zXU ECxCzg+28nf0RWdeoX/5o+g49KsyeZ/p0CmFYC15lVCuFRrMKcJWgkZdtHbAzW/E+GXe9yo1cgYn2 mghdhPbddrJDunMBVVIPZSwadzr6dqYJo917UDO1/NyugOKaDwspRcqs4vF+qU3ilcTZPAwEkme5P DtrGtDQ0ISfR3dzGpSXrNT57C9lnchIosTHjl0wa0qMci6X9Vt1503LPR/9yalYlXmGaGLeMn93k5 ejLehgUA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHIXB-0003pf-9B; Sun, 13 Sep 2020 03:18:33 +0000 Date: Sun, 13 Sep 2020 04:18:33 +0100 From: Matthew Wilcox To: Dave Chinner Cc: Linus Torvalds , Amir Goldstein , Hugh Dickins , Michael Larabel , Ted Ts'o , Andreas Dilger , Ext4 Developers List , Jan Kara , linux-fsdevel Subject: Re: Kernel Benchmarking Message-ID: <20200913031833.GE6583@casper.infradead.org> References: <8bb582d2-2841-94eb-8862-91d1225d5ebc@MichaelLarabel.com> <0cbc959e-1b8d-8d7e-1dc6-672cf5b3899a@MichaelLarabel.com> <20200913004057.GR12096@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200913004057.GR12096@dread.disaster.area> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Sep 13, 2020 at 10:40:57AM +1000, Dave Chinner wrote: > > The reason the apache benchmark regresses is that it basically does a > > web server test with a single file ("test.html") that gets served by > > just mmap'ing it, and sending it out that way. Using lots of threads, > > and using lots of different mappings. So they *all* fault on the read > > of that page, and they *all* do that "lock page, check that the > > mapping is valid, insert page" dance. > > Hmmmm. So this is a typically a truncate race check, but this isn't > sufficient to protect the fault against all page invalidation races > as the page can be re-inserted into the same mapping at a different > page->index now within EOF. No it can't. find_get_page() returns the page with an elevated refcount. The page can't be reused until we call put_page(). It can be removed from the page cache, but can't go back to the page allocator until the refcount hits zero. > 5) filesystems will still need to be able to exclude page faults > over a file range while they directly manipulate file metadata to > change the user data in the file Yes, but they can do that with a lock inside ->readpage (and, for that matter in ->readahead()), so there's no need to take a lock for pages which are stable in cache.