From patchwork Wed Apr 27 21:14:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 8962751 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 544E6BF29F for ; Wed, 27 Apr 2016 21:14:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75FAA2022A for ; Wed, 27 Apr 2016 21:14:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 976312014A for ; Wed, 27 Apr 2016 21:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753128AbcD0VOT (ORCPT ); Wed, 27 Apr 2016 17:14:19 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36498 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbcD0VOS (ORCPT ); Wed, 27 Apr 2016 17:14:18 -0400 Received: by mail-wm0-f65.google.com with SMTP id w143so16782386wmw.3; Wed, 27 Apr 2016 14:14:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=esI5GZ70FiiObl9/tQo9JA82Btp2VkXjuOrQW3uoQ/w=; b=EbYZFZUJLP8wU6mkw1AtTEsUhSleGsBVGHYn6FEUAcZuvZtFceTFbmnB11irTzGP3k vYT8ZDAhtNPiZdJSPNq1miYmpGftm7tXafkf6Ws/IQU3kQitfGptNa6g2uM1kBtykwze +ysuszYMpavd+je4UPFG3ZziBKyX64nRKJnaccPuUZ1fXuL+aV6PXkaByEZFcnSWVgLW VHBOQjaGdjAfSyyQpPZBj1Wnw+JXRc0SMvz9nVp0iTDfjMVRj9/coKXon3tTZnYN8whN K/qQrJ9w6NyJsmijZXoVI6YyQD9+2OLXWnMlG1lb77G9n6Kw4zuq/EJQdxilUpDEhDxF 6F8Q== X-Gm-Message-State: AOPr4FUU/Q0QmddwWQRJ0gMIwPkx8Y3XKEFlIecVlC6NOxo64s22j0pj6r3zrhQ2/3DhiA== X-Received: by 10.28.54.33 with SMTP id d33mr12739060wma.62.1461791655739; Wed, 27 Apr 2016 14:14:15 -0700 (PDT) Received: from localhost (ip-86-49-65-8.net.upcbroadband.cz. [86.49.65.8]) by smtp.gmail.com with ESMTPSA id ug8sm5959074wjc.42.2016.04.27.14.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2016 14:14:15 -0700 (PDT) Date: Wed, 27 Apr 2016 23:14:14 +0200 From: Michal Hocko To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Andrew Morton , Dave Chinner , Theodore Ts'o , Chris Mason , Jan Kara , ceph-devel@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, logfs@logfs.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mtd@lists.infradead.org, reiserfs-devel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, LKML Subject: Re: [PATCH 1.2/2] mm: introduce memalloc_nofs_{save,restore} API Message-ID: <20160427211414.GA24919@dhcp22.suse.cz> References: <1461671772-1269-2-git-send-email-mhocko@kernel.org> <1461758075-21815-1-git-send-email-mhocko@kernel.org> <1461758075-21815-2-git-send-email-mhocko@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1461758075-21815-2-git-send-email-mhocko@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP OK, so the lockdep splats I was seeing [1] were much easier to fix than I originally thought. So the following should be folded into the original patch. I will send the full patch later on. [1] http://lkml.kernel.org/r/20160427200927.GC22544@dhcp22.suse.cz --- From 1968c0a8ace4090a9deca8f4c1a206ee546e595a Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 27 Apr 2016 22:32:57 +0200 Subject: [PATCH] fold me "mm: introduce memalloc_nofs_{save,restore} API" Lockdep infrastructure is hooked into early hot paths of the allocator so __lockdep_trace_alloc has to check for PF_MEMALLOC_NOFS directly and do not rely on current_gfp_context Signed-off-by: Michal Hocko --- kernel/locking/lockdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 716547fdb873..f60124d0871c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2750,7 +2750,7 @@ static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags) return; /* We're only interested __GFP_FS allocations for now */ - if (!(gfp_mask & __GFP_FS)) + if (!(gfp_mask & __GFP_FS) || (curr->flags & PF_MEMALLOC_NOFS)) return; /*