Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp988610ybl; Fri, 16 Aug 2019 07:12:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwH19YcLlmaeGgT2O4Inj91TM1qaoTRFsmMcy2kJ1Xdz6TtX/M3355eK+rWV2QpzKzl8EUY X-Received: by 2002:aa7:9e9a:: with SMTP id p26mr11253270pfq.25.1565964776105; Fri, 16 Aug 2019 07:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565964776; cv=none; d=google.com; s=arc-20160816; b=g0P8Q6mKt98hvY/NU4JbNQw/5Asj8HApXFiZ/RgUhlCnMET9Kk0OlziPT9Utxn3ivA iQAbnDE+eQkTBBi6Txr0Hu1H66xzqg7EnbLF+Zzje6jj68EhLXWxP2K8emzE9E4ZiYh0 FfBqijicSbvHtg8DiZMf1jhhptuzZiwoaB2OlkIcFVDG0l+Gv1/WCS72393PWi0eCQlY uB1AlBo58KVvLyHegTq7iLc/F3EyqDC4uNiGP28e0bgpvPRKr9qqWsIYaA04URCdYU7a twoA7PVRA+HJQWHtyHi6bI2YiftuRKt8YDNd9LrXmYbl3McNQODhuHrk6NvcaydVyZ6r UbnQ== 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=Yssxgr/R6OQdplSnDNsdTRBQMibjMIg4+OgGLQyMPwk=; b=DGLXFvMyL8YaBDNYjRCgbnfKe71NjN5tnEebko3BXvqYC9/ipoPPDy36aK/6eyXL7O twryqr+XNHGY1NGIDprM86VJeTSqJNT65Rm/FSrbweAj84eY/kWYdlHfJJVolSJLuZY1 eklRQEIg4zEaKU407H9Y7hE/YvMPj10rFuOaktJ1NU3+g/yKEf043TlkbF+SXCVFNyWg e5sMktZb0Et3vT7NIerTyYstrgSWWe++sR5yqxV1cLGBLejQ68BAdFVPrBvLmrT1LML1 RwtRndPJ/kxV1lZ8Bvl0y3z+q9ZUzGLqJ/hPXX5FjoX0OfQvug5eDzDKGKRKLZdzxcy+ mPGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=iKfxKoMv; 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 35si4154052plb.24.2019.08.16.07.12.39; Fri, 16 Aug 2019 07:12:56 -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=iKfxKoMv; 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 S1727365AbfHPOLs (ORCPT + 99 others); Fri, 16 Aug 2019 10:11:48 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:36542 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfHPOLs (ORCPT ); Fri, 16 Aug 2019 10:11:48 -0400 Received: by mail-oi1-f196.google.com with SMTP id c15so4897838oic.3 for ; Fri, 16 Aug 2019 07:11:47 -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=Yssxgr/R6OQdplSnDNsdTRBQMibjMIg4+OgGLQyMPwk=; b=iKfxKoMvF7fYuHqtxhMdeLtiTE/pTTZEGguyp0+hucFHluJ5kX2VIkLSCTNrBBI4hS m75gSd95L78hr4hdAIJz7abvXf9heA1zVnFk/Tff1ZGBb79t7v6ncV9jdxtpQZTpEg9o H6oav0M6pZU1zPqylhHo7uj1Ld1HrZ7uYQ70Q= 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=Yssxgr/R6OQdplSnDNsdTRBQMibjMIg4+OgGLQyMPwk=; b=dARUgw4vDOISp7Ovb/6GGs2OZaL+r4yg0XFj/yhdYxIO2DNnRQPRETvFoZLWFd4Cdz Kk8Z7O9TLytYYGfAtNnCM9uOT7KRzxeNynY+4iWigEN4JHa4Beb1BJtqHseEkT6MpW1v aebhX548qslrW/u+tahcY3W0v29Oa4KF3hEcJzyibbAvH/kMT6L175iL/nLbbLen3Y3M 8wob0dc5Dz9Bre6oA5FxK18BAN+Vkt4cbmcI+OtkDNtEJ7CuHN0DyIc++fRbdzNqB+td 8BfQjRWTkoF1Urut2tF5G8t8KWFI6Av5RJqKtW2DZznpOITf6iB0IuzOfSmzPCH7Epyw Si9Q== X-Gm-Message-State: APjAAAWajHwIgQn/OWu39glHRiTw9UoloJHlLApF9qaKrEGrpMvCxbxj BZsiO+Io8xBLLhLNkdiAvnhzfDuWmNmQ57dZYqBXOw== X-Received: by 2002:aca:1a0b:: with SMTP id a11mr5297448oia.128.1565964706931; Fri, 16 Aug 2019 07:11:46 -0700 (PDT) MIME-Version: 1.0 References: <20190815174207.GR9477@dhcp22.suse.cz> <20190815182448.GP21596@ziepe.ca> <20190815190525.GS9477@dhcp22.suse.cz> <20190815191810.GR21596@ziepe.ca> <20190815193526.GT9477@dhcp22.suse.cz> <20190815202721.GV21596@ziepe.ca> <20190816010036.GA9915@ziepe.ca> <20190816121243.GB5398@ziepe.ca> In-Reply-To: <20190816121243.GB5398@ziepe.ca> From: Daniel Vetter Date: Fri, 16 Aug 2019 16:11:34 +0200 Message-ID: Subject: Re: [Intel-gfx] [PATCH 2/5] kernel.h: Add non_block_start/end() To: Jason Gunthorpe Cc: Michal Hocko , 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 Fri, Aug 16, 2019 at 2:12 PM Jason Gunthorpe wrote: > > On Fri, Aug 16, 2019 at 08:20:55AM +0200, Daniel Vetter wrote: > > On Fri, Aug 16, 2019 at 3:00 AM Jason Gunthorpe wrote: > > > On Thu, Aug 15, 2019 at 10:49:31PM +0200, Daniel Vetter wrote: > > > > On Thu, Aug 15, 2019 at 10:27 PM Jason Gunthorpe wrote: > > > > > On Thu, Aug 15, 2019 at 10:16:43PM +0200, Daniel Vetter wrote: > > > > > > 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. > > > > > > > > > > Hmm, kind of looks like it is done by calling preempt_disable() > > > > > > > > Yup. That was v1, then came the suggestion that disabling preemption > > > > is maybe not the best thing (the oom reaper could still run for a long > > > > time comparatively, if it's cleaning out gigabytes of process memory > > > > or what not, hence this dedicated debug infrastructure). > > > > > > Oh, I'm coming in late, sorry > > > > > > Anyhow, I was thinking since we agreed this can trigger on some > > > CONFIG_DEBUG flag, something like > > > > > > /* This is a sleepable region, but use preempt_disable to get debugging > > > * for calls that are not allowed to block for OOM [.. insert > > > * Michal's explanation.. ] */ > > > if (IS_ENABLED(CONFIG_DEBUG_ATOMIC_SLEEP) && !mmu_notifier_range_blockable(range)) > > > preempt_disable(); > > > ops->invalidate_range_start(); > > > > I think we also discussed that, and some expressed concerns it would > > change behaviour/timing too much for testing. Since this does does > > disable preemption for real, not just for might_sleep. > > I don't follow, this is a debug kernel, it will have widly different > timing. > > Further the point of this debugging on atomic_sleep is to be as > timing-independent as possible since functions with rare sleeps should > be guarded by might_sleep() in their common paths. > > I guess I don't get the push to have some low overhead debugging for > this? Is there something special you are looking for? Don't ask me, I'm just trying to get _some_ debugging for this in. I don't care one bit how much overhead it has because in our CI our debug build has lockdep and everything and it crawls anyway. I started out with the preempt_disable/enable thing like you suggested, and a few rounds later we're here. We can go back to v1 on this one, but I'd prefer to not do the lap too often. Also, aside from this patch (which is prep for the next) and some simple reordering conflicts they're all independent. So if there's no way to paint this bikeshed here (technicolor perhaps?) then I'd like to get at least the others considered. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch