Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933756AbcJQO4A (ORCPT ); Mon, 17 Oct 2016 10:56:00 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36796 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933287AbcJQOzp (ORCPT ); Mon, 17 Oct 2016 10:55:45 -0400 Date: Mon, 17 Oct 2016 17:55:40 +0300 From: "Kirill A. Shutemov" To: Michal Hocko Cc: "Kirill A. Shutemov" , Hugh Dickins , Andrea Arcangeli , Andrew Morton , Andi Kleen , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] shmem: avoid huge pages for small files Message-ID: <20161017145539.GA26930@node.shutemov.name> References: <20161017121809.189039-1-kirill.shutemov@linux.intel.com> <20161017123021.rlyz44dsf4l4xnve@black.fi.intel.com> <20161017141245.GC27459@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161017141245.GC27459@dhcp22.suse.cz> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1837 Lines: 51 On Mon, Oct 17, 2016 at 04:12:46PM +0200, Michal Hocko wrote: > On Mon 17-10-16 15:30:21, Kirill A. Shutemov wrote: > [...] > > >From fd0b01b9797ddf2bef308c506c42d3dd50f11793 Mon Sep 17 00:00:00 2001 > > From: "Kirill A. Shutemov" > > Date: Mon, 17 Oct 2016 14:44:47 +0300 > > Subject: [PATCH] shmem: avoid huge pages for small files > > > > Huge pages are detrimental for small file: they causes noticible > > overhead on both allocation performance and memory footprint. > > > > This patch aimed to address this issue by avoiding huge pages until file > > grown to specified size. This would cover most of the cases where huge > > pages causes regressions in performance. > > > > By default the minimal file size to allocate huge pages is equal to size > > of huge page. > > ok > > > We add two handle to specify minimal file size for huge pages: > > > > - mount option 'huge_min_size'; > > > > - sysfs file /sys/kernel/mm/transparent_hugepage/shmem_min_size for > > in-kernel tmpfs mountpoint; > > Could you explain who might like to change the minimum value (other than > disable the feautre for the mount point) and for what reason? Depending on how well CPU microarchitecture deals with huge pages, you might need to set it higher in order to balance out overhead with benefit of huge pages. In other case, if it's known in advance that specific mount would be populated with large files, you might want to set it to zero to get huge pages allocated from the beginning. > > @@ -238,6 +238,12 @@ values: > > - "force": > > Force the huge option on for all - very useful for testing; > > > > +Tehre's limit on minimal file size before kenrel starts allocate huge > > +pages for it. By default it's size of huge page. > > Smoe tyopse Wlil fxi! -- Kirill A. Shutemov