linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Yang Shi <yang.s@alibaba-inc.com>,
	kirill.shutemov@linux.intel.com, hughd@google.com,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm: shm: round up tmpfs size to huge page size when huge=always
Date: Mon, 9 Oct 2017 08:48:11 +0200	[thread overview]
Message-ID: <20171009064811.lmotdeuewfbznhzq@dhcp22.suse.cz> (raw)
In-Reply-To: <20171008125651.3mxiayuvuqi2hiku@node.shutemov.name>

On Sun 08-10-17 15:56:51, Kirill A. Shutemov wrote:
> On Sat, Oct 07, 2017 at 04:22:10AM +0800, Yang Shi wrote:
> > When passing "huge=always" option for mounting tmpfs, THP is supposed to
> > be allocated all the time when it can fit, but when the available space is
> > smaller than the size of THP (2MB on x86), shmem fault handler still tries
> > to allocate huge page every time, then fallback to regular 4K page
> > allocation, i.e.:
> > 
> > 	# mount -t tmpfs -o huge,size=3000k tmpfs /tmp
> > 	# dd if=/dev/zero of=/tmp/test bs=1k count=2048
> > 	# dd if=/dev/zero of=/tmp/test1 bs=1k count=2048
> > 
> > The last dd command will handle 952 times page fault handler, then exit
> > with -ENOSPC.
> > 
> > Rounding up tmpfs size to THP size in order to use THP with "always"
> > more efficiently. And, it will not wast too much memory (just allocate
> > 511 extra pages in worst case).
> 
> Hm. I don't think it's good idea to silently increase size of fs.

Agreed!

> Maybe better just refuse to mount with huge=always for too small fs?

We cannot we simply have the remaining page !THP? What is the actual
problem?
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2017-10-09  6:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 20:22 Yang Shi
2017-10-08 12:56 ` Kirill A. Shutemov
2017-10-08 19:51   ` Yang Shi
2017-10-09  4:03     ` Kirill A. Shutemov
2017-10-09  6:48   ` Michal Hocko [this message]
2017-10-09 16:43     ` Yang Shi
2017-10-09 17:26       ` Michal Hocko
2017-10-09 17:54         ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171009064811.lmotdeuewfbznhzq@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yang.s@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox