Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1649881ybt; Mon, 15 Jun 2020 06:07:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/HTLjlR9q7C9Q7k7VvFQSX+n+dTy0SliOH3bRylxWXk/kbFDeeafWXA5rixSNa8PoKGy8 X-Received: by 2002:a17:906:e247:: with SMTP id gq7mr24918339ejb.107.1592226425950; Mon, 15 Jun 2020 06:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592226425; cv=none; d=google.com; s=arc-20160816; b=njZuovYcPPQxa35C5qCwBBJIo0+d417VBy/2rwOUItg2UzuN2XyDdj9rJDBfXdXIZm /gw9Tih/2rT3yyK+uxmXCJgiHzHUIG7njMXJ7kXyX9clUKUNe8xErnhmY/84AgNAdOaM ErCum77kxWr65umk6pYzTtDKMZfDyxKEUoRxKFqgt/8kVTbuh3+Y7s2RFZ+/hGJbbfFb 31daaSmkB9x6tnLPNCVuIxVoCLW66HBRfjCFcux2VRla7YcrekFIw8TvctT+CsKKWOYG KxT9QfEPxMmSsZNc12wVhrZcTzkEXSZFBAhCHd7AAT179RHvM1Z1o73FybmWHVDeNirn K3mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AvCe0HbqQ4BzGml+0DuV0nSjSHUXH/a7GtKAihE8SRE=; b=Mhl9NZ2DDlOzi/OzUJZh496cEbMS5cfyuJ4kBuUnVfMKUwHG57c3zgqf7j68KoSHkj rsGoCKA+nwhnZrTkZOry0FOop4ZmSljPKpFFzd71GDh6arizeKt2FK2bkkjm1d7xQv0K aRZR7SUbfSAkQPchpL/vObQOA7AjHD5KP2T9vYvkdESMA1lvETwCnoq/m6CynTKHEw60 qoAJE8KrnjS5pDDk9f7Ds+5YjyvCzPtMgxyTwg2qhRkKFiJpi1YRuF6u1GPDzs9YCd9d orCM45zhwQsI6Xn4I6oKhZhM7Ql5B2Z5FfXqRUCr7KsLL+BgH4hN6+xu5KMUPzat9uI/ TD7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="AXJhM/hK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 u23si9104756ejb.595.2020.06.15.06.06.43; Mon, 15 Jun 2020 06:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="AXJhM/hK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730415AbgFONCJ (ORCPT + 99 others); Mon, 15 Jun 2020 09:02:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730353AbgFONBu (ORCPT ); Mon, 15 Jun 2020 09:01:50 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CE9CC05BD43 for ; Mon, 15 Jun 2020 06:01:50 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id x93so11438781ede.9 for ; Mon, 15 Jun 2020 06:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AvCe0HbqQ4BzGml+0DuV0nSjSHUXH/a7GtKAihE8SRE=; b=AXJhM/hKmiZBel7yqZsPLh+qR48DiuSWw+gN6NwcjxGonGBBT4xZNIhnQoUZBfpJfH 1NZAFJQspIVoZmiDPMW/zVKEpYy92CPJhP1ryw7noohJnifYPJFtPAPipclcRU51LyVJ aFmGcX6C+7O0dfinR4r59frhdDr+6ymq5ln90= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AvCe0HbqQ4BzGml+0DuV0nSjSHUXH/a7GtKAihE8SRE=; b=p3jsDYrr2XdlXXD30YW/XKeT8DtbCaJyA1VRfPBOhWltrlbnWUkPWyBWrLmor962ks o0jZX0LU6/na1tw2pNM5ZeKAIVdsbcH+Y/Aej7eQ6KrJ2fPHcq3Jsx/jrzLsdEnlRh9z xBQn4HbHyQvaOAsKpnUc5boYtuaIkS1s4rvSiuzQE+uqCekDWvDsDZZ5biZje1xZcgI1 cOVGVSI0W2IhHNKQAtwDfAZSKZdWZ5bWbxnTO6EkcVEGGnGbC1tYi6T8Ub3mpd/F6U1Y jIlOVpdAJqaNloXFEXM6fYFDv7qBr9pJMaM51Nol6tYYLyivuswoKmsPwCOUc2YpCs9d rslg== X-Gm-Message-State: AOAM531cx1ltITz+UnhdTnwvy2KVQQnoZ+zPV3O6JiswpA3igk1f++W0 xSP2ZSMt4J69fe2ubKDf6gBjX26cBGa+7tezI8cbeQ== X-Received: by 2002:aa7:d9d3:: with SMTP id v19mr22985359eds.364.1592226108717; Mon, 15 Jun 2020 06:01:48 -0700 (PDT) MIME-Version: 1.0 References: <20200612004644.255692-1-mike.kravetz@oracle.com> <20200612015842.GC23230@ZenIV.linux.org.uk> <6e8924b0-bfc4-eaf5-1775-54f506cdf623@oracle.com> In-Reply-To: From: Miklos Szeredi Date: Mon, 15 Jun 2020 15:01:37 +0200 Message-ID: Subject: Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files To: Amir Goldstein Cc: Mike Kravetz , Al Viro , Linux MM , linux-fsdevel , overlayfs , linux-kernel , Matthew Wilcox , Colin Walters , Andrew Morton , syzbot , syzkaller-bugs Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 12:05 PM Amir Goldstein wrote: > > On Mon, Jun 15, 2020 at 10:53 AM Miklos Szeredi wrote: > > > > On Sat, Jun 13, 2020 at 9:12 PM Mike Kravetz wrote: > > > > > > On 6/12/20 11:53 PM, Amir Goldstein wrote: > > > > > As a hugetlbfs developer, I do not know of a use case for interoperability > > > with overlayfs. So yes, I am not too interested in making them work well > > > together. However, if there was an actual use case I would be more than > > > happy to consider doing the work. Just hate to put effort into fixing up > > > two 'special' filesystems for functionality that may not be used. > > > > > > I can't speak for overlayfs developers. > > > > As I said, I only know of tmpfs being upper layer as a valid use case. > > Does that work with hugepages? How would I go about testing that? > > Simple, after enabling CONFIG_HUGETLBFS: > > diff --git a/mount_union.py b/mount_union.py > index fae8899..4070c70 100644 > --- a/mount_union.py > +++ b/mount_union.py > @@ -15,7 +15,7 @@ def mount_union(ctx): > snapshot_mntroot = cfg.snapshot_mntroot() > if cfg.should_mount_upper(): > system("mount " + upper_mntroot + " 2>/dev/null" > - " || mount -t tmpfs upper_layer " + upper_mntroot) > + " || mount -t hugetlbfs upper_layer " + upper_mntroot) > layer_mntroot = upper_mntroot + "/" + ctx.curr_layer() > upperdir = layer_mntroot + "/u" > workdir = layer_mntroot + "/w" > > It fails colossally, because hugetlbfs, does not have write_iter(). > It is only meant as an interface to create named maps of huge pages. > So I don't really see the use case for using it as upper. Right. I was actually asking about the tmpfs+hugepages, not the hugetlbfs case. In the tmpfs case it looks like the lack of ->get_unmapped_area() in overlayfs could still be an issue. But I'm not sure how to trigger that. Thanks, Miklos