Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3739952ybl; Tue, 20 Aug 2019 01:19:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqySLFZKOh4TWOYwgkCRW1il2QzesJfZa/K3Fips6HVwoOigO1sZeEAZk+hmqux7oOg3wMGO X-Received: by 2002:a65:4189:: with SMTP id a9mr23015819pgq.399.1566289195855; Tue, 20 Aug 2019 01:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566289195; cv=none; d=google.com; s=arc-20160816; b=mQakVO5Lw+oIX7lYhgx1CyPlqRRO0y37Q7uVyoWp1UjrXJ9Tcbck4zF5L/n9DIXEeo tgovs6gnrObGH1+W7cV15dbzMX4N4rHwwuhv1uuqAntE+HGyg+b5w1x2aqx38XrSQzZM I/9I+8QeMyJLZHdfzss8Ry2w4XDSNi594kVFHJLQnj50ZUG45yTKCeX0HlVHokhrg0iG 2hmyJfmrFGQPUPILRUESROd26vVI8OsD/WCRIhzihg38d32ldqREBy7aNy28oPA/P0zf 5baIXGwtuHStdKChdKwbsQF0kIstomJ7NHHcCtUG/5AliKgFmNcygb/vPftPST/ISlAJ tMDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=E2Q9OjKndmBr5NeeMseJYt6A6369vCoCYjXtfvcRqWE=; b=FEdKaFct2ndCPE4QQTuQ0KiUQDh8HT1hbP7dWKpiYz96yRYjVLrfnEnKTk3vUD9pTc 8TYJxI3+61P75E3OynUNXogF7dNfHLqcq/ZAYRaxY1FohH2YpacgTdgO0E2yoiwA2tyn m4enQgoeNhCz6OHBmeQ9lNOHbY02Yhl6+MbQawA6naNe5UK1FgWhRIJsNjyAQa9WOqEP nrhPcCTho1klScgG55nu76FRSwZXKipomBs59or3d1Bbuf+JR9AOHFyilZStigkBbKIl RfzFX/BsdZg1he9oAVRNyQYXpr5d7YPsG20wPHed7KNLD7Ae01sGd91HBEffaQwZKGrK pEhw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si11432587pgd.472.2019.08.20.01.19.40; Tue, 20 Aug 2019 01:19:55 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729451AbfHTIS2 (ORCPT + 99 others); Tue, 20 Aug 2019 04:18:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:51296 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729345AbfHTIS2 (ORCPT ); Tue, 20 Aug 2019 04:18:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 236DBB009; Tue, 20 Aug 2019 08:18:26 +0000 (UTC) Date: Tue, 20 Aug 2019 10:18:25 +0200 From: Michal Hocko To: Jason Gunthorpe Cc: LKML , "linux-mm@kvack.org DRI Development" , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , Andrew Morton , David Rientjes , Christian =?iso-8859-1?Q?K=F6nig?= , =?iso-8859-1?B?Suly9G1l?= Glisse , Masahiro Yamada , Wei Wang , Andy Shevchenko , Thomas Gleixner , Jann Horn , Feng Tang , Kees Cook , Randy Dunlap , Daniel Vetter Subject: Re: [PATCH 2/5] kernel.h: Add non_block_start/end() Message-ID: <20190820081825.GJ3111@dhcp22.suse.cz> References: <20190815174207.GR9477@dhcp22.suse.cz> <20190815182448.GP21596@ziepe.ca> <20190815190525.GS9477@dhcp22.suse.cz> <20190815191810.GR21596@ziepe.ca> <20190815193526.GT9477@dhcp22.suse.cz> <20190815201323.GU21596@ziepe.ca> <20190816081029.GA27790@dhcp22.suse.cz> <20190816121906.GC5398@ziepe.ca> <20190816122625.GA10499@dhcp22.suse.cz> <20190816143145.GD5398@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816143145.GD5398@ziepe.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-08-19 11:31:45, Jason Gunthorpe wrote: > On Fri, Aug 16, 2019 at 02:26:25PM +0200, Michal Hocko wrote: [...] > > I believe I have given some examples when introducing __GFP_NOLOCKDEP. > > Okay, I think that is 7e7844226f10 ("lockdep: allow to disable reclaim > lockup detection") Hmm, sadly the lkml link in the commit is broken. > > Hum. There are no users of __GFP_NOLOCKDEP today?? Could all the false > positives have been fixed?? I would be more than surprised. Those false possitives were usually papered over by using GFP_NOFS. And the original plan was to convert those back to GFP_KERNEL like allocations and use __GFP_NOLOCKDEP. > Keep in mind that this fs_reclaim was reworked away from the hacky > interrupt context flag to a fairly elegant real lock map. I am glad to hear that because that was just too ugly to live. > Based on my read of the commit message, my first reaction would be to > suggest lockdep_set_class() to solve the problem described, ie > different classes for 'inside transaction' and 'outside transaction' > on xfs_refcountbt_init_cursor() No this just turned out to be unmaintainable. The number of lock classes was growing high. I recommend on of the Dave Chinner's rant. Sorry not link handy. > I understood that generally that is the way to handle lockdep false > positives. > > Anyhow, if you are willing to consider that lockdep isn't broken, I > have some ideas on how to make this clearer and increase > coverage. Would you be willing to look at patches on this topic? (not > soon, I have to finish my mmu notifier stuff) I haven't claimed that the lockdep is broken. It just had problems to capture some code paths and generated false positives. I would recommend talking to lockdep maintainers much more than to me because I would have to dive into the code much more to be useful. I can still comment on the MM side of the thing of course if that is helpful. > > > I would like to inject it into the notifier path as this is very > > > difficult for driver authors to discover and know about, but I'm > > > worried about your false positive remark. > > > > > > I think I understand we can use only GFP_ATOMIC in the notifiers, but > > > we need a strategy to handle OOM to guarentee forward progress. > > > > Your example is from the notifier registration IIUC. > > Yes, that is where this commit hit it.. Triggering this under an > actual notifier to get a lockdep report is hard. All you need is to generate a memory pressure. That shouldn't be that hard. -- Michal Hocko SUSE Labs