From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935413AbeAITWu (ORCPT + 1 other); Tue, 9 Jan 2018 14:22:50 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35150 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933847AbeAITWs (ORCPT ); Tue, 9 Jan 2018 14:22:48 -0500 X-Google-Smtp-Source: ACJfBotVZ4CpvObzR2O/mSvTngEMO4jpEwJcz+mFmWJIr+i2z4dQpYJsJe3NUAUvL6CzSIaxyqxWGg== From: Dmitry Vyukov To: catalin.marinas@arm.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dmitry Vyukov Subject: [PATCH] kmemleak: allow to coexist with fault injection Date: Tue, 9 Jan 2018 20:22:43 +0100 Message-Id: <20180109192243.19316-1-dvyukov@google.com> X-Mailer: git-send-email 2.15.1.620.gb9897f4670-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: kmemleak does one slab allocation per user allocation. So if slab fault injection is enabled to any degree, kmemleak instantly fails to allocate and turns itself off. However, it's useful to use kmemleak with fault injection to find leaks on error paths. On the other hand, checking kmemleak itself is not so useful because (1) it's a debugging tool and (2) it has a very regular allocation pattern (basically a single allocation site, so it either works or not). Turn off fault injection for kmemleak allocations. Signed-off-by: Dmitry Vyukov Cc: Catalin Marinas Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 68648b840e8e..e83987c55a08 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -126,7 +126,7 @@ /* GFP bitmask for kmemleak internal allocations */ #define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \ __GFP_NORETRY | __GFP_NOMEMALLOC | \ - __GFP_NOWARN) + __GFP_NOWARN | __GFP_NOFAIL) /* scanning area inside a memory block */ struct kmemleak_scan_area { -- 2.15.1.620.gb9897f4670-goog