Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2115004ybe; Tue, 3 Sep 2019 08:11:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqweKLlwWIk7SgmGXCqlV9Rzd3mnommQRnwWT71bCOp1US3woBgZUI6vA/l/TqDEYHnXGA4W X-Received: by 2002:a62:cd45:: with SMTP id o66mr41659437pfg.112.1567523512417; Tue, 03 Sep 2019 08:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567523512; cv=none; d=google.com; s=arc-20160816; b=nKxqZsJpS1vrd6GipqP1KRTmvCQgBaJfNQuiBX0/iQi/zbDBqzCI1gq9D4Kx7d69oi UE5kh+gXl738rZ2EWW+JVCOyZJWBd53ODiz4/9d2DytstpIyqvU/v9A/07KIvzVb5g1a xE9XkOjfCutXMkLkA9gIYfQe0XUviCVeJsUZ2si21aSrOmtv/HcP5nZOmjqjNM6szlPQ r8MXjdyQ3g1lvJzUeIdr4S21TjOrdN3WoBhcMVwVlQ54NwdPkXCrvtMps2W0TthzdeFf db6Rq0ICV2hQrAdorHcKrt4Z86wCgnKnbCPkOIJAb1nEqFtAdODNCQqHeISpu2F8FAC3 pRuw== 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:dkim-signature; bh=kMYjLPkGWlldvgkaEMtVa8ofXfOGNI4Vt2JfjkgF+V8=; b=C847wIenL/rP2iLPW1RYbvPFdpZzx1fEoLfqYQ68MWseY51shOZ/nxjdx9+EhH6G4A cPQh7lSKwl3anuwmKDq9S2GOM/v0PQ2GEkqwsJ+s3MktXS6PkuKqucE9x9z/gYxZTWRO t17G9OeGpy3bP8TClO0zoVTZHcOsvFRspY6rtYdQh0fCuG8JGobMhfucJyn64a6I0iRw 5ovfYBdMJTbbhrIn5A7N7hYxhMGNmIvAq74tKbtKGVMW220l/uKD4NJ/UuVWK9/jiUwb S7UpC+ZaqEoBosEd36MCvZzaabaXb/aMRQQ0pzD4m6+dHnf+B46rJkR19YjngWiEaN8C NL5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ua+qEoKR; 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 y7si6019559pll.314.2019.09.03.08.11.12; Tue, 03 Sep 2019 08:11:52 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ua+qEoKR; 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 S1729754AbfICPKR (ORCPT + 99 others); Tue, 3 Sep 2019 11:10:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40456 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729079AbfICPKR (ORCPT ); Tue, 3 Sep 2019 11:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kMYjLPkGWlldvgkaEMtVa8ofXfOGNI4Vt2JfjkgF+V8=; b=ua+qEoKR5NGKobxrhyfObMiaz 28qJVK5Cmtj469tUpUMjB5lIhBAeCh8YKXRWmBqvQ4pA4q2geWOc7hwsuuLD8+20ifshN6X4mmUS8 dnku9KimzBjhNU+wOPyckNP9v2fCKVt0JqP6dfPr2Iy2wR6+wKii5AXoHWgk31haG0tSLeZ9E705l OgK0SqS7wfjf5NjzHOsFVLkmeE914uKAhFYNYTgaxuyEY7xR1vymBvwcopjWnk96vWdEiuI0IbOp7 HGt1Xj+QSm5q/t4M5uq0KOhEsWQL/MElDbumvXJxhbLoV4Mop2RQClRXXx2FzsZes+pqT9yHt9vfO O3Dtop/1A==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1i5ARj-0008Bn-Vp; Tue, 03 Sep 2019 15:10:15 +0000 Date: Tue, 3 Sep 2019 08:10:15 -0700 From: Matthew Wilcox To: Michal Hocko 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: <20190903151015.GF29434@bombadil.infradead.org> 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> <20190903125150.GW14028@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190903125150.GW14028@dhcp22.suse.cz> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 02:51:50PM +0200, Michal Hocko wrote: > 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. Filesystems won't see large pages unless they've opted into them. But there's a huge amount of page-cache work that needs to get done before this can be enabled by default. For example, truncate() won't work properly. Rather than try to do all the page cache work upfront, then wait for the filesystems to catch up, we want to get some basics merged. Since we've been talking about this for so long without any movement in the kernel towards actual support, this felt like a good way to go. We could, of course, develop the entire thing out of tree, but that's likely to lead to pain and anguish.