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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 35AD9C433E3 for ; Mon, 15 Jun 2020 07:53:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DD3E2067B for ; Mon, 15 Jun 2020 07:53:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="HhueOiVc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728694AbgFOHxs (ORCPT ); Mon, 15 Jun 2020 03:53:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgFOHxr (ORCPT ); Mon, 15 Jun 2020 03:53:47 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA4DC05BD1E for ; Mon, 15 Jun 2020 00:53:47 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id q19so16345148eja.7 for ; Mon, 15 Jun 2020 00:53:47 -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=qply8dKLeFaH4C6xkbOwjlmAeElLYwIxkvYjz4HgFmM=; b=HhueOiVcGkaWE4SAMi1on9IbXgdNyb2uhfyf8/Aj9U8ZGUCv/Mi3CZ/HwGvqViJDVf S0+D+lmd8efd1yaOoHKUvW0UZqI+mw6hMBbi9slDfrwYO1/c79JN+b4hAlmxLpSpC7Os J0aIRDN/JdU3/EuHpQ2pAinRIvOP6ifWBQG0I= 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=qply8dKLeFaH4C6xkbOwjlmAeElLYwIxkvYjz4HgFmM=; b=mkKkudO56XexFmnz806YO8H4cZzQV2zaifxQc/Y6W6F+k+fxWIsIzeVISFoMKBUgo1 0z2a8H8/chl3cM4Ckcm/ptMnr2UKYsojWI4bT5vPaj8cZolo7SItMuXq3qHrWFBoh+OM QGrX1DNWuAmqXxMBSHbmX+AFrz//UXL2/mHOd27iDOubbJIXnR7wuuCx2NY835Eir5BS wIqAZFQkaWWFwf4uR9Rag41+Z9u6W4zLhTOy0tIg0JzABdKNuZYo89hb5FS4ken73CCJ YlGOKLqgX6UffzgafHpstrzy3BxJYbMPkLF7QXqnJW5VheYEa8gIWWjSpuy9EMjp+Bfo 1LKg== X-Gm-Message-State: AOAM531ZoQuUjfSpPRygxfNoBTNKFDPUJN3U+k+5ZkED5pFj6ab+UX1w 0xloTu4ZHDlzILndFihMf/uL7FUlVwlp2LtyDUFH3w== X-Google-Smtp-Source: ABdhPJzeY6pLBqIqCEq52de509qkwa6bP+P+AW5dk2d1DDvZM/diV9S57KakTHTc8rIWoXqTu9x8Au1BPpStS70hhNI= X-Received: by 2002:a17:906:31d2:: with SMTP id f18mr23974716ejf.110.1592207625916; Mon, 15 Jun 2020 00:53:45 -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: <6e8924b0-bfc4-eaf5-1775-54f506cdf623@oracle.com> From: Miklos Szeredi Date: Mon, 15 Jun 2020 09:53:35 +0200 Message-ID: Subject: Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files To: Mike Kravetz Cc: Amir Goldstein , 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-unionfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-unionfs@vger.kernel.org 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? > > I agree with Colin's remark about adding limitations, but it would be a shame > > if overlay had to special case hugetlbfs. It would have been better if we could > > find a property of hugetlbfs that makes it inapplicable for overlayfs > > upper/lower > > or stacking fs in general. > > > > The simplest thing for you to do in order to shush syzbot is what procfs does: > > /* > > * procfs isn't actually a stacking filesystem; however, there is > > * too much magic going on inside it to permit stacking things on > > * top of it > > */ > > s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH; > > > > Currently, the only in-tree stacking fs are overlayfs and ecryptfs, but there > > are some out of tree implementations as well (shiftfs). > > So you may only take that option if you do not care about the combination > > of hugetlbfs with any of the above. > > > > overlayfs support of mmap is not as good as one might hope. > > overlayfs.rst says: > > "If a file residing on a lower layer is opened for read-only and then > > memory mapped with MAP_SHARED, then subsequent changes to > > the file are not reflected in the memory mapping." > > > > So if I were you, I wouldn't go trying to fix overlayfs-huguetlb interop... > > Thanks again, > > I'll look at something as simple as s_stack_depth. Agree. Thanks, Miklos 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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 A7800C433DF for ; Mon, 15 Jun 2020 07:53:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4C5F8206D7 for ; Mon, 15 Jun 2020 07:53:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=szeredi.hu header.i=@szeredi.hu header.b="HhueOiVc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C5F8206D7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=szeredi.hu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E277A6B0005; Mon, 15 Jun 2020 03:53:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD8F26B0006; Mon, 15 Jun 2020 03:53:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CED6A6B0007; Mon, 15 Jun 2020 03:53:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id B4BFA6B0005 for ; Mon, 15 Jun 2020 03:53:48 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6D859356D for ; Mon, 15 Jun 2020 07:53:48 +0000 (UTC) X-FDA: 76930682136.18.sound21_340b44e26df4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 4A22C100EDBE4 for ; Mon, 15 Jun 2020 07:53:48 +0000 (UTC) X-HE-Tag: sound21_340b44e26df4 X-Filterd-Recvd-Size: 5144 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Jun 2020 07:53:47 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id w16so15818103ejj.5 for ; Mon, 15 Jun 2020 00:53:46 -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=qply8dKLeFaH4C6xkbOwjlmAeElLYwIxkvYjz4HgFmM=; b=HhueOiVcGkaWE4SAMi1on9IbXgdNyb2uhfyf8/Aj9U8ZGUCv/Mi3CZ/HwGvqViJDVf S0+D+lmd8efd1yaOoHKUvW0UZqI+mw6hMBbi9slDfrwYO1/c79JN+b4hAlmxLpSpC7Os J0aIRDN/JdU3/EuHpQ2pAinRIvOP6ifWBQG0I= 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=qply8dKLeFaH4C6xkbOwjlmAeElLYwIxkvYjz4HgFmM=; b=itMydYIINaboXWfH9TrryzXRp8J3a4QKsrGsdKoKcxJiUri6Se8AC8E3inhLDWksrw YzPkWByE3kG2Tas+ZfXNTmWCwf/zcgCuHkMeh332hmengXfYBKqJuGkNtDe0+JqzsRJs ZfV5RDvDuuSJ/WZzgupjldpbQdeBPCO3lqsvDvwlnp0p+feGWzPpUaIZuOPs37DAynbJ 9gwvvUuQAWktrnNzfiDIMlDHXRwDNd/SfVdArol2pvsKg5BwunVlYYnRsSUqG817wYoe pT2IjR9AKFPqIDMJgFmvMa1o3yvl9s4EGeA5t/bBuPSTTiy4m8KbWV3PJblhSFSMeUvQ Pq6A== X-Gm-Message-State: AOAM533FqUPYpKTji6KlEP6YrPqyKSEpNf7RpfsAPYP5xhe3kB9RPhPf xYTRLTSp1aXyg1mX9yQokUeg8ylb5r8p7/iLD80PxA== X-Google-Smtp-Source: ABdhPJzeY6pLBqIqCEq52de509qkwa6bP+P+AW5dk2d1DDvZM/diV9S57KakTHTc8rIWoXqTu9x8Au1BPpStS70hhNI= X-Received: by 2002:a17:906:31d2:: with SMTP id f18mr23974716ejf.110.1592207625916; Mon, 15 Jun 2020 00:53:45 -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: <6e8924b0-bfc4-eaf5-1775-54f506cdf623@oracle.com> From: Miklos Szeredi Date: Mon, 15 Jun 2020 09:53:35 +0200 Message-ID: Subject: Re: [PATCH v4 1/2] hugetlb: use f_mode & FMODE_HUGETLBFS to identify hugetlbfs files To: Mike Kravetz Cc: Amir Goldstein , 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" X-Rspamd-Queue-Id: 4A22C100EDBE4 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 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? > > I agree with Colin's remark about adding limitations, but it would be a shame > > if overlay had to special case hugetlbfs. It would have been better if we could > > find a property of hugetlbfs that makes it inapplicable for overlayfs > > upper/lower > > or stacking fs in general. > > > > The simplest thing for you to do in order to shush syzbot is what procfs does: > > /* > > * procfs isn't actually a stacking filesystem; however, there is > > * too much magic going on inside it to permit stacking things on > > * top of it > > */ > > s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH; > > > > Currently, the only in-tree stacking fs are overlayfs and ecryptfs, but there > > are some out of tree implementations as well (shiftfs). > > So you may only take that option if you do not care about the combination > > of hugetlbfs with any of the above. > > > > overlayfs support of mmap is not as good as one might hope. > > overlayfs.rst says: > > "If a file residing on a lower layer is opened for read-only and then > > memory mapped with MAP_SHARED, then subsequent changes to > > the file are not reflected in the memory mapping." > > > > So if I were you, I wouldn't go trying to fix overlayfs-huguetlb interop... > > Thanks again, > > I'll look at something as simple as s_stack_depth. Agree. Thanks, Miklos