Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp444892imu; Wed, 19 Dec 2018 22:47:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/V/4NBgUvZmqAGMjvTjE0/HPvN865aHEBvKl8MK1kJ2JCZkTSi8BwG3PGkZLf11WMldyPoG X-Received: by 2002:a63:30c8:: with SMTP id w191mr22609528pgw.120.1545288445504; Wed, 19 Dec 2018 22:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545288445; cv=none; d=google.com; s=arc-20160816; b=TQorsbdamLpVwkFEOyvEf/0mkp1QtPUIop0isG4LevyZNq3rgtXJYT7yZg+ijfH181 oKiXuf9KQXIOWFHIYNbzMEQmKGsndJnS/argczyKwKrvE6gWyZ1q0wRBndkg4D7LSEBO x+L+7ZmjEpkG8/ZtWu8eHqcaYrUVkQ58SmaQsUIHu6gswO8pN2LTG98rKC3LBPZnC88F JvXJV/FkBv1kAg1bPYWi93d7bwK1ZjUJFv1lhjYqhvXyTczeAx4KbacxJ6YipA5xxub2 +C6XmiH57PTQ9yNlFBppKkrBdAZzSUjh45Z1AOwEZ2GaAOahT50Ld4q5j+4Zh/QIalqv yyUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=Z3xR6wI4F9Wl07pfUfcOD/muVRaK4T+x9J1Gjkcc8ss=; b=gP8q7pkSu4DWOtdUTeZCRENyn/asEE7GUMujjthzSxK9MaKlgRpaxC1VkoPC7xn4QX VaaQBk85bHD2UrJEXeWTZhdB2K/xDMPXLmRdlkdwCI4+Sw9ZzZASeWgvgPYZcp1X/cCp 23wkLVP4c4MVLKiNMEyhrY+qsDB5l8tOhSU5LDuTajRDxvaHRQE1wS5oUxWNv402Ecq/ ZO9gC9e+M9yfN9OTjcA0CxQkWxP6oo2XyEPv8D4wLC6eVCwjQSJV0uh0acbZtMQJ1k4+ rAfVFgUug9OIROKiE1uC0qMSEjvDqmdExzWCN6CdOYJ/R7VlJnGy7zATW+0j0ZEVIXZb ZL0w== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si15553596pls.71.2018.12.19.22.47.10; Wed, 19 Dec 2018 22:47:25 -0800 (PST) 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729455AbeLTFWW (ORCPT + 99 others); Thu, 20 Dec 2018 00:22:22 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56032 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725550AbeLTFWV (ORCPT ); Thu, 20 Dec 2018 00:22:21 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBK5IP2c059262 for ; Thu, 20 Dec 2018 00:22:20 -0500 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pfxfxg39c-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Dec 2018 00:22:19 -0500 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Dec 2018 05:22:19 -0000 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 20 Dec 2018 05:22:16 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBK5MFoa23265486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 20 Dec 2018 05:22:15 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88D67AC05E; Thu, 20 Dec 2018 05:22:15 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6307AC059; Thu, 20 Dec 2018 05:22:10 +0000 (GMT) Received: from [9.85.68.89] (unknown [9.85.68.89]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 20 Dec 2018 05:22:10 +0000 (GMT) Subject: Re: [PATCH V5 1/3] mm: Add get_user_pages_cma_migrate To: Alexey Kardashevskiy , akpm@linux-foundation.org, Michal Hocko , mpe@ellerman.id.au, paulus@samba.org, David Gibson Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20181219034047.16305-1-aneesh.kumar@linux.ibm.com> <20181219034047.16305-2-aneesh.kumar@linux.ibm.com> From: "Aneesh Kumar K.V" Date: Thu, 20 Dec 2018 10:52:09 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18122005-0072-0000-0000-000003DCA6FA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010252; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000271; SDB=6.01134316; UDB=6.00582089; IPR=6.00914489; MB=3.00024762; MTD=3.00000008; XFM=3.00000015; UTC=2018-12-20 05:22:19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18122005-0073-0000-0000-00004A829B55 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-20_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=18 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812200044 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/20/18 9:49 AM, Alexey Kardashevskiy wrote: > > > On 19/12/2018 14: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. >> >> Signed-off-by: Aneesh Kumar K.V > ..... >> + * We did migrate all the pages, Try to get the page references again >> + * migrating any new CMA pages which we failed to isolate earlier. >> + */ >> + drain_allow = true; >> + goto get_user_again; > > > So it is possible to have pages pinned, then successfully migrated > (migrate_pages() returned 0), then pinned again, then some pages may end > up in CMA again and migrate again and nothing seems to prevent this loop > from being endless. What do I miss? > pages used as target page for migration won't be allocated from CMA region. -aneesh