Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1937511ybe; Tue, 3 Sep 2019 05:53:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqymnmY193EcM6urDy9DyCLnhTj3lV25PcCrte3fJvvS9muLXlYrE5vhChMQNM0o5e74AyIR X-Received: by 2002:a17:902:e30d:: with SMTP id cg13mr35392241plb.173.1567515184370; Tue, 03 Sep 2019 05:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567515184; cv=none; d=google.com; s=arc-20160816; b=dZCA8OJrG9+X7FQzC6DuroQpcp5780V3I32Wk6Lh6Y5FczkQpAJN2zNdD/DfJmdvls CKtM6ZTEQ3S2PzCSTvOwOkNctONyhBkbJZaX6fUHf3yuytBJOtYCeIMZTRLWJPaLuVFF P68Gd2bzUUR7RcVXKxKMsopbf1cgBah4nDrMYf85dOKtZFpQhZy2jASsjRe4xR8GFpiX anqhPLe/0EEgTJbbG1DS65Bs7ggalpMFgl6cjS90Szw3N8eX3IiOV3+iYWx1tdqyshSl dV7X2xizzJsMSegArBCd/uJlk/wwtkPXKmOMM57c0MQI8dj2V3uQBrkthb4+ZpWMaqhp hjpQ== 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=qNUCYlrbePPGhDtI3oSfCMKJ/n+rXH0Zu3WeT6KT4ao=; b=AHjsAFx7M0/Hqo/UlKj04kESC18A3zgP4FV72SwDFbStArD/MWn9CsFVMGKcRAq2EQ mBDZ9DgW9iNxwPwPMA3QQ1q8gICDjigs6uarGWdki/Mk6xl5Ov+UDxswDJRYunUQ+T2w +aKWyC50SLxkibesngM6yTs69D+Z6pHC36PssJZozK3n1DmTfx0O2zK0u95l/RNf7S9C c9GFaqwJkDnsXQSTAreZ88fPAl6YCssPe12QbrBAWWMd9E0HUVElOKlJXTFOLTIESImk xgsf2Mx+jlbqkAJ9MlyBNSrK7rRJ+5XJmiAODUYIKLIgWdY+TiRsA7FoA+irldDnrNnP y9EQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z18si13730176pfk.120.2019.09.03.05.52.48; Tue, 03 Sep 2019 05:53:04 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729212AbfICMvw (ORCPT + 99 others); Tue, 3 Sep 2019 08:51:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:38864 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726631AbfICMvw (ORCPT ); Tue, 3 Sep 2019 08:51:52 -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 C1AB5B07D; Tue, 3 Sep 2019 12:51:50 +0000 (UTC) Date: Tue, 3 Sep 2019 14:51:50 +0200 From: Michal Hocko To: Matthew Wilcox Cc: William Kucharski , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Dave Hansen , Song Liu , Bob Kasten , Mike Kravetz , Chad Mynhier , "Kirill A. Shutemov" , Johannes Weiner Subject: Re: [PATCH v5 2/2] mm,thp: Add experimental config option RO_EXEC_FILEMAP_HUGE_FAULT_THP Message-ID: <20190903125150.GW14028@dhcp22.suse.cz> References: <20190902092341.26712-1-william.kucharski@oracle.com> <20190902092341.26712-3-william.kucharski@oracle.com> <20190903121424.GT14028@dhcp22.suse.cz> <20190903122208.GE29434@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190903122208.GE29434@bombadil.infradead.org> 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 Tue 03-09-19 05:22:08, Matthew Wilcox wrote: > On Tue, Sep 03, 2019 at 02:14:24PM +0200, Michal Hocko wrote: > > On Mon 02-09-19 03:23:41, William Kucharski wrote: > > > Add filemap_huge_fault() to attempt to satisfy page > > > faults on memory-mapped read-only text pages using THP when possible. > > > > This deserves much more description of how the thing is implemented and > > expected to work. For one thing it is not really clear to me why you > > need CONFIG_RO_EXEC_FILEMAP_HUGE_FAULT_THP at all. You need a support > > from the filesystem anyway. So who is going to enable/disable this > > config? > > There are definitely situations in which enabling this code will crash > the kernel. But we want to get filesystems to a point where they can > start working on their support for large pages. So our workaround is > to try to get the core pieces merged under a CONFIG_I_KNOW_WHAT_IM_DOING > flag and let people play with it. Then continue to work on the core > to eliminate those places that are broken. I am not sure I understand. Each fs has to opt in to the feature anyway. If it doesn't then there should be no risk of regression, right? I do not expect any fs would rush an implementation in while not being sure about the correctness. So how exactly does a config option help here. > > I cannot really comment on fs specific parts but filemap_huge_fault > > sounds convoluted so much I cannot wrap my head around it. One thing > > stand out though. The generic filemap_huge_fault depends on ->readpage > > doing the right thing which sounds quite questionable to me. If nothing > > else I would expect ->readpages to do the job. > > Ah, that's because you're not a filesystem person ;-) ->readpages is > really ->readahead. It's a crappy interface and should be completely > redesigned. OK, the interface looked like the right fit for this purpose. Thanks for clarifying. -- Michal Hocko SUSE Labs