Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932772AbdC2BLD (ORCPT ); Tue, 28 Mar 2017 21:11:03 -0400 Received: from mga03.intel.com ([134.134.136.65]:56276 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932571AbdC2BLC (ORCPT ); Tue, 28 Mar 2017 21:11:02 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,239,1486454400"; d="scan'208";a="839498676" From: "Huang\, Ying" To: "Kirill A. Shutemov" 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> <20170328233056.zkp733h5kij7lfdb@node.shutemov.name> Date: Wed, 29 Mar 2017 09:10:58 +0800 In-Reply-To: <20170328233056.zkp733h5kij7lfdb@node.shutemov.name> (Kirill A. Shutemov's message of "Wed, 29 Mar 2017 02:30:56 +0300") Message-ID: <87y3voyjj1.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: 1158 Lines: 27 "Kirill A. Shutemov" writes: > On Tue, Mar 28, 2017 at 01:32:01PM +0800, Huang, Ying wrote: >> From: Huang Ying >> >> In this patch, the size of the swap cluster is changed to that of the >> THP (Transparent Huge Page) on x86_64 architecture (512). This is for >> the THP swap support on x86_64. Where one swap cluster will be used to >> hold the contents of each THP swapped out. And some information of the >> swapped out THP (such as compound map count) will be recorded in the >> swap_cluster_info data structure. >> >> For other architectures which want THP swap support, >> ARCH_USES_THP_SWAP_CLUSTER need to be selected in the Kconfig file for >> the architecture. > > Intreseting case could be architecture with HPAGE_PMD_NR < 256. > Can current code pack more than one THP per claster. No. Only one THP for each swap cluster is supported. But in current implementation, if HPAGE_PMD_NR < 256, the swap cluster will be < 256 too. The size of swap cluster will be exact same as HPAGE_PMD_NR. Best Regards, Huang, Ying > If not we need to have BUILG_BUG_ON() to catch attempt of such enabling.