From patchwork Fri May 2 13:41:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 29547 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46F79203F3 for ; Fri, 2 May 2014 13:43:29 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id i57sf16807043yha.10 for ; Fri, 02 May 2014 06:43:28 -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=3I789ZOyle/05iEAxnCl72NOkURiwNHfSSfqca1rFDs=; b=h6ikH8drZ2Gm5JE2m8S8UlWEaVsAFl8kPQteaW6gGD12FQ5xqwlGxjevM32fWeV+H+ N44r1/0gqLD1sUbLKUKNGKNKEbPt+cGffX+NL8p383sEamnXy9LnYEq3CFyIcgnBFZfs Xcak+kLLZntYxiE6LpCHgmXi/Efr90fUM5DKv4BTXZVf6Xh8isNY/gLNWpG5AqBqkKgx mitpG17nYEwFSKzaxP4GBUUO63M2r6G5eKq/7RFrPSCeIiw4jDOtEEXX+ES1b3vjJwW4 iGz75sr8iDOFU2xoqfjVf3mTEerJkRXShskId6UlqGBFAIhPG1PxUBAJ949oOooo3kXZ bIHQ== X-Gm-Message-State: ALoCoQkLfM8/wfO4wFPnyfdf5UG96a7Wc7OZvVmCr3gtqKcsT+T0iCiFrKUhy/+11rsCUzPB2aJS X-Received: by 10.58.7.134 with SMTP id j6mr9093707vea.29.1399038208960; Fri, 02 May 2014 06:43:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.145 with SMTP id h17ls1531504qgd.31.gmail; Fri, 02 May 2014 06:43:28 -0700 (PDT) X-Received: by 10.58.49.10 with SMTP id q10mr13465326ven.5.1399038208789; Fri, 02 May 2014 06:43:28 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id e9si6714942vct.34.2014.05.02.06.43.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 06:43:28 -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.128.172; Received: by mail-ve0-f172.google.com with SMTP id jy13so5452609veb.3 for ; Fri, 02 May 2014 06:43:28 -0700 (PDT) X-Received: by 10.58.116.175 with SMTP id jx15mr7520835veb.9.1399038208715; Fri, 02 May 2014 06:43:28 -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 ib8csp103910vcb; Fri, 2 May 2014 06:43:28 -0700 (PDT) X-Received: by 10.66.141.109 with SMTP id rn13mr35071236pab.117.1399038207835; Fri, 02 May 2014 06:43:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb6si24266654pab.67.2014.05.02.06.43.27; Fri, 02 May 2014 06:43:27 -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 S1752577AbaEBNnR (ORCPT + 28 others); Fri, 2 May 2014 09:43:17 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:52188 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751995AbaEBNlt (ORCPT ); Fri, 2 May 2014 09:41:49 -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 s42Dfg2k030889; Fri, 2 May 2014 14:41:43 +0100 From: Catalin Marinas To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton Subject: [PATCH 4/6] mm: Update the kmemleak stack trace for mempool allocations Date: Fri, 2 May 2014 14:41:08 +0100 Message-Id: <1399038070-1540-5-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: , When mempool_alloc() returns an existing pool object, kmemleak_alloc() is no longer called and the stack trace corresponds to the original object allocation. This patch updates the kmemleak allocation stack trace for such objects to make it more useful for debugging. Signed-off-by: Catalin Marinas Cc: Andrew Morton --- mm/mempool.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/mm/mempool.c b/mm/mempool.c index 905434f18c97..e7c4be024f1a 100644 --- a/mm/mempool.c +++ b/mm/mempool.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -220,6 +221,11 @@ repeat_alloc: spin_unlock_irqrestore(&pool->lock, flags); /* paired with rmb in mempool_free(), read comment there */ smp_wmb(); + /* + * Update the allocation stack trace as this is more useful + * for debugging. + */ + kmemleak_update_trace(element); return element; }