Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3798219ybt; Tue, 30 Jun 2020 11:27:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzjDNj44f5PETntpWsSRJ7gfHRayn0j5dwAOmY6YCwdRPYpwRmPNhY52YuVsN76FHfACLw X-Received: by 2002:a17:906:bb0c:: with SMTP id jz12mr18816212ejb.27.1593541624412; Tue, 30 Jun 2020 11:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593541622; cv=none; d=google.com; s=arc-20160816; b=SeGwDWPBrYkf2ox8VehRuLSHYsU14oFPGzC31V+NNytoLf4l9fKD2FtJNzNvCexAEl 2qzk/W744EXqP3JiArKTfn5xdO0vHohUHdrkJ1CYsJv+0wmcMayoWok6YgkpQZPN79Ub FbAa7Cae5DmBkQDGx3py8lTydvLZcVau6sKyMQlhT3V0PtVDbzNGlBBs+xKWdUcKGLq5 ozumi/uwcEG1HkrTeJlA1ameLpMD6bB6wcnia1TaLadkGTTAR4jdLR+Ot2C8hu86ZKLq VooDUtliyCKMThGoIU2Zbl7crSkfYafHCg3Xv4F1PnRC6lg99lGZXHOdc35ozcNPzNcH U/RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ewYdjojVC93tCg3UT6Oa+SXr42PA5Lh+ZYRd+YHHiIQ=; b=MkGPY42Acq4dQ2g1qnsjmUZVtD44whjwpdW4mW1FH5Md2MBFOmZBDy5KTSyY05LgRk zfNpuvJoaX79GUrpAa+Awcj1+vLoNntQEeN7WwxTq/UlnFbd6oVXUsBKLzC/Ics3yER7 ORnlmRufZB/g7xZ5WyA0Nt6o7nJo+zBYob9/SZPgsXqU9NeFapyY7ekOa82PAREVuiHd YFL4gIhncJVcaORvASE3NAr6v4T5FfRnKT3ybqZBx9MDoHYBMtbOhlnJIZh55Hd4XhFR EcmeK4POxF5PepSNhcTm4pQEFC500ttHCT44xbd8jrgI+JVDztQ+nuzchqRcl67Q/vdj h3KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=FvP75sPJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ce9si2325328edb.70.2020.06.30.11.26.39; Tue, 30 Jun 2020 11:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=FvP75sPJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730529AbgF3Qhv (ORCPT + 99 others); Tue, 30 Jun 2020 12:37:51 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:44974 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729518AbgF3Qhu (ORCPT ); Tue, 30 Jun 2020 12:37:50 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05UGNhsQ020571; Tue, 30 Jun 2020 16:37:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=ewYdjojVC93tCg3UT6Oa+SXr42PA5Lh+ZYRd+YHHiIQ=; b=FvP75sPJ9ve43af6dy5B2vqDN6xPAR+T1R+CdFECYuEaAQM5dkU5CGshoiv3hNei0toB Ddu54VWLXbeUThq8t9+Mo1RFfKbJaAtcTLli56KZ2oqlunppKJrYkBtcA5iUGKEtcFyD xCyz7kl+y7p/ZQadLyokCVIGmCICKj5BiVl7Kfz/L+xtQMcT4UuNtATIDsr/RHkwIuOf t4dynU+mf537E/+xMK7Ua8Dx0Tb3jCDERAgpK0iwG6TgP132LGK4rg9q67+PnKDRzpir cL0QFYdZdA+jWyUUYtK0upflvnU+rmiVwJewV/22aiJgnMHTfNERnVGTGREWBP2BfXsJ Zg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 31ywrbkw78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Jun 2020 16:37:22 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05UGMqu8098168; Tue, 30 Jun 2020 16:37:21 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 31y52j5m54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 16:37:21 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 05UGbIs0019025; Tue, 30 Jun 2020 16:37:19 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 30 Jun 2020 16:37:18 +0000 Subject: Re: [PATCH v3 4/8] mm/hugetlb: make hugetlb migration callback CMA aware To: Joonsoo Kim , Michal Hocko Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Vlastimil Babka , Christoph Hellwig , Roman Gushchin , Naoya Horiguchi , Joonsoo Kim References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-5-git-send-email-iamjoonsoo.kim@lge.com> <20200625115422.GE1320@dhcp22.suse.cz> <20200626072324.GT1320@dhcp22.suse.cz> <20200629075510.GA32461@dhcp22.suse.cz> <20200630064256.GB2369@dhcp22.suse.cz> From: Mike Kravetz Message-ID: Date: Tue, 30 Jun 2020 09:37:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9667 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006300116 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9667 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 mlxlogscore=999 clxscore=1015 cotscore=-2147483648 priorityscore=1501 lowpriorityscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006300116 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/30/20 12:22 AM, Joonsoo Kim wrote: > 2020년 6월 30일 (화) 오후 3:42, Michal Hocko 님이 작성: >> >> On Tue 30-06-20 15:30:04, Joonsoo Kim wrote: >>> 2020년 6월 29일 (월) 오후 4:55, Michal Hocko 님이 작성: >> [...] >>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >>>> index 57ece74e3aae..c1595b1d36f3 100644 >>>> --- a/mm/hugetlb.c >>>> +++ b/mm/hugetlb.c >>>> @@ -1092,10 +1092,14 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, >>>> /* Movability of hugepages depends on migration support. */ >>>> static inline gfp_t htlb_alloc_mask(struct hstate *h) >>>> { >>>> + gfp_t gfp; >>>> + >>>> if (hugepage_movable_supported(h)) >>>> - return GFP_HIGHUSER_MOVABLE; >>>> + gfp = GFP_HIGHUSER_MOVABLE; >>>> else >>>> - return GFP_HIGHUSER; >>>> + gfp = GFP_HIGHUSER; >>>> + >>>> + return current_gfp_context(gfp); >>>> } >>>> >>>> static struct page *dequeue_huge_page_vma(struct hstate *h, >>>> >>>> If we even fix this general issue for other allocations and allow a >>>> better CMA exclusion then it would be implemented consistently for >>>> everybody. >>> >>> Yes, I have reviewed the memalloc_nocma_{} APIs and found the better way >>> for CMA exclusion. I will do it after this patch is finished. >>> >>>> Does this make more sense to you are we still not on the same page wrt >>>> to the actual problem? >>> >>> Yes, but we have different opinions about it. As said above, I will make >>> a patch for better CMA exclusion after this patchset. It will make >>> code consistent. >>> I'd really appreciate it if you wait until then. >> >> As I've said I would _prefer_ simplicity over "correctness" if it is only >> partial and hard to reason about from the userspace experience but this >> is not something I would _insist_ on. If Mike as a maintainer of the >> code is ok with that then I will not stand in the way. > > Okay. I was OK with Joonsoo's original patch which is why I Ack'ed it. However, my sense of simplicity and style may not be the norm as I have spent too much time with the hugetlbfs code. :) That is why I did not chime in and let Michal and Joonsoo discuss. I can see both sides of the issue. For now, I am OK to go with Joonsoo's patch as long as the issue below is considered in the the next patchset. -- Mike Kravetz >> But please note that a missing current_gfp_context inside >> htlb_alloc_mask is a subtle bug. I do not think it matters right now but >> with a growing use of scoped apis this might actually hit some day so I >> believe we want to have it in place. > > Okay. I will keep in mind and consider it when fixing CMA exclusion on the > other patchset. > > Thanks.