Received: by 10.223.185.116 with SMTP id b49csp911831wrg; Fri, 16 Feb 2018 09:08:19 -0800 (PST) X-Google-Smtp-Source: AH8x227gB3M1xX/qIVwRPuGXKUjYegxjNKqt+4QfuyASaTNSn62OvKWzIWK990NVifdUmp5MNz1v X-Received: by 10.98.102.89 with SMTP id a86mr6741650pfc.121.1518800899528; Fri, 16 Feb 2018 09:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518800899; cv=none; d=google.com; s=arc-20160816; b=0BbHNw0TJYT/4fBrgSSNHOx79Z5vUmghvYzaBAQeYd4HIURqU9Qt5P7OUJFk/urnC3 Xb4J+Ytgq3njMBfQ30nqyX/ruXS36OfNt7XIn+hO2g6SJDQ9F2w72FYQPwZEuEH7pXAK PUJlG45DfhOYmjNBUP10Re1TN8POYfP3F/PaFE1eCzwmPQ9JATpAILmJfjLsGQZqRlZM AhTCGVNr0xdka1WpwSraF7uTfyS6QIbaIC4tCDkJti5CZ0eDT6rVvuAhwK/D/YKib4HS ZLq97i8pz/zH9to6y8ANHi3KdzUCEIlQVLufaa7RcGgEO4jQDtePrQCA3frQ6TVHIG1m G4zQ== 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 :arc-authentication-results; bh=6uHnueISclsknPQHcrddd/rHEfQJgU26Pjxi4OGv0QA=; b=jBDNAeS8vi9UE1cmE6KzyHCq6u07wDDNEToVEHKiVLVAqnEnXoFH8akJFSfTdKjLNa KNvGgcsmgFALosjVZdGQANWk+yIba3/jIaseoz9IQHkLqRX//s/+yXIOXPu0P0lIvOcB ZDvfB50LIG1qWcxH0m+HQrh8QU/0AmJzzVD66oDALCivbUpJFo9YB6XSWh2SzeQs+dlj zjiQ6MIAb2S3lHWuc3qLSMrS0t6ulLSdMgPQA0Gl1UrOqKJt4uNsJxw0vOZiNDYPriGL YzgoZBUp4zP85F7kx1XZC6KXeqeHJA/LCSOFgYl+92TqVKVkN9Iaa2zCGxA2CruhztqI UZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=s0OAtKcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si1546892pgt.729.2018.02.16.09.08.02; Fri, 16 Feb 2018 09:08:19 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=s0OAtKcd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1167310AbeBOVKb (ORCPT + 99 others); Thu, 15 Feb 2018 16:10:31 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47122 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbeBOVK3 (ORCPT ); Thu, 15 Feb 2018 16:10:29 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1FL7KPW128239; Thu, 15 Feb 2018 21:10:06 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-2017-10-26; bh=6uHnueISclsknPQHcrddd/rHEfQJgU26Pjxi4OGv0QA=; b=s0OAtKcdRLoRj2AWNwjXuw445aJgrSR7xClY3XNaysYig0GHce00n62maXZLkf6OGk13 8jTpCQs8zETyEKj1MKe5ALjD3vEiqSYwM70THFwfm7THh+uSw2dY6CRot+a476ixTaZ1 SGBV7Ykr7YESgNmD1Bhai5bOTNYBbAYhonN+GvwUFvGD0ZnC72USn9FFxwLTLKIOMqy7 wlb6zS5da1ryjwWNZz7vXSPXr/LL+AvGw+MCdlww/0x3Nrf0/o3GYUJgalEcAViyGxjM uQWjW8cwS86w0UUdMz+0W2ZhZDAS2y+LDZqHOLUDeKNnm531RO06V/XGVr6cWpP06Nyk ow== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2g5g990grq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 21:10:06 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1FLA5uE014062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Feb 2018 21:10:05 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1FLA38S011711; Thu, 15 Feb 2018 21:10:04 GMT Received: from [192.168.1.164] (/98.246.252.205) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Feb 2018 13:10:03 -0800 Subject: Re: [RFC PATCH V2 00/22] Intel(R) Resource Director Technology Cache Pseudo-Locking enabling To: Reinette Chatre , tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: gavin.hindman@intel.com, vikas.shivappa@linux.intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Michal Hocko , Vlastimil Babka References: <29d1be82-9fc8-ecde-a5ee-4eafc92e39f1@intel.com> From: Mike Kravetz Message-ID: <66661860-cb12-1f03-9e89-267d285c52c2@oracle.com> Date: Thu, 15 Feb 2018 13:10:02 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8806 signatures=668672 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=9 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802150254 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/15/2018 12:39 PM, Reinette Chatre wrote: > On 2/14/2018 10:31 AM, Reinette Chatre wrote: >> On 2/14/2018 10:12 AM, Mike Kravetz wrote: >>> On 02/13/2018 07:46 AM, Reinette Chatre wrote: >>>> Adding MM maintainers to v2 to share the new MM change (patch 21/22) that >>>> enables large contiguous regions that was created to support large Cache >>>> Pseudo-Locked regions (patch 22/22). This week MM team received another >>>> proposal to support large contiguous allocations ("[RFC PATCH 0/3] >>>> Interface for higher order contiguous allocations" at >>>> http://lkml.kernel.org/r/20180212222056.9735-1-mike.kravetz@oracle.com). >>>> I have not yet tested with this new proposal but it does seem appropriate >>>> and I should be able to rework patch 22 from this series on top of that if >>>> it is accepted instead of what I have in patch 21 of this series. >>>> >>> >>> Well, I certainly would prefer the adoption and use of a more general >>> purpose interface rather than exposing alloc_gigantic_page(). >>> >>> Both the interface I suggested and alloc_gigantic_page end up calling >>> alloc_contig_range(). I have not looked at your entire patch series, but >>> do be aware that in its present form alloc_contig_range will run into >>> issues if called by two threads simultaneously for the same page range. >>> Calling alloc_gigantic_page without some form of synchronization will >>> expose this issue. Currently this is handled by hugetlb_lock for all >>> users of alloc_gigantic_page. If you simply expose alloc_gigantic_page >>> without any type of synchronization, you may run into issues. The first >>> patch in my RFC "mm: make start_isolate_page_range() fail if already >>> isolated" should handle this situation IF we decide to expose >>> alloc_gigantic_page (which I do not suggest). >> >> My work depends on the ability to create large contiguous regions, >> creating these large regions is not the goal in itself. Certainly I >> would want to use the most appropriate mechanism and I would gladly >> modify my work to do so. >> >> I do not insist on using alloc_gigantic_page(). Now that I am aware of >> your RFC I started the process to convert to the new >> find_alloc_contig_pages(). I did not do so earlier because it was not >> available when I prepared this work for submission. I plan to respond to >> your RFC when my testing is complete but please give me a few days to do >> so. Could you please also cc me if you do send out any new versions? > > Testing with the new find_alloc_contig_pages() introduced in > "[RFC PATCH 0/3] Interface for higher order contiguous allocations" at > http://lkml.kernel.org/r/20180212222056.9735-1-mike.kravetz@oracle.com > was successful. If this new interface is merged then Cache > Pseudo-Locking can easily be ported to use that instead of what I have > in patch 21/22 (exposing alloc_gigantic_page()) with the following > change to patch 22/22: > Nice. Thank you for converting and testing with this interface. -- Mike Kravetz > > diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c > b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c > index 99918943a98a..b5e4ae379352 100644 > --- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c > +++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c > @@ -228,9 +228,10 @@ static int contig_mem_alloc(struct > pseudo_lock_region *plr) > } > > if (plr->size > KMALLOC_MAX_SIZE) { > - plr->kmem = alloc_gigantic_page(cpu_to_node(plr->cpu), > - get_order(plr->size), > - GFP_KERNEL | __GFP_ZERO); > + plr->kmem = find_alloc_contig_pages(get_order(plr->size), > + GFP_KERNEL | __GFP_ZERO, > + cpu_to_node(plr->cpu), > + NULL); > if (!plr->kmem) { > rdt_last_cmd_puts("unable to allocate gigantic > page\n"); > return -ENOMEM; > @@ -255,7 +256,7 @@ static int contig_mem_alloc(struct > pseudo_lock_region *plr) > static void contig_mem_free(struct pseudo_lock_region *plr) > { > if (plr->size > KMALLOC_MAX_SIZE) > - free_gigantic_page(plr->kmem, get_order(plr->size)); > + free_contig_pages(plr->kmem, 1 << get_order(plr->size)); > else > kfree(page_to_virt(plr->kmem)); > } > > > It does seem as though there will be a new API for large contiguous > allocations, eliminating the need for patch 21 of this series. How large > contiguous regions are allocated are independent of Cache Pseudo-Locking > though and the patch series as submitted still stands. I can include the > above snippet in a new version of the series but I am not sure if it is > preferred at this time. Please do let me know, I'd be happy to. > > Reinette > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org >