Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763505AbdLSOdB (ORCPT ); Tue, 19 Dec 2017 09:33:01 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:41165 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763488AbdLSOc7 (ORCPT ); Tue, 19 Dec 2017 09:32:59 -0500 X-Google-Smtp-Source: ACJfBou4arJrr7JQduguyJOQ3cQtgigpnHxn2YH1B63YkQZzaKJo5WhxXgZdgFEqt9QYAd7JLEzRNg== From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: konrad.wilk@oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set. Date: Tue, 19 Dec 2017 15:32:55 +0100 Message-Id: <20171219143255.2262-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 908 Lines: 32 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 --- 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