Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp289951imm; Tue, 3 Jul 2018 19:26:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJh97ALS0lIUjJpGijyvt+Ywp8/pBnC8KeBIRa/yf/r47s6YMouQxtWPTNc+wq4vQOn+2+ X-Received: by 2002:a17:902:bc8c:: with SMTP id bb12-v6mr199768plb.84.1530671172459; Tue, 03 Jul 2018 19:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530671172; cv=none; d=google.com; s=arc-20160816; b=Si0tJQtGEPSZhWVTA/p/pJppFxDfftfGQle4F/Dy8XkQj54yksg2B4weDWWPFiOI8q Ksdx9WWSwCAbuRUzhpSatWkv09cKs9pG6CqyplUCOLWkYV2e+xfB4t+0V3koWUJb18sU sS181ysihsR8+W0HIgKk9rk+XyvN5En8Q+pluKPEE9HvKqSVYIin/9JDaKY/PZIWb8aE D2q8Ge9wgOHqvzFdutX6T0OQZ64yff3OSbqzTA/PVf/IdsDmByBpOeyPdUCG0LAE9IWn SOF4QlOu10xL4QocNBw1zk101ksXq2oV8jski8+v+TzoU4xMmDyquI6z9TazFKcwXRYs QJHw== 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=82Z/kgq2sCo9ZGmLqldGIwTJI3R3539kxQVuIyb/zqQ=; b=VbKox+Wzj7othK/oIJmkSqCWbquIXS6LSGNS4ROgufEUBis2Mes796xhHaRoTcSyut 8dCFRIUKmgZEeXAs65H7lKcLTIvbAyZEmfwUC27sSbtYneEJ8FHy/p3OICcMV8qUG35X 7WCjQju1JvL3rZh5IOAuf8flGpdu/vN9lqM5gIG1ATlnzQE2d5pmxXPPCN6tlmpKf66s PhAxrMhh7rzF5JUG3qdpoY5M8jx0a8jJ5wLx6OfYrc0qXVYVlIDdwpzrVap5swpWX72t WutBt3Ds1MGDxAXKE0lQe4H+/vHf4Ng8D6UNS++CWbnjcH0NUJo1JI8lH72cwn130TIO lDfg== 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 y187-v6si2195482pgd.459.2018.07.03.19.25.57; Tue, 03 Jul 2018 19:26:12 -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 S933106AbeGDCZA (ORCPT + 99 others); Tue, 3 Jul 2018 22:25:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:50129 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932853AbeGDCY7 (ORCPT ); Tue, 3 Jul 2018 22:24:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2018 19:24:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,306,1526367600"; d="scan'208";a="68474445" Received: from yhuang-dev.sh.intel.com (HELO yhuang-dev) ([10.239.13.118]) by fmsmga004.fm.intel.com with ESMTP; 03 Jul 2018 19:24:46 -0700 From: "Huang\, Ying" To: Daniel Jordan Cc: Andrew Morton , , , "Kirill A. Shutemov" , Andrea Arcangeli , Michal Hocko , Johannes Weiner , Shaohua Li , Hugh Dickins , Minchan Kim , Rik van Riel , Dave Hansen , Naoya Horiguchi , Zi Yan Subject: Re: [PATCH -mm -v4 08/21] mm, THP, swap: Support to read a huge swap cluster for swapin a THP References: <20180622035151.6676-1-ying.huang@intel.com> <20180622035151.6676-9-ying.huang@intel.com> <20180704001235.w7xexi3jp6ostas5@ca-dmjordan1.us.oracle.com> Date: Wed, 04 Jul 2018 10:24:46 +0800 In-Reply-To: <20180704001235.w7xexi3jp6ostas5@ca-dmjordan1.us.oracle.com> (Daniel Jordan's message of "Tue, 3 Jul 2018 17:12:35 -0700") Message-ID: <874lhfvitt.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 Daniel Jordan writes: > On Fri, Jun 22, 2018 at 11:51:38AM +0800, Huang, Ying wrote: >> @@ -411,14 +414,32 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, > ... >> + if (thp_swap_supported() && huge_cluster) { >> + gfp_t gfp = alloc_hugepage_direct_gfpmask(vma); >> + >> + new_page = alloc_hugepage_vma(gfp, vma, >> + addr, HPAGE_PMD_ORDER); > > When allocating a huge page, we ignore the gfp_mask argument. > > That doesn't matter right now since AFAICT we're not losing any flags: gfp_mask > from existing callers of __read_swap_cache_async seems to always be a subset of > GFP_HIGHUSER_MOVABLE and alloc_hugepage_direct_gfpmask always returns a > superset of that. > > But maybe we should warn here in case we end up violating a restriction from a > future caller. Something like this?: > >> + gfp_t gfp = alloc_hugepage_direct_gfpmask(vma); > VM_WARN_ONCE((gfp | gfp_mask) != gfp, > "ignoring gfp_mask bits"); This looks good! Thanks! Will add this. Best Regards, Huang, Ying