Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2091336ybl; Thu, 15 Aug 2019 06:27:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzf8DM6q4vNHTEOmXPcf6lVzhXp/J310Acr4X1WzsLlmfwGltltT65+Qx2ARR+ugZ2mCctq X-Received: by 2002:a63:2807:: with SMTP id o7mr3536722pgo.131.1565875620635; Thu, 15 Aug 2019 06:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565875620; cv=none; d=google.com; s=arc-20160816; b=S8FAoRW4AdLzVALWDgtY+D6qftJzkti7wyqJ2PVA+nh8fpgZOTUnDXO9dl7Ql/X8pl 7jN3SIkuSHl47a//9ufyJIzjRUZUqV7zMcugqALNH5lGvOVkJxHPeeGYfB76gm0PBLun JymwXoQ4Vn7plnAObsoEFE1RLS5siBhtB1LYay7hjXmOr4Ow7F+HMa0NiLHFALfA6ahC Nba6zYrtHpxkV0T0AdBTFAG7m/mwv8KctOo462YnS6lAG5iaypIsjhd81kUblJE4KRJm 6tWAUrE/8z1yKGBzzynr8P0k3H4c8qKuLGMIPfBuNubyajoZXEZShCMtOUdRIHo++Djj pidw== 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=BdTad2nmBz+JpeM5PGWyJnVjwI+rTLnPSk7g1E2VX48=; b=AxVmU56Tcn6p/NRym4YukOfc9nhgiUZWAskQ0u2ZvoGnPDt1TR76PjIJbo8FHWIGp+ x8UsDn856BhsruWWMaj7ovVuLIjNYVcl5/NHmFwOrFxHf5MphLB3vzkgBkZTa9AaRgya 0YX0j0SXj2d6j4spNqbKlkH4X6444bqO21neosegUyjh+i9BS5HAUo7SgKzVBz7M7y0F bpu20ujxYPNxkasbjndrSKeSAyc9LSLoKUcbxoVvYSXk5nQcChPL6PhkLnLR874krCnO lkVhE35voCoUB6GZ11w5bRbpPPLw9buwykmrJ1TEyeg6FdUKRWkPmlZV+cp5woaM+6Gi 3c5w== 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 l2si2056177pff.221.2019.08.15.06.26.45; Thu, 15 Aug 2019 06:27:00 -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 S1732300AbfHONYZ (ORCPT + 99 others); Thu, 15 Aug 2019 09:24:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:44134 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730497AbfHONYZ (ORCPT ); Thu, 15 Aug 2019 09:24:25 -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 64041AE12; Thu, 15 Aug 2019 13:24:24 +0000 (UTC) Date: Thu, 15 Aug 2019 15:24:23 +0200 From: Michal Hocko To: Jason Gunthorpe Cc: Andrew Morton , Daniel Vetter , LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , 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: <20190815132423.GJ9477@dhcp22.suse.cz> References: <20190814202027.18735-1-daniel.vetter@ffwll.ch> <20190814202027.18735-3-daniel.vetter@ffwll.ch> <20190814134558.fe659b1a9a169c0150c3e57c@linux-foundation.org> <20190815084429.GE9477@dhcp22.suse.cz> <20190815130415.GD21596@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190815130415.GD21596@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 Thu 15-08-19 10:04:15, Jason Gunthorpe wrote: > On Thu, Aug 15, 2019 at 10:44:29AM +0200, Michal Hocko wrote: > > > As the oom reaper is the primary guarantee of the oom handling forward > > progress it cannot be blocked on anything that might depend on blockable > > memory allocations. These are not really easy to track because they > > might be indirect - e.g. notifier blocks on a lock which other context > > holds while allocating memory or waiting for a flusher that needs memory > > to perform its work. > > But lockdep *does* track all this and fs_reclaim_acquire() was created > to solve exactly this problem. > > fs_reclaim is a lock and it flows through all the usual lockdep > schemes like any other lock. Any time the page allocator wants to do > something the would deadlock with reclaim it takes the lock. Our emails have crossed. Even if fs_reclaim can be re-purposed for other than FS/IO reclaim contexts which I am not sure about I think that lockdep is too heavy weight for the purpose of this debugging aid in the first place. The non block mode is really something as simple as "hey mmu notifier you are only allowed to do a lightweight processing, if you cannot guarantee that then just back off". The annotation will give us a warning if the notifier gets out of this promise. -- Michal Hocko SUSE Labs