From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qe0-f51.google.com (mail-qe0-f51.google.com [209.85.128.51]) by kanga.kvack.org (Postfix) with ESMTP id 3FA016B0035 for ; Thu, 2 Jan 2014 22:33:10 -0500 (EST) Received: by mail-qe0-f51.google.com with SMTP id 1so14879807qee.38 for ; Thu, 02 Jan 2014 19:33:09 -0800 (PST) Received: from e9.ny.us.ibm.com (e9.ny.us.ibm.com. [32.97.182.139]) by mx.google.com with ESMTPS id j9si25070748qcf.59.2014.01.02.19.33.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Jan 2014 19:33:09 -0800 (PST) Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 2 Jan 2014 22:33:08 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 432D238C8027 for ; Thu, 2 Jan 2014 22:33:04 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by b01cxnp23034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s033X6WJ66846964 for ; Fri, 3 Jan 2014 03:33:06 GMT Received: from d01av02.pok.ibm.com (localhost [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s033X6hv020280 for ; Thu, 2 Jan 2014 22:33:06 -0500 Date: Fri, 3 Jan 2014 11:33:03 +0800 From: Han Pingtian Subject: Re: [RFC] mm: show message when updating min_free_kbytes in thp Message-ID: <20140103033303.GB4106@localhost.localdomain> References: <20140101002935.GA15683@localhost.localdomain> <52C5AA61.8060701@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52C5AA61.8060701@intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org Cc: Dave Hansen , Andrea Arcangeli , Mel Gorman , Andrew Morton , linux-mm@kvack.org, Michal Hocko On Thu, Jan 02, 2014 at 10:05:21AM -0800, Dave Hansen wrote: > On 12/31/2013 04:29 PM, Han Pingtian wrote: > > min_free_kbytes may be updated during thp's initialization. Sometimes, > > this will change the value being set by user. Showing message will > > clarify this confusion. > ... > > - if (recommended_min > min_free_kbytes) > > + if (recommended_min > min_free_kbytes) { > > min_free_kbytes = recommended_min; > > + pr_info("min_free_kbytes is updated to %d by enabling transparent hugepage.\n", > > + min_free_kbytes); > > + } > > "updated" doesn't tell us much. It's also kinda nasty that if we enable > then disable THP, we end up with an elevated min_free_kbytes. Maybe we > should at least put something in that tells the user how to get back > where they were if they care: > > "raising min_free_kbytes from %d to %d to help transparent hugepage > allocations" > Thanks. I have updated it according to your suggestion. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985AbaACDdN (ORCPT ); Thu, 2 Jan 2014 22:33:13 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:34340 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751521AbaACDdL (ORCPT ); Thu, 2 Jan 2014 22:33:11 -0500 Date: Fri, 3 Jan 2014 11:33:03 +0800 From: Han Pingtian To: linux-kernel@vger.kernel.org Cc: Dave Hansen , Andrea Arcangeli , Mel Gorman , Andrew Morton , linux-mm@kvack.org, Michal Hocko Subject: Re: [RFC] mm: show message when updating min_free_kbytes in thp Message-ID: <20140103033303.GB4106@localhost.localdomain> Mail-Followup-To: linux-kernel@vger.kernel.org, Dave Hansen , Andrea Arcangeli , Mel Gorman , Andrew Morton , linux-mm@kvack.org, Michal Hocko References: <20140101002935.GA15683@localhost.localdomain> <52C5AA61.8060701@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52C5AA61.8060701@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14010303-0320-0000-0000-00000218A44E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2014 at 10:05:21AM -0800, Dave Hansen wrote: > On 12/31/2013 04:29 PM, Han Pingtian wrote: > > min_free_kbytes may be updated during thp's initialization. Sometimes, > > this will change the value being set by user. Showing message will > > clarify this confusion. > ... > > - if (recommended_min > min_free_kbytes) > > + if (recommended_min > min_free_kbytes) { > > min_free_kbytes = recommended_min; > > + pr_info("min_free_kbytes is updated to %d by enabling transparent hugepage.\n", > > + min_free_kbytes); > > + } > > "updated" doesn't tell us much. It's also kinda nasty that if we enable > then disable THP, we end up with an elevated min_free_kbytes. Maybe we > should at least put something in that tells the user how to get back > where they were if they care: > > "raising min_free_kbytes from %d to %d to help transparent hugepage > allocations" > Thanks. I have updated it according to your suggestion. >>From f9902b16ff0c326349e72eca9facef2c98f8595d Mon Sep 17 00:00:00 2001 From: Han Pingtian Date: Fri, 3 Jan 2014 11:10:49 +0800 Subject: [PATCH] mm: show message when raising min_free_kbytes in THP min_free_kbytes may be raised during THP's initialization. Sometimes, this will change the value being set by user. Showing message will clarify this confusion. Showing the old value of min_free_kbytes according to Dave Hansen's suggestion. This will give user the chance to restore old value of min_free_kbytes. Signed-off-by: Han Pingtian --- mm/huge_memory.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 7de1bf8..1f0356d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -130,8 +130,11 @@ static int set_recommended_min_free_kbytes(void) (unsigned long) nr_free_buffer_pages() / 20); recommended_min <<= (PAGE_SHIFT-10); - if (recommended_min > min_free_kbytes) + if (recommended_min > min_free_kbytes) { + pr_info("raising min_free_kbytes from %d to %d to help transparent hugepage allocations\n", + min_free_kbytes, recommended_min); min_free_kbytes = recommended_min; + } setup_per_zone_wmarks(); return 0; } -- 1.7.7.6