Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp204691imm; Tue, 3 Jul 2018 17:14:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcF3cRPcpTvKWYSlGtOJkueohpnjzyWZsasD7snQm6wFOueg873Y6c+h7JDESkGt7/vpTfA X-Received: by 2002:a62:2044:: with SMTP id g65-v6mr31641713pfg.40.1530663263326; Tue, 03 Jul 2018 17:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530663263; cv=none; d=google.com; s=arc-20160816; b=0zl7PKeQ8vDgnbbhisutxkXqymq3dOap+yfaLQbdpc5zy/z7tdoJNnmtiZjxkdUkQO r6gZQEOO9JetoKNKeZn7L2sCEM+7mRpLSdliNWfJDMfAWKJajbxJDJqup6naZcuRwZdi wt4FWnAgE2hzClhHSjgVisrOCcscYHjxxY+ZWj8yU6bbECw+HbJQ5quVJqVB/oBtg6fV 4B1tpWqpqK/J4gaFd7HGTk3F4E83ZI8dj6kUPVIBIxqClHJW2jH+D9DMOUEACz81kKaD vnqVT948fP/syijUxEH+wTsmv4uSC9tMFok4LbQnEewJdZPqf9vdCczOEzamBs722VMG 0tag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=BzukadhQ04gKih7+1oXr4gyvyNAPAJV4svfMhMses1I=; b=MOAIKsSXXhXU5Dq93HCecqvL3QcV0V6U1ZknZk3BUIRrKYx8BJbpqa3sO9LuoOTy1b tfBCfSI7PrujAQIcs+mO6gU9DUTfWLwHyTVcxK6SrHR7QYRIpJRLG+vq5N+J46enxiCz 6s79I2uEenVJ84GnoU19rk12fiN9SwT/w2yTZEfveAV+Pw8QvICAgTz0CqoIYf95KtGD kR+oz6pc5FcCLjqO8/OzXxQ8/u4jYMtDUySINndmcux+CTv4xMliVoyzL7dO9Hfxl1WW iKAB/Rm3/5XrMyIITJ8YLTj7YHdrhhRikgd4muJi9d7LDHujuCucEmoN5Uu0xOZa6QH3 81Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=c1xtV7H7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15-v6si2284688pfk.146.2018.07.03.17.14.08; Tue, 03 Jul 2018 17:14:23 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=c1xtV7H7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbeGDANO (ORCPT + 99 others); Tue, 3 Jul 2018 20:13:14 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:57538 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752606AbeGDANN (ORCPT ); Tue, 3 Jul 2018 20:13:13 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6409YTn050565; Wed, 4 Jul 2018 00:12:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=BzukadhQ04gKih7+1oXr4gyvyNAPAJV4svfMhMses1I=; b=c1xtV7H75wCMioenvvjCM51ZaHSBKz33KIqYRuo7i9ibX+u7eG57u8ehoKMU94Hflmav CPoTMFPDZzItgxrUSI3ZJ41J/6RLyzOzI8+iq7kyFCOMZMGWRYdrKXS+RPYJMo+9SiO2 +MWurMP5NBAtbBHswqVRlao+QIsBuV2lLjEF6JDefHMAx0olDvCwqvZvbATb8ghfMven tLeJRKBgS4BPuMKRMdKwevtuwM0t/IKLucAe85EuLemCGgHfolOgQ8S8sKkWZcplBPXs /DFPGVRLFwTrSFRsqnhOcFDCqIqwOZVTNs8IK0Ghjwtu9unVkZEIP/bWbi/NVV9ESLfW DQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2k0dnjgudc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Jul 2018 00:12:38 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w640CakU030323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Jul 2018 00:12:37 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w640CXEv028002; Wed, 4 Jul 2018 00:12:33 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Jul 2018 17:12:33 -0700 Date: Tue, 3 Jul 2018 17:12:35 -0700 From: Daniel Jordan To: "Huang, Ying" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "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 Message-ID: <20180704001235.w7xexi3jp6ostas5@ca-dmjordan1.us.oracle.com> References: <20180622035151.6676-1-ying.huang@intel.com> <20180622035151.6676-9-ying.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180622035151.6676-9-ying.huang@intel.com> User-Agent: NeoMutt/20180323-268-5a959c X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8943 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807040000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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");