Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751106AbeABQOW (ORCPT + 1 other); Tue, 2 Jan 2018 11:14:22 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39833 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbeABQOU (ORCPT ); Tue, 2 Jan 2018 11:14:20 -0500 X-Google-Smtp-Source: ACJfBosvVXGH71Jm9So95MbHsHLfudkJeCqap2itkO8ftTCwxG/8TMQMrfewoLNQr4V9I5Kl/5wJEw== Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] swiotlb: suppress warning when __GFP_NOWARN is set v2 To: Chris Wilson , imirkin@alum.mit.edu, efault@gmx.de, michel@daenzer.net, konrad.wilk@oracle.com, linux-kernel@vger.kernel.org References: <20180102121358.16215-1-christian.koenig@amd.com> <151490759196.21495.9033629958966748437@mail.alporthouse.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <07fe9849-fa83-0d5c-21d5-18c15ed6596c@gmail.com> Date: Tue, 2 Jan 2018 17:14:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <151490759196.21495.9033629958966748437@mail.alporthouse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Am 02.01.2018 um 16:39 schrieb Chris Wilson: > Quoting Christian König (2018-01-02 12:13:58) >> 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. >> >> v2: suppress warnings from swiotlb_tbl_map_single as well >> >> Signed-off-by: Christian König >> Reported-by: Mike Galbraith >> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104082 >> CC: stable@vger.kernel.org >> --- >> @@ -989,7 +1002,8 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, >> if (swiotlb_force == SWIOTLB_FORCE || >> !dma_capable(hwdev, dev_addr, sg->length)) { >> phys_addr_t map = map_single(hwdev, sg_phys(sg), >> - sg->length, dir, attrs); >> + sg->length, dir, attrs, >> + true); > This keeps the warning for dma_map_sg(), so seems quite ineffective. That is the desired result, dma_map_sg() should still print the warning. We only want to disable it for swiotlb_alloc_coherent(). Regards, Christian. > >> if (map == SWIOTLB_MAP_ERROR) { >> /* Don't panic here, we expect map_sg users >> to do proper error handling. */ > And counter to the suggestion here? We don't use swiotlb_map_sg_attrs() in TTM, so that is irrelevant for my use case and I can't test any change regarding it. Regards, Christian. > -Chris