Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp227307ybl; Thu, 15 Aug 2019 16:11:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwsu8sqI3FPUJXI3AmErNxrDPmGPdKABcvIC19f9wwdFs2jYTgx3OCt6oTsK7He2z5KKfAW X-Received: by 2002:a65:6454:: with SMTP id s20mr5290584pgv.15.1565910665097; Thu, 15 Aug 2019 16:11:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565910665; cv=none; d=google.com; s=arc-20160816; b=suWh8LY2Xviig/QfegM3WBXN3eqY73Tt+VUw+m1RE0e3jAsD5bVuTqAHcxaVlN3eil enwuk/2tMMBMWjwLj5yRgz/kIQVR91/fsyVu90oB9wGjDLRHkYJahaaP9g/mYCB7SkYn a7/2Pcn+2R5f5/82eTbRUsUbzDhF7paaEtYx4+G05XuEYqpcNWN3OGEkxQklgmKXZCNt bNS9Qp7oFYd5azx7xI1AP+ibmXFm7UJk92C3zrQgDP/xymj2mZCddjEPsTd9XvK5oc8u J92TRgYPqdKj+oUMZRGa5ZwjG0OgjNWtT8QweWMUGJjnMInlXQyoT7DqIJKXH8jt5ib5 xuCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qTHh9ZK37xd08x9Ue/sJIZ77olqIpSOlqxcia7YCCRQ=; b=l/rQZZ67RQgfdYVv9gJTb2indceUw3gTWl9x4k5/a//sPzJ91A9gS9d/IoMehmSN5c TTqtZNH2OlSiMR9dhTnoBaHMpIv2je28PqZXypHiZe5qoYalt/CkoHGdLdFwoAHX++DF PukO1Muny7iDiEr5EaGeFZDGowMRSwyuowDNJOSGd/BEXD02w6HbjrTs+u7piHJ9Ctd2 vvNy/hWLh8VUrBt/NEMvau0I6jmOwc0+f729hqlPBE7unB/z122HogkvjNpDuOJrLq08 oYs5WMjpSG6DZVifUBUhATHV6UtyqxOkb88sHVamXpWwSYBBNzcGx4DEAHF+OPixl4v7 7rTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=kiM9Ekjf; 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 g7si3029396pfk.224.2019.08.15.16.10.49; Thu, 15 Aug 2019 16:11:05 -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=@ffwll.ch header.s=google header.b=kiM9Ekjf; 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 S1731066AbfHOUQ4 (ORCPT + 99 others); Thu, 15 Aug 2019 16:16:56 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:41980 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbfHOUQz (ORCPT ); Thu, 15 Aug 2019 16:16:55 -0400 Received: by mail-ot1-f67.google.com with SMTP id o101so7573009ota.8 for ; Thu, 15 Aug 2019 13:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qTHh9ZK37xd08x9Ue/sJIZ77olqIpSOlqxcia7YCCRQ=; b=kiM9EkjfkkvV2acXtyuHtZlSwyxVFy/luh62JpSLtwDDqFGrqqv/l8fVfIHPp21MCP 7SmEesVoHHEi/iJMWm4H/Jl4/ZHJ7gBZkP4lp2VTsSGgM/twhyanBIFDeYKJhMAfWLUJ EmiJ2M3g4FY95dria69FfMx+Qm3RsWWUVpCIo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qTHh9ZK37xd08x9Ue/sJIZ77olqIpSOlqxcia7YCCRQ=; b=QnkQYIO/BAj6QHCGmdERE2kwRfwpIWYKARgdcGw52V6/dmIQWGN6RdDRnFYyR2TTcz rz4Bbty1UGqwafygOKOkTtdJPTrrQyb3sA2DgVxSc8yw3gNgG9MNHZe5gQNRS08c3yJI xT1oQaqVKtIXF8tkSEZqpK7wgMz32qwGwKKJoKV10Xbem/O+6DIlSIgETNLOjEA3FSer Xctb7LQOQrUa3Lk8WCaCIyJbUQUfMvsfKiw9394NatjlwERFmF6gMjMThhAWl3RR5Xdr dbLFS/LoizMV8s7hj2ZL0LJoQW7ScBouDE5HH8/T0EnprBYTHhjGXNyXyZNLe8TJFuu5 rt4w== X-Gm-Message-State: APjAAAWQ1f+3RVS5UjNP38UMqAJt1d0Wg6Vm6JlxktnprKdhL1FmbhVW l6bd0CU+66adrjf3zAqaYy2zMT1Th5iG84vTvVLkNA== X-Received: by 2002:a9d:6955:: with SMTP id p21mr5284545oto.204.1565900214485; Thu, 15 Aug 2019 13:16:54 -0700 (PDT) MIME-Version: 1.0 References: <20190815065829.GA7444@phenom.ffwll.local> <20190815122344.GA21596@ziepe.ca> <20190815132127.GI9477@dhcp22.suse.cz> <20190815141219.GF21596@ziepe.ca> <20190815155950.GN9477@dhcp22.suse.cz> <20190815165631.GK21596@ziepe.ca> <20190815174207.GR9477@dhcp22.suse.cz> <20190815182448.GP21596@ziepe.ca> <20190815190525.GS9477@dhcp22.suse.cz> <20190815191810.GR21596@ziepe.ca> <20190815193526.GT9477@dhcp22.suse.cz> In-Reply-To: <20190815193526.GT9477@dhcp22.suse.cz> From: Daniel Vetter Date: Thu, 15 Aug 2019 22:16:43 +0200 Message-ID: Subject: Re: [Intel-gfx] [PATCH 2/5] kernel.h: Add non_block_start/end() To: Michal Hocko Cc: Jason Gunthorpe , Feng Tang , Randy Dunlap , Kees Cook , Masahiro Yamada , Peter Zijlstra , Intel Graphics Development , Jann Horn , LKML , DRI Development , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Thomas Gleixner , David Rientjes , Wei Wang , Daniel Vetter , Andrew Morton , Andy Shevchenko , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" 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 9:35 PM Michal Hocko wrote: > > On Thu 15-08-19 16:18:10, Jason Gunthorpe wrote: > > On Thu, Aug 15, 2019 at 09:05:25PM +0200, Michal Hocko wrote: > > > > > This is what you claim and I am saying that fs_reclaim is about a > > > restricted reclaim context and it is an ugly hack. It has proven to > > > report false positives. Maybe it can be extended to a generic reclaim. > > > I haven't tried that. Do not aim to try it. > > > > Okay, great, I think this has been very helpful, at least for me, > > thanks. I did not know fs_reclaim was so problematic, or the special > > cases about OOM 'reclaim'. > > I am happy that this is more clear now. > > > On this patch, I have no general objection to enforcing drivers to be > > non-blocking, I'd just like to see it done with the existing lockdep > > can't sleep detection rather than inventing some new debugging for it. > > > > I understand this means the debugging requires lockdep enabled and > > will not run in production, but I'm of the view that is OK and in line > > with general kernel practice. > > Yes and I do agree with this in general. So if someone can explain to me how that works with lockdep I can of course implement it. But afaics that doesn't exist (I tried to explain that somewhere else already), and I'm no really looking forward to hacking also on lockdep for this little series. > > The last detail is I'm still unclear what a GFP flags a blockable > > invalidate_range_start() should use. Is GFP_KERNEL OK? > > I hope I will not make this muddy again ;) > invalidate_range_start in the blockable mode can use/depend on any sleepable > allocation allowed in the context it is called from. So in other words > it is no different from any other function in the kernel that calls into > allocator. As the API is missing gfp context then I hope it is not > called from any restricted contexts (except from the oom which we have > !blockable for). Hm, that's new to me. I thought mmu notifiers very much can be called from direct reclaim paths, so you have to be extremely careful with getting back into that one. At least the lockdep splats I remember also tend to have fs_reclaim in there, that's where all the fun comes from. > > Lockdep has > > complained on that in past due to fs_reclaim - how do you know if it > > is a false positive? > > I would have to see the specific lockdep splat. I guess the lockdep annotation for invalidate_range_start carries the same risks as the fs_reclaim annotation. Still feels like worth it. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch