From patchwork Fri May 2 13:41:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 29545 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D63BA203F3 for ; Fri, 2 May 2014 13:42:39 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id gq1sf23967872obb.6 for ; Fri, 02 May 2014 06:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=pL1R0g1WxhGe/yak9AO6xykmoP3i/3idOmsYsQ8Wx/c=; b=MSbX0sAQkpaPZoJvuJ9JM0jvbKOPJ7zBdYEIe14B7fcxlLVy978yOsudJCrVGTP26e rQxfvbbNthhGUUYGRoDdFouTC0YXgpewU+YxnT5YGKpF7jWo9BmzoWSz24lw8LAkFh2y Su+OIqfDOl1ws+68ETetlDM8acEE4crhAGH/1vbHcthfRYt1MGDY3jDZENDovH+tpHNI FTkOiLzMeWl9XWfmQGj+XGosRwHAOmAYo0/NbDghvCPXeEASYq47ToIbYL294+oQCssW wFQCQxkzREZWEyDiMsN4YxtT0NgyqvmMnkgSx9mrenfYKUez6kZN0GEYjcUlusK9s2hT 8+ww== X-Gm-Message-State: ALoCoQmbjL3ys7E1OuolUxOX7J7evekcBJVr3lao3jY9I0SbX3ggpUX5+ed14NMD0T0HpS0kY/UR X-Received: by 10.182.105.1 with SMTP id gi1mr8867841obb.6.1399038159438; Fri, 02 May 2014 06:42:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls1442673qgd.59.gmail; Fri, 02 May 2014 06:42:39 -0700 (PDT) X-Received: by 10.220.116.136 with SMTP id m8mr188393vcq.77.1399038159218; Fri, 02 May 2014 06:42:39 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id ub5si3855416vcb.147.2014.05.02.06.42.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 06:42:39 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id hu19so5325266vcb.23 for ; Fri, 02 May 2014 06:42:39 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr13761922vcb.16.1399038159036; Fri, 02 May 2014 06:42:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp103850vcb; Fri, 2 May 2014 06:42:38 -0700 (PDT) X-Received: by 10.66.253.170 with SMTP id ab10mr35016399pad.53.1399038158152; Fri, 02 May 2014 06:42:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id lk4si17720888pab.268.2014.05.02.06.42.37; Fri, 02 May 2014 06:42:37 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752398AbaEBNmI (ORCPT + 28 others); Fri, 2 May 2014 09:42:08 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:52225 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752270AbaEBNlw (ORCPT ); Fri, 2 May 2014 09:41:52 -0400 Received: from e102109-lin.cambridge.arm.com (e102109-lin.cambridge.arm.com [10.1.203.182]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s42Dfg2j030889; Fri, 2 May 2014 14:41:43 +0100 From: Catalin Marinas To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Johannes Weiner Subject: [PATCH 3/6] lib: Update the kmemleak stack trace for radix tree allocations Date: Fri, 2 May 2014 14:41:07 +0100 Message-Id: <1399038070-1540-4-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.7.12.3 In-Reply-To: <1399038070-1540-1-git-send-email-catalin.marinas@arm.com> References: <1399038070-1540-1-git-send-email-catalin.marinas@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: catalin.marinas@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Since radix_tree_preload() stack trace is not always useful for debugging an actual radix tree memory leak, this patch updates the kmemleak allocation stack trace in the radix_tree_node_alloc() function. Signed-off-by: Catalin Marinas Cc: Andrew Morton Cc: Johannes Weiner Acked-by: Johannes Weiner --- lib/radix-tree.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 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/ diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 9599aa72d7a0..5297f8e09096 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -200,6 +201,11 @@ radix_tree_node_alloc(struct radix_tree_root *root) rtp->nodes[rtp->nr - 1] = NULL; rtp->nr--; } + /* + * Update the allocation stack trace as this is more useful + * for debugging. + */ + kmemleak_update_trace(ret); } if (ret == NULL) ret = kmem_cache_alloc(radix_tree_node_cachep, gfp_mask);