Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1156582imm; Wed, 23 May 2018 11:09:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr73YIQtkQFgXluWocOoRgHbBdw50YyyAbZKpkSE7tWMeDL2z5Bctq794craUD9+33jtrgp X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr3912781plk.96.1527098972476; Wed, 23 May 2018 11:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527098972; cv=none; d=google.com; s=arc-20160816; b=QiIbdv5ECPUqlLVqQaHuqX4C/J8vaTxTUTCDRHCqgKmkDb5HnIFruEeJhhZVzBGjSV ItAmtBcjWETmnYk576hABUrnqhx59XOSTzgEzYPAazwXz72G/LweXCbTr/b9i4VwEoJ0 D+PtUO1HZBAkMVuSuJc8L7qkI4N0ytAe8REH1ge10nP/awynOFutL+50hqiidqo8bem8 yGMsBf2EhVoQrfTYljEdKNN+i1wHYzF5mX7Xsq0yvV6fVaIjROPMGOA8gw9LoI5BP9MR JO7uOCvf1V8VO/FGxh5eXrdYnRTdReJaNzEptXDG9TnP3kLqM5KYi3DLNmIQEqtECVw1 IMlg== 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:arc-authentication-results; bh=/CoOtjiFns3KeoDHX9rJh50ezMT/lcNcBzN4JGNYQ7s=; b=dqtZJsEN38+bh8Z1K0PdLxTr3jZiR3emLfFuUHB0qTA1hKynk8IiRvetmvRCQv4IJx ubxFHo1a3BTJf8iStv3cIfOqV8h7DIrfqpwJuViZBB0OwWAtw9RFfvnZ7WhOtSh+bA4B NlyrUnjMda7SXpM+tzXwiCI++GGz+hPvQz+2ntXsVXJU+g5421+wU1LM6HvTV3Rk+JsS dXTXgHq14jXRq/+jnaT0nudlatGcMqJuJ8Rz4d/n8wm8m56H0PNzmaH5/WRsra8aNzAT aV2xSnS6iK3AR+HBlNpm+ARqUB57iPbszflTR2tFaKGCpkj8Y6MH+XiiQWqSdRHv/Ja8 z5kg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n59-v6si19050727plb.198.2018.05.23.11.09.17; Wed, 23 May 2018 11:09:32 -0700 (PDT) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754821AbeEWSIE (ORCPT + 99 others); Wed, 23 May 2018 14:08:04 -0400 Received: from mga17.intel.com ([192.55.52.151]:21631 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbeEWSIB (ORCPT ); Wed, 23 May 2018 14:08:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 May 2018 11:08:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,433,1520924400"; d="scan'208";a="44195171" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.24.14.198]) ([10.24.14.198]) by orsmga006.jf.intel.com with ESMTP; 23 May 2018 11:07:59 -0700 Subject: Re: [PATCH v2 3/4] mm: add find_alloc_contig_pages() interface To: Vlastimil Babka , Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Michal Hocko , Christopher Lameter , Guy Shattah , Anshuman Khandual , Michal Nazarewicz , David Nellans , Laura Abbott , Pavel Machek , Dave Hansen , Andrew Morton References: <20180503232935.22539-1-mike.kravetz@oracle.com> <20180503232935.22539-4-mike.kravetz@oracle.com> <57dfd52c-22a5-5546-f8f3-848f21710cc1@oracle.com> <01793788-1870-858e-2061-a0e6ef3a3171@suse.cz> From: Reinette Chatre Message-ID: <0db4cd65-8b03-fea5-0a30-512f10241d54@intel.com> Date: Wed, 23 May 2018 11:07:59 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <01793788-1870-858e-2061-a0e6ef3a3171@suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vlastimil, On 5/23/2018 4:18 AM, Vlastimil Babka wrote: > On 05/22/2018 06:41 PM, Reinette Chatre wrote: >> On 5/21/2018 4:48 PM, Mike Kravetz wrote: >>> I'm guessing that most (?all?) allocations will be order based. The use >>> cases I am aware of (hugetlbfs, Intel Cache Pseudo-Locking, RDMA) are all >>> order based. However, as commented in previous version taking arbitrary >>> nr_pages makes interface more future proof. >>> >> >> I noticed this Cache Pseudo-Locking statement and would like to clarify. >> I have not been following this thread in detail so I would like to >> apologize first if my comments are out of context. >> >> Currently the Cache Pseudo-Locking allocations are order based because I >> assumed it was required by the allocator. The contiguous regions needed >> by Cache Pseudo-Locking will not always be order based - instead it is >> based on the granularity of the cache allocation. One example is a >> platform with 55MB L3 cache that can be divided into 20 equal portions. >> To support Cache Pseudo-Locking on this platform we need to be able to >> allocate contiguous regions at increments of 2816KB (the size of each >> portion). In support of this example platform regions needed would thus >> be 2816KB, 5632KB, 8448KB, etc. > > Will there be any alignment requirements for these allocations e.g. for > minimizing conflict misses? Two views on the usage of the allocated memory are: On the user space side, the kernel memory is mapped to userspace (using remap_pfn_range()) and thus need to be page aligned. On the kernel side the memory is loaded into the cache and it is here where the requirement originates for it to be contiguous. The memory being contiguous reduces the likelihood of physical addresses from the allocated memory mapping to the same cache line and thus cause cache evictions of memory we are trying to load into the cache. I hope I answered your question, if not, please let me know which parts I missed and I will try again. Reinette