From patchwork Wed May 7 13:28:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 29765 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE0F8202E4 for ; Wed, 7 May 2014 13:29:46 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id ij19sf3078957vcb.5 for ; Wed, 07 May 2014 06:29:46 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=rA/XUDov8sFfjx9++miEP1nmIBKMax5x9KLsnTSPr1M=; b=mYBQbovSC3+g2LafG0iwF/Htk8l6UXQIIF1LM6ctFoyVkuqya0c5afQN6liSbD6haZ wsAynuPSJE87/XnKr5Yl5OZyPskUUOIb75/jZ1k8aaLEusyg3yVDyFimg41pmSLHoAY3 R7sZLnvJbEtbwpWUXdcI2R/CQQohaH5UiOEe0sxsERJgD8zOALVpdVQxRb8TmPiOgDlj +gI3yl0SiDn5rtDu/RDOUy/h70SaRS62SCqAHLthKmZup0VNGJx/5m6g6eoqKYpeJZ+4 MsJCEJ/+F1M64GYBFCysmJB2/vK+DeEQhB7WUo3q4wA4umkhxHSNT1anvpWKYpOguvai zXtg== X-Gm-Message-State: ALoCoQnxbYhaeZLjtfsQu4L/jYAzz5kUC1vFXdZZ76JoXNqDouk6epsZMQ5kG/xq+L2ZsKP5THWf X-Received: by 10.58.155.3 with SMTP id vs3mr4496799veb.16.1399469386501; Wed, 07 May 2014 06:29:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.17.19 with SMTP id 19ls2017763qgc.69.gmail; Wed, 07 May 2014 06:29:46 -0700 (PDT) X-Received: by 10.220.99.5 with SMTP id s5mr229307vcn.76.1399469386409; Wed, 07 May 2014 06:29:46 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id oh5si2909832vcb.32.2014.05.07.06.29.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 May 2014 06:29:46 -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.175; Received: by mail-vc0-f175.google.com with SMTP id lh4so1251205vcb.34 for ; Wed, 07 May 2014 06:29:46 -0700 (PDT) X-Received: by 10.58.179.115 with SMTP id df19mr1534206vec.41.1399469386335; Wed, 07 May 2014 06:29:46 -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 ib8csp309148vcb; Wed, 7 May 2014 06:29:46 -0700 (PDT) X-Received: by 10.60.16.103 with SMTP id f7mr45976284oed.8.1399469383997; Wed, 07 May 2014 06:29:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ef1si1899383pbc.300.2014.05.07.06.29.43; Wed, 07 May 2014 06:29:43 -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 S934049AbaEGN32 (ORCPT + 27 others); Wed, 7 May 2014 09:29:28 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:51393 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933025AbaEGN3X (ORCPT ); Wed, 7 May 2014 09:29:23 -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 s47DT8f3013405; Wed, 7 May 2014 14:29:08 +0100 From: Catalin Marinas To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , Sasha Levin , Li Zefan Subject: [PATCH] mm: Postpone the disabling of kmemleak early logging Date: Wed, 7 May 2014 14:28:35 +0100 Message-Id: <1399469315-29239-1-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.7.12.3 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: , Commit 8910ae896c8c (kmemleak: change some global variables to int), in addition to the atomic -> int conversion, moved the kmemleak_early_log disabling 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 restores the original logic with kmemleak_early_log disabling when kmemleak is fully functional. Fixes: 8910ae896c8c (kmemleak: change some global variables to int) Signed-off-by: Catalin Marinas Cc: Andrew Morton Cc: Sasha Levin Cc: Li Zefan --- mm/kmemleak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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..33599ba0cd8d 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1809,10 +1809,9 @@ 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_early_log = 0; kmemleak_disable(); return; } @@ -1830,6 +1829,7 @@ void __init kmemleak_init(void) /* the kernel is still in UP mode, so disabling the IRQs is enough */ local_irq_save(flags); + kmemleak_early_log = 0; if (kmemleak_error) { local_irq_restore(flags); return;