From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752464AbbJEIod (ORCPT ); Mon, 5 Oct 2015 04:44:33 -0400 Received: from smtp207.stejtech.net ([213.136.34.157]:52567 "EHLO smtp207-outgoing.stejtech.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbbJEIob (ORCPT ); Mon, 5 Oct 2015 04:44:31 -0400 X-Greylist: delayed 531 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Oct 2015 04:44:31 EDT X-Spam-STAY-ID: v=2.0 cv=dY8CLAre c=1 sm=0 a=uTPAfcG8vWn8BZzD3w/9vw==:17 a=oxFPtraXAAAA:8 a=15M3M-b32KoA:10 a=5lJygRwiOn0A:10 a=gnhhylgdBXk5vhn_iQMA:9 a=QEXdDO2ut3YA:10 a=CB2qr2aZVW1h592tse8A:9 a=tEqR39YdctkA:10 To: CC: From: Christian Melki Subject: SWIOTLB on 32-bit PAE Message-ID: <5612356B.7070301@t2data.com> Date: Mon, 5 Oct 2015 10:31:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090002020808020100010808" X-Originating-IP: [212.247.174.226] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --------------090002020808020100010808 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Hi, I discovered that my 32-bit PAE 4.2.0 kernel (no IOMMU code) would hang when writing to my USB disk. The kernel spews million(-ish messages per sec) to syslog, effectively "hanging" userspace with my kernel. Oct 2 14:33:06 voodoochild kernel: [ 223.287447] nommu_map_sg: overflow 25dcac000+1024 of device mask ffffffff Oct 2 14:33:06 voodoochild kernel: [ 223.287448] nommu_map_sg: overflow 25dcac000+1024 of device mask ffffffff Oct 2 14:33:06 voodoochild kernel: [ 223.287449] nommu_map_sg: overflow 25dcac000+1024 of device mask ffffffff ... etc ... In my kernel config I noticed that SWIOTLB was not on. It seems SWIOTLB is provided for 64-bit and 32-bit with IOMMU/AGPGART code. But if I compiled the kernel with PAE and no IOMMU and no other GART code, I would not get SWIOTLB. I'd like to think that SWIOTLB should be selected for 32-bit PAE as default. I have attached a oneliner patch which does that. The patch works for me. The issue where the kernel more or less runs endless bashing of (nommu_?)map_sg when failing is another problem I guess. I expected the kernel/drivers to have some more graceful handling, but I know to little about this area to have a proper opinion. Regards, Christian --------------090002020808020100010808 Content-Type: text/x-patch; name="swiotlb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="swiotlb.patch" diff -urN linux-4.2.orig/arch/x86/Kconfig linux-4.2/arch/x86/Kconfig --- linux-4.2.orig/arch/x86/Kconfig 2015-10-05 08:56:58.933313678 +0200 +++ linux-4.2/arch/x86/Kconfig 2015-10-05 09:00:00.916306025 +0200 @@ -1282,6 +1282,7 @@ config X86_PAE bool "PAE (Physical Address Extension) Support" depends on X86_32 && !HIGHMEM4G + select SWIOTLB ---help--- PAE is required for NX support, and furthermore enables larger swapspace support for non-overcommit purposes. It --------------090002020808020100010808--