Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp35878ybl; Thu, 22 Aug 2019 19:14:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/N+akXf0D4/VpSnvw3PTox+XoNsq1K2hkFx1dTOZQOjVacIRCybE0WcAcNDVC04jvs9Yi X-Received: by 2002:a17:902:f64:: with SMTP id 91mr2011871ply.334.1566526457841; Thu, 22 Aug 2019 19:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566526457; cv=none; d=google.com; s=arc-20160816; b=EpcBy98/P3mbKmR4wJ5n9cCfux+B9MSgQIv8OouxbBWgY/CXUR7Tcv1W2rcNTWCcz8 RFypDrq1dmVfa/tfaXO2AICb+66U+FmjBjVm6yFhZqrBRImXCh2PVvJT2zoxP9QU/Jix NxUcrxLb2NJHxZJHLIdu1TYyNtbzRoDO7E8+mRvZGXLVgrnIiwYYDPbqtUc8pUy0dDRq wdKyFKMzkoiEo9jVYbOjFX0QWmUIukR6tFB5o5Ld7MFPi61ZNeMpferkYslxOqzWSdCn 3CsKXTy9RB3WLK3lH1Dakd+YLZrByW40iWIySpCXLZLsSUxhnfL/MZr3+StazwTGw6gX 4QgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kKNzeJxOu/A+zQPTIGLj1Zzje1+fkeAnJ3GQ+tPF9xI=; b=z8B9m2Hy7ZE953EhEOmLffrBXtSwMyvlpl5cd8/Oi4snL2V91qlVD11sNUCsGDs/N1 sTTw4SzSX3U0nitFNcKGr6moPZsxXx+lR8HR7XZ+SZIGwQa8cysW4EtH2femufhDo3gM kTesT24W/A8YqC7WBNsnDW/dW3eN8UHTLcw8j36CnycyPDH/e5cUESc6Y2C1VyYqTbQF 66mEnzjOr2pJySnteRhFqA79yhDOMrRJLYAu6ziMHgoQP4yKtne9KzPxIrC/7pNoG41e UyQvGFFj9Tk2i/L/2XQwvEIKbhEsJwlC/X8v+YKHnsy0cb2lWZX3apGHSRgCfrtOxOg5 7fYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vd/LB7ab"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si796044pgq.540.2019.08.22.19.14.02; Thu, 22 Aug 2019 19:14:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vd/LB7ab"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391997AbfHVR1R (ORCPT + 99 others); Thu, 22 Aug 2019 13:27:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:50226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404513AbfHVRZx (ORCPT ); Thu, 22 Aug 2019 13:25:53 -0400 Received: from localhost (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C7012341E; Thu, 22 Aug 2019 17:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566494752; bh=yDeMJbzq+TOjCwQOhDH0nlJsiz1Mfw7aQRUec/IWZzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vd/LB7abIv0mrdl8mi0RPq112ehzxP2HnFIx89h+bcCHD/4GNxBbFTuL0wB0ISf+b 6DDvVmkFnO6Zs3fk+r2MuSdia4hlxucK8gunhKw8qah0+sv8OZLnTGByne4+3A+Di9 QP/v6BKmT7rPXCadRJxISmCGwHpkNxYJyiS3nqxE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yang Shi , Catalin Marinas , Michal Hocko , Dmitry Vyukov , David Rientjes , Matthew Wilcox , Qian Cai , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 51/85] Revert "kmemleak: allow to coexist with fault injection" Date: Thu, 22 Aug 2019 10:19:24 -0700 Message-Id: <20190822171733.477513236@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190822171731.012687054@linuxfoundation.org> References: <20190822171731.012687054@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit df9576def004d2cd5beedc00cb6e8901427634b9 ] When running ltp's oom test with kmemleak enabled, the below warning was triggerred since kernel detects __GFP_NOFAIL & ~__GFP_DIRECT_RECLAIM is passed in: WARNING: CPU: 105 PID: 2138 at mm/page_alloc.c:4608 __alloc_pages_nodemask+0x1c31/0x1d50 Modules linked in: loop dax_pmem dax_pmem_core ip_tables x_tables xfs virtio_net net_failover virtio_blk failover ata_generic virtio_pci virtio_ring virtio libata CPU: 105 PID: 2138 Comm: oom01 Not tainted 5.2.0-next-20190710+ #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org 04/01/2014 RIP: 0010:__alloc_pages_nodemask+0x1c31/0x1d50 ... kmemleak_alloc+0x4e/0xb0 kmem_cache_alloc+0x2a7/0x3e0 mempool_alloc_slab+0x2d/0x40 mempool_alloc+0x118/0x2b0 bio_alloc_bioset+0x19d/0x350 get_swap_bio+0x80/0x230 __swap_writepage+0x5ff/0xb20 The mempool_alloc_slab() clears __GFP_DIRECT_RECLAIM, however kmemleak has __GFP_NOFAIL set all the time due to d9570ee3bd1d4f2 ("kmemleak: allow to coexist with fault injection"). But, it doesn't make any sense to have __GFP_NOFAIL and ~__GFP_DIRECT_RECLAIM specified at the same time. According to the discussion on the mailing list, the commit should be reverted for short term solution. Catalin Marinas would follow up with a better solution for longer term. The failure rate of kmemleak metadata allocation may increase in some circumstances, but this should be expected side effect. Link: http://lkml.kernel.org/r/1563299431-111710-1-git-send-email-yang.shi@linux.alibaba.com Fixes: d9570ee3bd1d4f2 ("kmemleak: allow to coexist with fault injection") Signed-off-by: Yang Shi Suggested-by: Catalin Marinas Acked-by: Michal Hocko Cc: Dmitry Vyukov Cc: David Rientjes Cc: Matthew Wilcox Cc: Qian Cai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 6c94b6865ac22..5eeabece0c178 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_NOFAIL) + __GFP_NOWARN) /* scanning area inside a memory block */ struct kmemleak_scan_area { -- 2.20.1