Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3760443ybh; Tue, 6 Aug 2019 00:51:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEz48tBUQ7CdhVCWgGs5qdWkzYkbikSz1dOrLgvfMR1ScSdWT1RxTkmu2LCXoSp5RFMCdH X-Received: by 2002:a63:8a49:: with SMTP id y70mr1918836pgd.271.1565077885627; Tue, 06 Aug 2019 00:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565077885; cv=none; d=google.com; s=arc-20160816; b=KAMH8WQLgF/8DjwBFOsgPnMPp/ZUGm7oS6dgdi0qjtcK/2jn0MQPKAv7hHQWVL/ZHE VpfYwEKvgizWLAMCD+RKa804ylAwBGimomifq+v6G2YcDWJnyRtDoBTUqhgXEdezh+bx jgnSJB9TOwnf6mPtdBoRQWmRk3icw+zLgiDdXocu5AfUijJSaGVqLPivG2npW3xxi/De GgMk29OPU2BA7aMoSavKHgCQL2W2JfNX6YCvAFbTQyIxE+/e+yYjIAW2ndThVf3R2aym ianpYDt4Y7vraduEXdEJmBNo9f52wMlHJc/K/YROlZkunl0RsOQ7lWPVVYjfKbqNEkDq n/mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=kWFJ9VXWY9elnW+Cpayl7VN+eLgA38VWzMzPMfOSo/4=; b=jNaU5YzkFXV5lXIu0QP/0qV8cDOVMfHzYVUwtMr49RBdciPm8wFvpU5SYYKhwhwqA6 HtGBfyyIwBJs2oMZ9/kI6sPxrBqUtdkTC2+mRykgzzlmt8JkT5WX5ZU9/YFIuDfwJygI 7tQ9YHq/U+5R1b1k0RfULSGh5xJZFQyhq4fsaKSprlD8JILFtzYHreNY1080IxLwH1T+ R7Cs5HJR087Yk8gJV9UWY7vQcoccrX4de4MHdfwVBMnwkgDt82KlCTMud5YRQwYAj+S5 2I4vE5VLAS0uqcjylsoUotl/Sfkf7Gma85uluKJQa7PnIx4pSscOU34HW2L2smnBU5HA 0/tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pOEUKjHZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si8888928pfr.97.2019.08.06.00.51.10; Tue, 06 Aug 2019 00:51:25 -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=pass header.i=@google.com header.s=20161025 header.b=pOEUKjHZ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731735AbfHFHua (ORCPT + 99 others); Tue, 6 Aug 2019 03:50:30 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:46171 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfHFHua (ORCPT ); Tue, 6 Aug 2019 03:50:30 -0400 Received: by mail-ot1-f65.google.com with SMTP id z23so61917734ote.13 for ; Tue, 06 Aug 2019 00:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=kWFJ9VXWY9elnW+Cpayl7VN+eLgA38VWzMzPMfOSo/4=; b=pOEUKjHZrG9frTrjhAHloZ07xJ3LROaCTkRB9MivU7GBayjsVbeU6wMMDGVhhLdu2P ImdbTERwKFKukEw/kJrzyN4wlCnm1R6QN+XHy33VfJzQKySBEx/ibsMY+0xu2ZglMEaJ 3l/2WR7I8VtuWCjUEJWoPvM1Fmcz4cCWzCaFEafICEUOsKNXop7K8jAwLixrkq6QOJtJ c2F3FxbUvarZfm/gKoC98fkt7c2PQpQHNqgri2uGvWagH7CrRLfVy9Zrkn/cCFpElw++ Ab9wA1mMgC2J08lGAS8gqUkXdhIgAvg/eWTfBX/s9anS7JZq2FeYqcuJq1M61EBREiPN fXng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=kWFJ9VXWY9elnW+Cpayl7VN+eLgA38VWzMzPMfOSo/4=; b=Pwfcdl/1OS5Mo4ytF1tAhNK6NyD5Xxh/YSfwjjY3MkJQ0BJzplJvUtlWZ8BLB06LYr ejmuyPLC2UNu2PV9WXXkGDo92WcXhDSiNu1XqOvvGRNjpJo5OZS+r+8kxAZdKWJZsDqK U1JbW5hfyQm1VOiVCdJC6D0EQqWlyukrL7IN25M8c2R44sdF8LcJW6MBncg+TPFda2Hu 8U7ManVi2QghefStQc2Xz2OFpfeNik4ZLVgsSRg6yEodmsGo9G7OMof1nKiUVN4HrRWx rA89AstaMxrdzmvgTmeHEbZwOEeIFQoW3X7Ds7PfkcimIpfctlxcsuO8rHx88WykgGqt f+aQ== X-Gm-Message-State: APjAAAUrJBie0ECmdwYo+dHV3K1jYb1MTHBEUNnXM4eTFKKrR1JToy4x P2qMYKkedHl6qKl5I66ro52uCQ== X-Received: by 2002:a9d:5787:: with SMTP id q7mr2061375oth.75.1565077828501; Tue, 06 Aug 2019 00:50:28 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id g6sm28504405otl.50.2019.08.06.00.50.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Aug 2019 00:50:27 -0700 (PDT) Date: Tue, 6 Aug 2019 00:50:10 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Al Viro cc: Sergey Senozhatsky , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Chris Wilson , David Howells , Christoph Hellwig , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Hugh Dickins Subject: Re: [PATCHv2 2/3] i915: convert to new mount API In-Reply-To: <20190805182834.GI1131@ZenIV.linux.org.uk> Message-ID: References: <20190805160307.5418-1-sergey.senozhatsky@gmail.com> <20190805160307.5418-3-sergey.senozhatsky@gmail.com> <20190805181255.GH1131@ZenIV.linux.org.uk> <20190805182834.GI1131@ZenIV.linux.org.uk> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 5 Aug 2019, Al Viro wrote: > On Mon, Aug 05, 2019 at 07:12:55PM +0100, Al Viro wrote: > > On Tue, Aug 06, 2019 at 01:03:06AM +0900, Sergey Senozhatsky wrote: > > > tmpfs does not set ->remount_fs() anymore and its users need > > > to be converted to new mount API. > > > > Could you explain why the devil do you bother with remount at all? > > Why not pass the right options when mounting the damn thing? > > ... and while we are at it, I really wonder what's going on with > that gemfs thing - among the other things, this is the only > user of shmem_file_setup_with_mnt(). Sure, you want your own > options, but that brings another question - is there any reason > for having the huge=... per-superblock rather than per-file? Yes: we want a default for how files of that superblock are to allocate their pages, without people having to fcntl or advise each of their files. Setting aside the weirder options (within_size, advise) and emergency/ testing override (shmem_huge), we want files on an ordinary default tmpfs (huge=never) to be allocated with small pages (so users with access to that filesystem will not consume, and will not waste time and space on consuming, the more valuable huge pages); but files on a huge=always tmpfs to be allocated with huge pages whenever possible. Or am I missing your point? Yes, hugeness can certainly be decided differently per-file, or even per-extent of file. That is already made possible through "judicious" use of madvise MADV_HUGEPAGE and MADV_NOHUGEPAGE on mmaps of the file, carried over from anon THP. Though personally I'm averse to managing "f"objects through "m"interfaces, which can get ridiculous (notably, MADV_HUGEPAGE works on the virtual address of a mapping, but the huge-or-not alignment of that mapping must have been decided previously). In Google we do use fcntls F_HUGEPAGE and F_NOHUGEPAGE to override on a per-file basis - one day I'll get to upstreaming those. Hugh > > After all, the readers of ->huge in mm/shmem.c are > mm/shmem.c:582: (shmem_huge == SHMEM_HUGE_FORCE || sbinfo->huge) && > is_huge_enabled(), sbinfo is an explicit argument > > mm/shmem.c:1799: switch (sbinfo->huge) { > shmem_getpage_gfp(), sbinfo comes from inode > > mm/shmem.c:2113: if (SHMEM_SB(sb)->huge == SHMEM_HUGE_NEVER) > shmem_get_unmapped_area(), sb comes from file > > mm/shmem.c:3531: if (sbinfo->huge) > mm/shmem.c:3532: seq_printf(seq, ",huge=%s", shmem_format_huge(sbinfo->huge)); > ->show_options() > mm/shmem.c:3880: switch (sbinfo->huge) { > shmem_huge_enabled(), sbinfo comes from an inode > > And the only caller of is_huge_enabled() is shmem_getattr(), with sbinfo > picked from inode. > > So is there any reason why the hugepage policy can't be per-file, with > the current being overridable default?