Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752895AbbKYPPG (ORCPT ); Wed, 25 Nov 2015 10:15:06 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37361 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbbKYPPD (ORCPT ); Wed, 25 Nov 2015 10:15:03 -0500 Subject: Re: [RFC PATCH v2] iommu/amd: gray the 'irq_remap_table' object for kmemleak To: Joerg Roedel References: <564EFF6A.2050709@profitbricks.com> <564F051E.9010703@profitbricks.com> <20151125150806.GG2064@8bytes.org> Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org From: Michael Wang Message-ID: <5655D072.1000901@profitbricks.com> Date: Wed, 25 Nov 2015 16:14:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151125150806.GG2064@8bytes.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1464 Lines: 40 On 11/25/2015 04:08 PM, Joerg Roedel wrote: > On Fri, Nov 20, 2015 at 12:33:50PM +0100, Michael Wang wrote: >> The kmemleak testing on 3.18.24 show: >> >> unreferenced object 0xffff880233ff9010 (size 16): >> comm "swapper/0", pid 1, jiffies 4294937440 (age 2010.490s) >> hex dump (first 16 bytes): >> 0a 0a 00 00 20 00 00 00 00 44 fb 33 02 88 ff ff .... ....D.3.... >> backtrace: >> [] create_object+0x10d/0x2d0 >> [] kmemleak_alloc+0x5b/0xc0 >> [] kmem_cache_alloc_trace+0xb9/0x160 >> [] get_irq_table+0x151/0x380 >> >> This is caused by the 'irq_lookup_table' was allocated with >> __get_free_pages() which won't create kmemleak object, thus it's >> pointers won't be count as referencing 'irq_remap_table' in >> kmemleak scan. > > Isn't it better to allocate the kmemleak object manually instead of > ignoring all irq-table pointers? With this patch we might not notice any > real leak of irq-tables. We've considered that too, but found that the irq-tables is not dynamically alloc/free, they won't be freed once initialized, so there is no leaking for such object :-) Regards, Michael Wang > > > > Joerg > -- 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/