Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbbDNSF6 (ORCPT ); Tue, 14 Apr 2015 14:05:58 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:36448 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbbDNSFt (ORCPT ); Tue, 14 Apr 2015 14:05:49 -0400 Date: Tue, 14 Apr 2015 14:05:46 -0400 (EDT) Message-Id: <20150414.140546.1390992213156919928.davem@davemloft.net> To: honli@redhat.com Cc: eli@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures From: David Miller In-Reply-To: <1428916918-24404-1-git-send-email-honli@redhat.com> References: <1428916918-24404-1-git-send-email-honli@redhat.com> X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 14 Apr 2015 11:05:49 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1664 Lines: 39 From: Honggang Li Date: Mon, 13 Apr 2015 17:21:58 +0800 > If CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for x86 systems and physical > memory is more than 4GB, dma_map_page may return a valid memory > address which greater than 0xffffffff. As a result, the mlx5 device page > allocator RB tree will be initialized with valid addresses greater than > 0xfffffff. > > However, (addr & PAGE_MASK) set the high four bytes to zeros. So, it's > impossible for the function, free_4k, to release the pages whose > addresses greater than 4GB. Memory leaks. And mlx5_ib module can't > release the pages when user try to remove the module, as a result, > system hang. > > [root@rdma05 root]# dmesg | grep addr | head > addr = 3fe384000 > addr & PAGE_MASK = fe384000 > [root@rdma05 root]# rmmod mlx5_ib <---- hang on > > ---------------------- cosnole log ----------------- > mlx5_ib 0000:04:00.0: irq 138 for MSI/MSI-X > alloc irq_desc for 139 on node -1 > alloc kstat_irqs on node -1 > mlx5_ib 0000:04:00.0: irq 139 for MSI/MSI-X > 0000:04:00.0:free_4k:221:(pid 1519): page not found > 0000:04:00.0:free_4k:221:(pid 1519): page not found > 0000:04:00.0:free_4k:221:(pid 1519): page not found > 0000:04:00.0:free_4k:221:(pid 1519): page not found > ---------------------- cosnole log ----------------- > > Signed-off-by: Honggang Li Please someone at Mellanox review this. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/