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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS 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 76492C43334 for ; Thu, 6 Sep 2018 13:24:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 315002075B for ; Thu, 6 Sep 2018 13:24:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 315002075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729402AbeIFR7h (ORCPT ); Thu, 6 Sep 2018 13:59:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43962 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727708AbeIFR7h (ORCPT ); Thu, 6 Sep 2018 13:59:37 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w86DES1X034502 for ; Thu, 6 Sep 2018 09:24:05 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mb40qk7ea-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Sep 2018 09:24:05 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Sep 2018 07:24:04 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Sep 2018 07:24:01 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w86DO0Tk20185246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Sep 2018 06:24:00 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2F6FF7805F; Thu, 6 Sep 2018 07:24:00 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 888047805C; Thu, 6 Sep 2018 07:23:57 -0600 (MDT) Received: from [9.102.0.183] (unknown [9.102.0.183]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 6 Sep 2018 07:23:57 -0600 (MDT) Subject: Re: [RFC PATCH V2 2/4] mm: Add get_user_pages_cma_migrate To: Michal Hocko Cc: akpm@linux-foundation.org, Alexey Kardashevskiy , mpe@ellerman.id.au, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20180906054342.25094-1-aneesh.kumar@linux.ibm.com> <20180906054342.25094-2-aneesh.kumar@linux.ibm.com> <20180906124504.GW14951@dhcp22.suse.cz> From: "Aneesh Kumar K.V" Date: Thu, 6 Sep 2018 18:53:55 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180906124504.GW14951@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18090613-8235-0000-0000-00000DF9D585 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009676; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01084380; UDB=6.00559687; IPR=6.00864379; MB=3.00023143; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-06 13:24:03 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090613-8236-0000-0000-0000428BBAC4 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-06_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=890 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809060135 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/06/2018 06:15 PM, Michal Hocko wrote: > On Thu 06-09-18 11:13:40, Aneesh Kumar K.V wrote: >> This helper does a get_user_pages_fast and if it find pages in the CMA area >> it will try to migrate them before taking page reference. This makes sure that >> we don't keep non-movable pages (due to page reference count) in the CMA area. >> Not able to move pages out of CMA area result in CMA allocation failures. > > Again, there is no user so it is hard to guess the intention completely. > There is no documentation to describe the expected context and > assumptions about locking etc. > patch 4 is the user for the new helper. I will add the documentation update. > As noted in the previous email. You should better describe why you are > bypassing hugetlb pools. I assume that the reason is to guarantee a > forward progress because those might be sitting in the CMA pools > already, right? > The reason for that is explained in the code + struct hstate *h = page_hstate(page); + /* + * We don't want to dequeue from the pool because pool pages will + * mostly be from the CMA region. + */ + return alloc_migrate_huge_page(h, gfp_mask, nid, NULL); -aneesh