Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1133127imm; Mon, 9 Jul 2018 18:10:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdp7pME/QQ/rC2+ql0hu23y2C0AiiMVQr06osUowH6lXKXX3mqXwgZTVjVtESTrYONbmUKy X-Received: by 2002:a63:1015:: with SMTP id f21-v6mr19908848pgl.354.1531185037339; Mon, 09 Jul 2018 18:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531185037; cv=none; d=google.com; s=arc-20160816; b=gYP/afYkcva+BMCR6IspZEkY/eot/J20ODtDivyu2jKX7awX7UwMj0XQUo7UZ+9ugS tlQiyFGvFTvy5zR7aykqGKEJuvFq4lSe8Ic/Z5rcTrb/e+Bf4mZsOQzpw/3RHlBal3lM rY2XD6i/kHBcf9VtDG2LUNKo9SVg3sjGtpu8fr6mddPJYA93FhKjl5XGIfUWRR960xSX fqtZ3pZ6YSulhB/YiNcnDOjqxFyATG+uDe6gSXL6szMtHLOv096JEMUpU7x31jbz4L1T o5Tn3JsSnF3BEMCIU4wjlj4RHXBm4B6OM+FG5g9Fxgqw5ISUN3sVkHPgWsy2SzLzipNr 26hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=dM/RbSFi9wWDTSZ6EWnYvVDslNHUhGg5RxXIMauul+U=; b=RsGqgbeYXOhpW57ERzPOv0FncPDp3c461JBE7W71Z+dSIijMoeSwAXTVM9hkQihfWe 39kYJ7F39Pl/+MDeB8QfrzB0ubsNrAa6BXmxOqYSyeyt71mHXrpshnGjRU5N6DneJZN3 I0Duv4h6e0/4wHDPNB9IMG70upboC/YNvWbv0X9XRgfN98LNFqS3rmJRqvvRwSyAUOew XKGz61Fmr1+SyJctc4vzpC4AmEArLYSuQjjMKmfHltsfo5i/y51NAIn9x4w7bLVvB3dI vQlzBIj+01vAo6nncH/mC1+mb6SKDKUmCdzaIZc4tx82Aufj6Ph2uV/DDBRcqWKa+ACf AsNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m62-v6si16646935pfb.127.2018.07.09.18.10.22; Mon, 09 Jul 2018 18:10:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933379AbeGJBJL (ORCPT + 99 others); Mon, 9 Jul 2018 21:09:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:24917 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933129AbeGJBJH (ORCPT ); Mon, 9 Jul 2018 21:09:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 18:09:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,332,1526367600"; d="scan'208";a="214679233" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.13.118]) by orsmga004.jf.intel.com with ESMTP; 09 Jul 2018 18:08:43 -0700 From: "Huang\, Ying" To: Dave Hansen Cc: Andrew Morton , , , "Kirill A. Shutemov" , Andrea Arcangeli , Michal Hocko , Johannes Weiner , "Shaohua Li" , Hugh Dickins , Minchan Kim , Rik van Riel , Naoya Horiguchi , Zi Yan , Daniel Jordan Subject: Re: [PATCH -mm -v4 01/21] mm, THP, swap: Enable PMD swap operations for CONFIG_THP_SWAP References: <20180622035151.6676-1-ying.huang@intel.com> <20180622035151.6676-2-ying.huang@intel.com> <11735e2e-781f-492f-7a1a-71b91e0876dc@linux.intel.com> Date: Tue, 10 Jul 2018 09:08:42 +0800 In-Reply-To: <11735e2e-781f-492f-7a1a-71b91e0876dc@linux.intel.com> (Dave Hansen's message of "Mon, 9 Jul 2018 08:59:20 -0700") Message-ID: <871scbkicl.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dave Hansen writes: > On 06/21/2018 08:51 PM, Huang, Ying wrote: >> From: Huang Ying >> >> Previously, the PMD swap operations are only enabled for >> CONFIG_ARCH_ENABLE_THP_MIGRATION. Because they are only used by the >> THP migration support. We will support PMD swap mapping to the huge >> swap cluster and swapin the THP as a whole. That will be enabled via >> CONFIG_THP_SWAP and needs these PMD swap operations. So enable the >> PMD swap operations for CONFIG_THP_SWAP too. > > This commit message kinda skirts around the real reasons for this patch. > Shouldn't we just say something like: > > Currently, "swap entries" in the page tables are used for a > number of things outside of actual swap, like page migration. > We support THP/PMD "swap entries" for page migration currently > and the functions behind this are tied to page migration's > config option (CONFIG_ARCH_ENABLE_THP_MIGRATION). > > But, we also need them for THP swap. > ... > > It would also be nice to explain a bit why you are moving code around. This looks much better than my original words. Thanks for help! > Would this look any better if we made a Kconfig option: > > config HAVE_THP_SWAP_ENTRIES > def_bool n > # "Swap entries" in the page tables are used > # both for migration and actual swap. > depends on THP_SWAP || ARCH_ENABLE_THP_MIGRATION > > You logically talked about this need for PMD swap operations in your > commit message, so I think it makes sense to codify that in a single > place where it can be coherently explained. Because both you and Dan thinks it's better to add new Kconfig option, I will do that. Best Regards, Huang, Ying