Received: by 10.223.176.5 with SMTP id f5csp2457202wra; Thu, 1 Feb 2018 00:35:00 -0800 (PST) X-Google-Smtp-Source: AH8x227jJpEGydZM5Mnd65RsTM/tfvC2jydn9So6uaR7wolY8ehRotAECUrVjTxqXZYkTvWU2abW X-Received: by 10.101.83.195 with SMTP id z3mr28869326pgr.133.1517474100570; Thu, 01 Feb 2018 00:35:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517474100; cv=none; d=google.com; s=arc-20160816; b=ozRjkMM3iEzUzr1cHexdPxR4VUE9cZzTjOgeO+eh5LRSqZhlz1bvF0Kn/jIL1Ux9xt yj96zg7CkRWuARJ7eyPCmeKmL6T9lNCQhSyW52N/Zj3qEsd4ifNs+Ca1iwr/HQQ7xyyM DLoOmbLSj0wzz3sefOsdhoQF4rv1llonqpnsX4I0ASBF1uBiK5S604payCi8E4YT4UX5 7/jeDuQyu9WnJ7Lb1sF3SSgPjJNE90m2x4vcmtXp7pGId28AF+oGJC9W5RhTNy7m9r9v wGVIuz3gzCQ5itsWaUhEyvboO86oe9IrEclLEmS8//f7T+PzCCarKYSfPJCimTQHxhA6 9+CQ== 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 :in-reply-to:mime-version:user-agent:date:from:cc:references:to :subject:arc-authentication-results; bh=3bdxCyRGD988zy2vXnZnmj1wLqZBG+iSIvRyw5WqSYs=; b=PsfGFT1Vd7Ila8lOr48qtwdW8kR/pyio7ak/0PPq1GPj3zLvgwEANewy7ocPG87lEx W2kx13NZykDY9ubi7oJycNugOO8gYtj676N0zWQkcOcNqYWiyqiDq57LLqvmSZ1xuy7F 92lSbJ791N6IQkCm0q0lUfgIiVlgNkSDNQOL2Y243NaJLrzQDKc3IfTxB9/b9ErdxL2F 8hKPkaeMrqqcPQq5cNkNVE6tA219c1I+Ellqv5Si1W89giFVoNleLc/Tl5kkh69bOOEz xrQWiYR7DJbTBXFcsL+OpWsOnjq4SXCrIISbhymrApvnswjLrmJLuF8oaXA739aV5o2N 1Apg== 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 p3si5552193pgf.710.2018.02.01.00.34.46; Thu, 01 Feb 2018 00:35:00 -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 S1751916AbeBAIdw (ORCPT + 99 others); Thu, 1 Feb 2018 03:33:52 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49620 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbeBAIdt (ORCPT ); Thu, 1 Feb 2018 03:33:49 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w118WmQF076275 for ; Thu, 1 Feb 2018 03:33:48 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fuwka4wjp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 01 Feb 2018 03:33:48 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 1 Feb 2018 08:28:42 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 1 Feb 2018 08:28:39 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w118SdAB46530578; Thu, 1 Feb 2018 08:28:39 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 788FCAE058; Thu, 1 Feb 2018 08:20:02 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 383FBAE055; Thu, 1 Feb 2018 08:20:01 +0000 (GMT) Received: from [9.202.14.107] (unknown [9.202.14.107]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 1 Feb 2018 08:20:00 +0000 (GMT) Subject: Re: [RFC] mm/migrate: Add new migration reason MR_HUGETLB To: Michal Hocko , Andrew Morton References: <20180130030714.6790-1-khandual@linux.vnet.ibm.com> <20180130075949.GN21609@dhcp22.suse.cz> <20180131075852.GL21609@dhcp22.suse.cz> <20180131121217.4c80263d68a4ad4da7b170f0@linux-foundation.org> <20180131203242.GB21609@dhcp22.suse.cz> Cc: Anshuman Khandual , linux-mm@kvack.org, linux-kernel@vger.kernel.org From: Anshuman Khandual Date: Thu, 1 Feb 2018 13:58:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20180131203242.GB21609@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18020108-0020-0000-0000-000003F12846 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020108-0021-0000-0000-000042838F8A Message-Id: <29b6db3a-f853-b81b-0632-c1841298ab87@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-01_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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802010111 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/01/2018 02:02 AM, Michal Hocko wrote: > On Wed 31-01-18 12:12:17, Andrew Morton wrote: >> On Wed, 31 Jan 2018 08:58:52 +0100 Michal Hocko wrote: >> >>> On Wed 31-01-18 07:55:05, Anshuman Khandual wrote: >>>> On 01/30/2018 01:29 PM, Michal Hocko wrote: >>>>> On Tue 30-01-18 08:37:14, Anshuman Khandual wrote: >>>>>> alloc_contig_range() initiates compaction and eventual migration for >>>>>> the purpose of either CMA or HugeTLB allocation. At present, reason >>>>>> code remains the same MR_CMA for either of those cases. Lets add a >>>>>> new reason code which will differentiate the purpose of migration >>>>>> as HugeTLB allocation instead. >>>>> Why do we need it? >>>> >>>> The same reason why we have MR_CMA (maybe some other ones as well) at >>>> present, for reporting purpose through traces at the least. It just >>>> seemed like same reason code is being used for two different purpose >>>> of migration. >>> >>> But do we have any real user asking for this kind of information? >> >> It seems a reasonable cleanup: reusing MR_CMA for hugetlb just because >> it happens to do the right thing is a bit hacky - the two things aren't >> particularly related and a reader could be excused for feeling >> confusion. > > My bad! I thought this is a tracepoint thingy. But it seems to be only > used as a migration reason for page_owner. Now it makes more sense. > >> But the change seems incomplete: >> >>> + if (migratetype == MIGRATE_CMA) >>> + migrate_reason = MR_CMA; >>> + else >>> + migrate_reason = MR_HUGETLB; >> >> If we're going to do this cleanup then shouldn't we go all the way and >> add MIGRATE_HUGETLB? > > Yes. We can expect more users of alloc_contig_range in future. Maybe we > want to use MR_CONTIG_RANGE instead. MR_CONTIG_RANGE can be a replacement for both MR_CMA and MR_HUGETLB.