Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736548 > unrolled thread
| Started by | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| First post | 2017-09-21 13:20 +0200 |
| Last post | 2017-09-22 17:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 2/4] numa, iommu/io-pgtable-arm: Use NUMA aware memory allocation for smmu translation tables Robin Murphy <robin.murphy@arm.com> - 2017-09-21 13:20 +0200
Re: [PATCH 2/4] numa, iommu/io-pgtable-arm: Use NUMA aware memory allocation for smmu translation tables Ganapatrao Kulkarni <gklkml16@gmail.com> - 2017-09-22 17:40 +0200
| From | Robin Murphy <robin.murphy@arm.com> |
|---|---|
| Date | 2017-09-21 13:20 +0200 |
| Subject | Re: [PATCH 2/4] numa, iommu/io-pgtable-arm: Use NUMA aware memory allocation for smmu translation tables |
| Message-ID | <us7Gq-gp-25@gated-at.bofh.it> |
On 21/09/17 09:59, Ganapatrao Kulkarni wrote:
> function __arm_lpae_alloc_pages is used to allcoated memory for smmu
> translation tables. updating function to allocate memory/pages
> from the proximity domain of SMMU device.
AFAICS, data->pgd_size always works out to a power-of-two number of
pages, so I'm not sure why we've ever needed alloc_pages_exact() here. I
think we could simply use alloc_pages_node() and drop patch #1.
Robin.
> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
> ---
> drivers/iommu/io-pgtable-arm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
> index e8018a3..f6d01f6 100644
> --- a/drivers/iommu/io-pgtable-arm.c
> +++ b/drivers/iommu/io-pgtable-arm.c
> @@ -215,8 +215,10 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
> {
> struct device *dev = cfg->iommu_dev;
> dma_addr_t dma;
> - void *pages = alloc_pages_exact(size, gfp | __GFP_ZERO);
> + void *pages;
>
> + pages = alloc_pages_exact_nid(dev_to_node(dev), size,
> + gfp | __GFP_ZERO);
> if (!pages)
> return NULL;
>
>
[toc] | [next] | [standalone]
| From | Ganapatrao Kulkarni <gklkml16@gmail.com> |
|---|---|
| Date | 2017-09-22 17:40 +0200 |
| Message-ID | <usydA-7Kc-19@gated-at.bofh.it> |
| In reply to | #1736548 |
On Thu, Sep 21, 2017 at 4:41 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 21/09/17 09:59, Ganapatrao Kulkarni wrote:
>> function __arm_lpae_alloc_pages is used to allcoated memory for smmu
>> translation tables. updating function to allocate memory/pages
>> from the proximity domain of SMMU device.
>
> AFAICS, data->pgd_size always works out to a power-of-two number of
> pages, so I'm not sure why we've ever needed alloc_pages_exact() here. I
> think we could simply use alloc_pages_node() and drop patch #1.
thanks Robin, i think we can replace with alloc_pages_node.
i will change as suggested in next version.
>
> Robin.
>
>> Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
>> ---
>> drivers/iommu/io-pgtable-arm.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
>> index e8018a3..f6d01f6 100644
>> --- a/drivers/iommu/io-pgtable-arm.c
>> +++ b/drivers/iommu/io-pgtable-arm.c
>> @@ -215,8 +215,10 @@ static void *__arm_lpae_alloc_pages(size_t size, gfp_t gfp,
>> {
>> struct device *dev = cfg->iommu_dev;
>> dma_addr_t dma;
>> - void *pages = alloc_pages_exact(size, gfp | __GFP_ZERO);
>> + void *pages;
>>
>> + pages = alloc_pages_exact_nid(dev_to_node(dev), size,
>> + gfp | __GFP_ZERO);
>> if (!pages)
>> return NULL;
>>
>>
>
thanks
Ganapat
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web