TTM tries to allocate coherent memory in chunks of 2MB first to improve
TLB efficiency and falls back to allocating 4K pages if that fails.
Suppress the warning when the 2MB allocations fails since there is a
valid fall back path.
Signed-off-by: Christian König <[email protected]>
---
lib/swiotlb.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index cea19aaf303c..63a44fb29ce6 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -769,9 +769,11 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
return ret;
err_warn:
- pr_warn("swiotlb: coherent allocation failed for device %s size=%zu\n",
- dev_name(hwdev), size);
- dump_stack();
+ if (!(flags & __GFP_NOWARN)) {
+ pr_warn("swiotlb: coherent allocation failed for device %s size=%zu\n",
+ dev_name(hwdev), size);
+ dump_stack();
+ }
return NULL;
}
--
2.11.0
On December 19, 2017 9:32:55 AM EST, "Christian König" <[email protected]> wrote:
>TTM tries to allocate coherent memory in chunks of 2MB first to improve
>TLB efficiency and falls back to allocating 4K pages if that fails.
>
>Suppress the warning when the 2MB allocations fails since there is a
>valid fall back path.
>
>Signed-off-by: Christian König <[email protected]>
Is there an Reported by or such needed?
>---
> lib/swiotlb.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
>diff --git a/lib/swiotlb.c b/lib/swiotlb.c
>index cea19aaf303c..63a44fb29ce6 100644
>--- a/lib/swiotlb.c
>+++ b/lib/swiotlb.c
>@@ -769,9 +769,11 @@ swiotlb_alloc_coherent(struct device *hwdev,
>size_t size,
> return ret;
>
> err_warn:
>- pr_warn("swiotlb: coherent allocation failed for device %s
>size=%zu\n",
>- dev_name(hwdev), size);
>- dump_stack();
>+ if (!(flags & __GFP_NOWARN)) {
>+ pr_warn("swiotlb: coherent allocation failed for device %s
>size=%zu\n",
>+ dev_name(hwdev), size);
>+ dump_stack();
>+ }
Ok, let me queue it up.
>
> return NULL;
> }
Am 19.12.2017 um 15:52 schrieb Konrad Rzeszutek Wilk:
> On December 19, 2017 9:32:55 AM EST, "Christian König" <[email protected]> wrote:
>> TTM tries to allocate coherent memory in chunks of 2MB first to improve
>> TLB efficiency and falls back to allocating 4K pages if that fails.
>>
>> Suppress the warning when the 2MB allocations fails since there is a
>> valid fall back path.
>>
>> Signed-off-by: Christian König <[email protected]>
> Is there an Reported by or such needed?
Sorry my fault not to include that.
Reported-by: Mike Galbraith <[email protected]>.
>> ---
>> lib/swiotlb.c | 8 +++++---
>> 1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/swiotlb.c b/lib/swiotlb.c
>> index cea19aaf303c..63a44fb29ce6 100644
>> --- a/lib/swiotlb.c
>> +++ b/lib/swiotlb.c
>> @@ -769,9 +769,11 @@ swiotlb_alloc_coherent(struct device *hwdev,
>> size_t size,
>> return ret;
>>
>> err_warn:
>> - pr_warn("swiotlb: coherent allocation failed for device %s
>> size=%zu\n",
>> - dev_name(hwdev), size);
>> - dump_stack();
>> + if (!(flags & __GFP_NOWARN)) {
>> + pr_warn("swiotlb: coherent allocation failed for device %s
>> size=%zu\n",
>> + dev_name(hwdev), size);
>> + dump_stack();
>> + }
> Ok, let me queue it up.
Thanks,
Christian.
>> return NULL;
>> }