Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751399AbdDAD3p (ORCPT ); Fri, 31 Mar 2017 23:29:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:2845 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdDAD3o (ORCPT ); Fri, 31 Mar 2017 23:29:44 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,255,1486454400"; d="scan'208";a="81617144" From: "Huang\, Ying" To: Johannes Weiner Cc: "Huang\, Ying" , Andrew Morton , , , Hugh Dickins , Shaohua Li , Minchan Kim , Rik van Riel Subject: Re: [PATCH -mm -v7 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 References: <20170328053209.25876-1-ying.huang@intel.com> <20170328053209.25876-2-ying.huang@intel.com> <20170329165522.GA31821@cmpxchg.org> <87o9wjtwvv.fsf@yhuang-dev.intel.com> <20170331145617.GB6408@cmpxchg.org> Date: Sat, 01 Apr 2017 11:29:41 +0800 In-Reply-To: <20170331145617.GB6408@cmpxchg.org> (Johannes Weiner's message of "Fri, 31 Mar 2017 10:56:17 -0400") Message-ID: <87pogwreje.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1983 Lines: 65 Johannes Weiner writes: > On Thu, Mar 30, 2017 at 08:45:56AM +0800, Huang, Ying wrote: >> Johannes Weiner writes: >> >> > On Tue, Mar 28, 2017 at 01:32:01PM +0800, Huang, Ying wrote: >> >> @@ -499,6 +499,19 @@ config FRONTSWAP >> >> >> >> If unsure, say Y to enable frontswap. >> >> >> >> +config ARCH_USES_THP_SWAP_CLUSTER >> >> + bool >> >> + default n >> > >> > This is fine. >> > >> >> +config THP_SWAP_CLUSTER >> >> + bool >> >> + depends on SWAP && TRANSPARENT_HUGEPAGE && ARCH_USES_THP_SWAP_CLUSTER >> >> + default y >> >> + help >> >> + Use one swap cluster to hold the contents of the THP >> >> + (Transparent Huge Page) swapped out. The size of the swap >> >> + cluster will be same as that of THP. >> > >> > But this is a super weird thing to ask the user. How would they know >> > what to say, if we don't know? I don't think this should be a config >> > knob at all. Merge the two config items into a simple >> >> The user will not see this, because there is no string after "bool" to >> let user to select it. The help here is for document only, so that >> architecture developers could know what this is for. > > Oh, I missed that. My bad! > >> > config THP_SWAP_CLUSTER >> > bool >> > default n >> > >> > and let the archs with reasonable THP sizes select it. >> >> This will have same effect as the original solution except the document >> is removed. > > Then I still don't understand why we need two config symbols. Can't > archs select the documented THP_SWAP_CLUSTER directly? > > The #ifdef in swapfile.c could check THP && THP_SWAP_CLUSTER. > > Am I missing something? I use two config symbols just to save some typing, instead of #ifdef CONFIG_THP_SWAP_CLUSTER it will be, #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_THP_SWAP_CLUSTER) or #if defined(CONFIG_SWAP) && defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_THP_SWAP_CLUSTER) Best Regards, Huang, Ying