From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C127AC4363A for ; Sun, 25 Oct 2020 23:19:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 07497222EC for ; Sun, 25 Oct 2020 23:19:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="R2XbFQg8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07497222EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 197346B005D; Sun, 25 Oct 2020 19:19:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 149EB6B0062; Sun, 25 Oct 2020 19:19:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 060A96B0068; Sun, 25 Oct 2020 19:19:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0230.hostedemail.com [216.40.44.230]) by kanga.kvack.org (Postfix) with ESMTP id CA6B76B005D for ; Sun, 25 Oct 2020 19:19:46 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 56EE88249980 for ; Sun, 25 Oct 2020 23:19:46 +0000 (UTC) X-FDA: 77412017172.14.touch21_25031dc2726e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 348C518229818 for ; Sun, 25 Oct 2020 23:19:46 +0000 (UTC) X-HE-Tag: touch21_25031dc2726e X-Filterd-Recvd-Size: 3677 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Sun, 25 Oct 2020 23:19:45 +0000 (UTC) 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=VwK0jJNMBFLTZhR5eyefyBrpMJ25xSMU+BYUItGgaU8=; b=R2XbFQg8z5q/d8ZeYuKXD/vP5R D5ZiFh8W4AXaS4lhLZKI89IJGMWSaq+o9J1b8f2gO3NMThYNaSRIOaKlbTSNVk1RNryP7smh4zh+7 dhXQ2LZ5Ob5YbXGBDvKigQZHBJZft8UfjW+ONvVs1cavDxX5mzJ2cHyU51dpephyCKR43gZLW6jYp 0nBaGhD1farUDo8FYvJofduE/1uxCEklgok3Z7kbHbb9lLyTCdQxruF3KP0v/9gTMcTA6ew+WeZcg 7UlwHOV7ub/HjJWCrU2+TX1zis5V+OPENvUN/5J3fEM+F4P5jWyWeBK80UjA2N9GVqhtiOyXuhg9J mig0jqiQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kWpIU-0001Jw-3L; Sun, 25 Oct 2020 23:19:34 +0000 Date: Sun, 25 Oct 2020 23:19:34 +0000 From: Matthew Wilcox To: Jan Kara Cc: linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , Johannes Weiner , Yang Shi , Dave Chinner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 12/12] mm/filemap: Return only head pages from find_get_entries Message-ID: <20201025231934.GL20115@casper.infradead.org> References: <20200914130042.11442-1-willy@infradead.org> <20200914130042.11442-13-willy@infradead.org> <20200930121512.GT10896@quack2.suse.cz> <20200930123637.GP20115@casper.infradead.org> <20200930170807.GA15977@quack2.suse.cz> <20200930172321.GS20115@casper.infradead.org> <20201001071728.GA17860@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201001071728.GA17860@quack2.suse.cz> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 01, 2020 at 09:17:28AM +0200, Jan Kara wrote: > > I have a followup patch which isn't part of this series which fixes it: > > > > http://git.infradead.org/users/willy/pagecache.git/commitdiff/364283163847d1c106463223b858308c730592a1 > > Yeah, that looks good. How about partial THPs? The way you've implemented > it we will now possibly evict more than strictly required. But OTOH > evicting exactly may require THP split which is a bit unfortunate. But > probably still a better option because otherwise we could have pages being > repeatedly brought in and out of cache just because e.g. workload mixes > direct and buffered IO and is not aligned to THP boundary (and although I > find loads mixing buffered and direct IO to the same file badly designed, > I know for a fact that they do exist and if the file ranges are not > overlapping, it is not that insane design). Sorry, forgot to reply to this. In this patchset, THPs are created by readahead. We always start out by allocating order-0 pages and only ramp up after hitting a page marked as PageReadahead. So it's not like tmpfs where we'll try to jump straight to order-9 pages and have to worry about the behaviour you're describing above. That means in this kind of scenario, we might have, eg, an order-6 page in the cache, remove the whole thing, then bring back in some order-0 pages. If we hit on those, we'll bring in some order-2 pages. We won't bring in order-6 pages again until we've hit in the readahead window twice more. I think the ramp-up is probably too aggressive, but it's fun for testing.