From patchwork Fri May 2 13:41:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 29543 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D49A2203F3 for ; Fri, 2 May 2014 13:42:20 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf15841773veb.5 for ; Fri, 02 May 2014 06:42:20 -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=UXQT6Jb7Luf9RNPZtUpssxwDUO4R6tVwvfpKsTeZr64=; b=iITK6RWZwjfT/Jqo6fkxy0vUowKZe+FbLkltZyf/D6OcL94TbxJVO3YMfbuGXU06f2 8weu5kJDYpqwT7oM/3zJ8Z3KZW6aQHLK8o8+eYw1gIJFMuBBD1FuIEs1COtdRvKMtknr MwVlVIk0Gqta81Q6dmhClQIryRYbJ9S2W3FX6y6tnDw47v2gmYjEnAchNWt3tVIlgvxw qmuoUpEoepIrdC5iUDrPbRZLo1KS9jxudKCoiBNl54Cqls7PvPgvRM9xo7/mZ26EVD2y 5dyRUTROPM3BfZS4vfSsmjomho11OsmYTZ6TMEZVd1YSZRad/dJzClL+uqW5JCH6s9J2 3mbQ== X-Gm-Message-State: ALoCoQmzxTcKniybIdo75a6Y3Q2iRVjKhN03fm/y3gMSEs9D2U/BVuzVdZTFyOFOIBvdyhNP8V1V X-Received: by 10.236.127.35 with SMTP id c23mr7326714yhi.51.1399038140597; Fri, 02 May 2014 06:42:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.34 with SMTP id d31ls250528qgf.49.gmail; Fri, 02 May 2014 06:42:20 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr196480vcj.48.1399038140490; Fri, 02 May 2014 06:42:20 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id ck5si6699636vdd.109.2014.05.02.06.42.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 06:42:20 -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.180; Received: by mail-ve0-f180.google.com with SMTP id db12so1875180veb.25 for ; Fri, 02 May 2014 06:42:20 -0700 (PDT) X-Received: by 10.53.1.69 with SMTP id be5mr11251676vdd.27.1399038140414; Fri, 02 May 2014 06:42:20 -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 ib8csp103829vcb; Fri, 2 May 2014 06:42:19 -0700 (PDT) X-Received: by 10.66.250.202 with SMTP id ze10mr34967339pac.153.1399038139452; Fri, 02 May 2014 06:42:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xx4si22837834pac.396.2014.05.02.06.42.18; Fri, 02 May 2014 06:42:18 -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 S1752278AbaEBNlv (ORCPT + 28 others); Fri, 2 May 2014 09:41:51 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:52186 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751983AbaEBNlt (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 s42Dfg2m030889; 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 6/6] mm: Postpone the disabling of kmemleak early logging Date: Fri, 2 May 2014 14:41:10 +0100 Message-Id: <1399038070-1540-7-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: , Currently, kmemleak_early_log is disabled at the beginning of the kmemleak_init() function, before the full kmemleak tracing is actually enabled. In this small window, kmem_cache_create() is called by kmemleak which triggers additional memory allocation that are not traced. This patch moves the kmemleak_early_log disabling further down and at the same time with full kmemleak enabling. Signed-off-by: Catalin Marinas Cc: Andrew Morton --- mm/kmemleak.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 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/kmemleak.c b/mm/kmemleak.c index 61a64ed2fbef..0cd6aabd45a0 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1809,8 +1809,6 @@ void __init kmemleak_init(void) int i; unsigned long flags; - kmemleak_early_log = 0; - #ifdef CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF if (!kmemleak_skip_disable) { kmemleak_disable(); @@ -1833,8 +1831,9 @@ void __init kmemleak_init(void) if (kmemleak_error) { local_irq_restore(flags); return; - } else - kmemleak_enabled = 1; + } + kmemleak_early_log = 0; + kmemleak_enabled = 1; local_irq_restore(flags); /*