Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2066672ybl; Thu, 15 Aug 2019 06:06:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYQJt9N9ip9FaJZX7jdVMW3OXRgRb82I5FYhtpvWbx5ye8h7MZhiJExg9S+zDCFHJTbylc X-Received: by 2002:a17:90a:4806:: with SMTP id a6mr2178706pjh.38.1565874375996; Thu, 15 Aug 2019 06:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565874375; cv=none; d=google.com; s=arc-20160816; b=SkbDFVjcWFL+aQ9WnynsLm4+b9XytWlSfgV9wbjmYRATOnicdcZyBqKDCbC1R5WCFO PFA7ginCZV7WCinN8pB1Sj63vqE3snhQYzn++J82/LAM/xTlM2setg0hK0w/rKnBj3Iu urkUuM2lTlItuPOBQ2EqCYYwmrHTLnNE1Mj/jh/dloExMia6eTm0k81W7jyVQ/aPVPeE tHu8NxELLU+1f2w64I3ZdcFlRqK5fb1GanWWxF85OPUO3ngQJ8NiYE5vcVMEo05bH0UW pVkdiv7wQnrvrxbMZ/Lij+XIsbYXcAtGKcecXTQZsd64TXp2BvcM6RvPN0HiZbsmK3F/ PJaw== 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:dkim-signature; bh=+sQD+zsr7vGI2rnBo9g+oJW06UyfnJhHIGQAqNbFxW4=; b=nYTuylYJJ94HBp7htdzQXi2C700IgI+H7HDQM5A4nVkapPQW72EsYrIF0+Cw6r6Ih0 U39EkhwUsxG+DaxI/UEaZ6T0r4BC2Q/V9V1cU7a9+tz92vpNe8eRnjsi5y8V7ETxxyz1 U11nq05bwkf6REQUE9VnPs+QxSfGN7qsxb6FJr4tD+UCtLhJtxjzD3YMkE92vLKYGIzv D7LkrZXcozIDQgtwkeUUe6E5JLIB5Dcso/oVkNmjxn+orn9mEyh5C1e1mcpFIExJYlE0 THJBpMIFZ7iu5y0ZzvVr7sUup3XkzaIRNkPyrhFdd3qFNHOl71EwXLpqTgCxjJGXhnnp cyxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="IuZwSs1/"; 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 d3si936805pjo.73.2019.08.15.06.05.47; Thu, 15 Aug 2019 06:06:15 -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=@ziepe.ca header.s=google header.b="IuZwSs1/"; 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 S1732157AbfHONER (ORCPT + 99 others); Thu, 15 Aug 2019 09:04:17 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:36098 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732150AbfHONER (ORCPT ); Thu, 15 Aug 2019 09:04:17 -0400 Received: by mail-qk1-f196.google.com with SMTP id d23so1790473qko.3 for ; Thu, 15 Aug 2019 06:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+sQD+zsr7vGI2rnBo9g+oJW06UyfnJhHIGQAqNbFxW4=; b=IuZwSs1/sg2gs7X8/HMGOKYXzgvI7hKzDGdggZttJSURMRYxJVZftP0NCXoTx9kR26 O/sfZwzz3+w3TlMh5kO0BfG0INa47kk9US5Bl/a8MKcvzoVehrnJPWGzU7V9y+o2d5Nk Kju7MceUpwoVwA5wyNNFaVyXu7PG6ntN3MFy/C4bxnPqmzJLs9UnB1hl3gHgOa65jxUB Hvu5s57zRVawIe+YlelM+eNZ9DvN83kuurmv37XNGarrXfBulYC73YTxo9UVkxrcQTnK C9zb4BzCqLARK8nWnPlz/aG4w3K7tBt1aXiP8Ag8AjtMBvt7ltpyGMaiGvt2NqgiRt4O TqYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+sQD+zsr7vGI2rnBo9g+oJW06UyfnJhHIGQAqNbFxW4=; b=c9pH0kvsZo2q2toB+mZPY4dwM7FCykTraAH0UPbXz11MbC6dzlS5EIjCFMZNelzG0h id8UjLRlBNpgfVvSNqTJmitA9PjAfdema6gXCoUyTbXjMeTaCrdEA8yvFWZAvHVui8XS sVkIGBLk2Ah6bvgLBMzNKvqrtMsZhYhpZqehY6I3+1O/jJJ0IIYo4KRoTzWsPDKUR1/N eijoOplBs4L9iK+9hntNQ7nMDB0uG3Xm9su6gW3OXVsTqLv48fiMbitPBmRrytNw+Mra JqyMrPicRhZI58k0TjPpKN1UalQJr8PVrSHIhOQU8dBvkyBi4RiKkhZbtQFsCj4Wcu6n RiBg== X-Gm-Message-State: APjAAAWs8Qi1zfM6NrgjunnNNy4d0ECkaiQWLd5ionSvYeOKJB6L/Lnr DEXOLGAbfdxioE5SuEJvdjCmJg== X-Received: by 2002:a05:620a:52e:: with SMTP id h14mr4017748qkh.358.1565874256038; Thu, 15 Aug 2019 06:04:16 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id z7sm1468623qki.88.2019.08.15.06.04.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Aug 2019 06:04:15 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hyFQN-0004HN-58; Thu, 15 Aug 2019 10:04:15 -0300 Date: Thu, 15 Aug 2019 10:04:15 -0300 From: Jason Gunthorpe To: Michal Hocko Cc: Andrew Morton , Daniel Vetter , LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Peter Zijlstra , Ingo Molnar , David Rientjes , Christian =?utf-8?B?S8O2bmln?= , =?utf-8?B?SsOpcsO0bWU=?= 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: <20190815130415.GD21596@ziepe.ca> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190815084429.GE9477@dhcp22.suse.cz> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Failure is expressed by a deadlock cycle in the lockdep map, and lockdep can handle arbitary complexity through layers of locks, work queues, threads, etc. What is missing? Jason