Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965343AbdLSOwg (ORCPT ); Tue, 19 Dec 2017 09:52:36 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:60842 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbdLSOwf (ORCPT ); Tue, 19 Dec 2017 09:52:35 -0500 Date: Tue, 19 Dec 2017 09:52:31 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <20171219143255.2262-1-christian.koenig@amd.com> References: <20171219143255.2262-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Subject: Re: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set. To: =?ISO-8859-1?Q?Christian_K=F6nig?= , linux-kernel@vger.kernel.org From: Konrad Rzeszutek Wilk Message-ID: X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8749 signatures=668649 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1712190214 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vBJEqen9012871 Content-Length: 1096 Lines: 40 On December 19, 2017 9:32:55 AM EST, "Christian König" 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 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; > }