From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3102C433DF for ; Tue, 30 Jun 2020 16:37:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8708B206B6 for ; Tue, 30 Jun 2020 16:37:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="FvP75sPJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8708B206B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 20AE26B0007; Tue, 30 Jun 2020 12:37:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BCF26B0008; Tue, 30 Jun 2020 12:37:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0842C6B000E; Tue, 30 Jun 2020 12:37:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id E6A4B6B0007 for ; Tue, 30 Jun 2020 12:37:55 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 854A12DFA for ; Tue, 30 Jun 2020 16:37:55 +0000 (UTC) X-FDA: 76986434910.06.trick02_3711d8326e79 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 715431004F5AB for ; Tue, 30 Jun 2020 16:37:40 +0000 (UTC) X-HE-Tag: trick02_3711d8326e79 X-Filterd-Recvd-Size: 7230 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 30 Jun 2020 16:37:39 +0000 (UTC) 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 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 X-Rspamd-Queue-Id: 715431004F5AB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 6/30/20 12:22 AM, Joonsoo Kim wrote: > 2020=EB=85=84 6=EC=9B=94 30=EC=9D=BC (=ED=99=94) =EC=98=A4=ED=9B=84 3:4= 2, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: >> >> On Tue 30-06-20 15:30:04, Joonsoo Kim wrote: >>> 2020=EB=85=84 6=EC=9B=94 29=EC=9D=BC (=EC=9B=94) =EC=98=A4=ED=9B=84 4= :55, Michal Hocko =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1= : >> [...] >>>> 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_nodema= sk(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 =3D GFP_HIGHUSER_MOVABLE; >>>> else >>>> - return GFP_HIGHUSER; >>>> + gfp =3D 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 w= rt >>>> to the actual problem? >>> >>> Yes, but we have different opinions about it. As said above, I will m= ake >>> 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 o= nly >> partial and hard to reason about from the userspace experience but thi= s >> 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. >=20 > 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. --=20 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 b= ut >> with a growing use of scoped apis this might actually hit some day so = I >> believe we want to have it in place. >=20 > Okay. I will keep in mind and consider it when fixing CMA exclusion on = the > other patchset. >=20 > Thanks.