linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <aarcange@redhat.com>
To: Cong Wang <amwang@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>, Rik van Riel <riel@redhat.com>,
	Mel Gorman <mgorman@suse.de>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Johannes Weiner <jweiner@redhat.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never
Date: Wed, 22 Jun 2011 16:22:39 +0200	[thread overview]
Message-ID: <20110622142239.GV20843@redhat.com> (raw)
In-Reply-To: <4E0159E9.10800@redhat.com>

On Wed, Jun 22, 2011 at 10:56:41AM +0800, Cong Wang wrote:
> 于 2011年06月21日 22:43, Andrea Arcangeli 写道:
> > On Tue, Jun 21, 2011 at 12:08:14PM +0800, Cong Wang wrote:
> >> The thing is that we can save ~10K by adding 3 lines of code as this
> >> patch showed, where else in kernel can you save 10K by 3 lines of code?
> >> (except some kfree() cases, of course) So, again, why not have it? ;)
> >
> > Because you could save it with a more complicated patch that doesn't
> > cripple down functionality.
> 
> 
> Why do you prefer "more complicated" things to simple ones? ;-)

If they offer more features yes. Allowing to tune the size of the has
will also allow to increase it, not only to decrease it. It's also not
significantly more complicated.

> I realized this patch changed the original behavior of "=never",
> thus proposed a new "=0" parameter.
> 
> But to be honest, "=never" should be renamed to "=disable".

So in turn you're saying "=always" should be renamed to "=enabled". So
your preference would be enabled=enabled and enabled=disabled and
enabled=madvise? I think the current wording is nicer and breaking
kabi just for this sounds bad.

> Not only such things, the more serious thing is that you are
> enforcing a policy to users, as long as I enable THP in Kconfig,
> I have no way to disable it.
> 
> Why are you so sure that every user who has no chance to change
> .config likes THP?
> 
> And, what can I do if I want to prevent any process from having
> a chance to enable THP? Because as long as THP exists in /sys,
> any process has the right privilege can change it.

You must be root to have the privilege to enable it, root also has the
privilege to enable THP by writing in /dev/mem or by loading a kernel
module to do it.

I already told you how to save hundred kbytes of ram from you kernel
setting dhash_entries=1 and ihash_entries=1 and how to achieve the ~8k
ram saving in THP and KSM without crippling functionality with a patch
that is more complex than your three liner, but not much more complex,
and that it will _improve_ (not cripple down) functionality.

I'm also not interested into making the 512M param configurable. If
you want to add a "=force" parameter ok but I doubt you will ever gain
anything significant on a system with 512M of ram where each process
will likely be smaller than 512M and 100M would get used by the
anti-frag logic (reducing it to 400m).

I suggest just cleaning up the printk and if you want you can add a
__setup("thp_mm_slots_hash_heads=", set_thp_mm_slots_hash_heads) but
no other change needed.

  reply	other threads:[~2011-06-22 14:22 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 16:34 [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never Amerigo Wang
2011-06-20 16:34 ` [PATCH 2/3] mm: make the threshold of enabling THP configurable Amerigo Wang
2011-06-20 16:59   ` Dave Hansen
2011-06-20 17:23     ` Cong Wang
2011-06-20 16:59   ` Mel Gorman
2011-06-20 17:16     ` Cong Wang
2011-06-21  9:36       ` Mel Gorman
2011-06-22  2:41         ` Cong Wang
2011-06-22  9:16           ` Mel Gorman
2011-06-22 10:46             ` Cong Wang
2011-06-22 11:15               ` Mel Gorman
2011-06-22 12:34                 ` Cong Wang
2011-06-20 16:34 ` [PATCH 3/3] mm: print information when THP is disabled automatically Amerigo Wang
2011-06-20 16:54   ` Andrea Arcangeli
2011-06-20 17:25     ` Cong Wang
2011-06-20 17:01   ` Mel Gorman
2011-06-20 17:26     ` Cong Wang
2011-06-20 19:37       ` Andrea Arcangeli
2011-06-21  9:40       ` Mel Gorman
2011-06-20 16:50 ` [PATCH 1/3] mm: completely disable THP by transparent_hugepage=never Andrea Arcangeli
2011-06-20 16:55   ` Rik van Riel
2011-06-20 17:01   ` Cong Wang
2011-06-20 19:43     ` Andrea Arcangeli
2011-06-21  3:15       ` Cong Wang
2011-06-20 16:58 ` Mel Gorman
2011-06-20 17:07   ` Cong Wang
2011-06-20 17:10     ` Rik van Riel
2011-06-20 17:19       ` Cong Wang
2011-06-20 17:28         ` Rik van Riel
2011-06-20 17:34           ` Cong Wang
2011-06-20 17:50             ` Rik van Riel
2011-06-20 18:25               ` Vivek Goyal
2011-06-20 19:21                 ` Andrea Arcangeli
2011-06-21  4:08                   ` Cong Wang
2011-06-21 14:43                     ` Andrea Arcangeli
2011-06-22  2:56                       ` Cong Wang
2011-06-22 14:22                         ` Andrea Arcangeli [this message]
2011-06-21 20:01                     ` Rik van Riel
2011-06-21  3:28               ` Cong Wang
2011-06-20 17:58             ` Eric B Munson
2011-06-21  3:36               ` Cong Wang
2011-06-20 17:59           ` Vivek Goyal

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=20110622142239.GV20843@redhat.com \
    --to=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=amwang@redhat.com \
    --cc=jweiner@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=riel@redhat.com \
    --cc=vgoyal@redhat.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;
as well as URLs for NNTP newsgroup(s).