Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp856944ybl; Fri, 16 Aug 2019 05:13:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4GQ3sJsLePibi2K4fLsCFjPjAUoFcw+QqJsDuSoXQEyGWX/x5StQ3ED0+hI/Wl9lqHXCh X-Received: by 2002:aa7:9907:: with SMTP id z7mr10104539pff.13.1565957620482; Fri, 16 Aug 2019 05:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565957620; cv=none; d=google.com; s=arc-20160816; b=eXK0o0Take3sXESkJnygXTjiO/wWaIeYYuS6KlST/5ACXvTNq1pP35+vKeiYB74dMj s/yQBOlPTtZly1erK9Tw1TN73WuxXsHtoUqIHrwXX3/h59cYIJ6VLoof7xw6cjttpm6m enmVhhAdaE2wGQn1b8Ku4sgQXRBplNHxSbh74/CRKdWS1FKhWm3xFyvK+lkV0yY8+LD/ ZLLw88SKTtzjaxQxbm/tQEYxAL35eJCfMX0r4DYfpHc67dLp9UlRotMHSq3DdTDMzA9w 1Vk0KbwBVo+m8/66HA2mkzGU7+loAkxQQ9MrdqczoAkZEzgvKrqWz07TlZmnas+mW7Io tWBQ== 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=f8owW6EpsmwqtLp0wnKoaaaHq0YX1Y+Qi9vsJyda86Q=; b=GXZ+CkpryIBRjHMLPSJlkjUtzLCxw0o59K3WJmL7RMLGjBvsGPjTVIeycdf/4JhECO ZzRvNu/uZCACoTQmEB7Xs50xig2r2ekkC0eaqNcF3poJr6AOLyHypAc5Xy7Z45czb958 zynUqjnIlcLtv3HdOrCQ+h84Lrz+L09IKgjl0C6pwXXIzuNeFHywXfKFgxsPZxvqAA9z gI4aS4CmdJapRD/sxStULlHckVDlNa88RtJ8eIa/kDooYqWnICpuxln2oZVyljwyRhHG ReCZraSR+K36jhS8IQjuBQjuty6E9iRsWpv3PRaGd/cW/EIK+I36ilxQGQdrEzyBZJK4 P1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=K074sQzn; 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 123si4092621pfy.61.2019.08.16.05.13.22; Fri, 16 Aug 2019 05:13:40 -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=K074sQzn; 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 S1727128AbfHPMMq (ORCPT + 99 others); Fri, 16 Aug 2019 08:12:46 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43135 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbfHPMMp (ORCPT ); Fri, 16 Aug 2019 08:12:45 -0400 Received: by mail-qk1-f194.google.com with SMTP id m2so4462527qkd.10 for ; Fri, 16 Aug 2019 05:12:45 -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=f8owW6EpsmwqtLp0wnKoaaaHq0YX1Y+Qi9vsJyda86Q=; b=K074sQzn3mritfVn1vyEO1cFfN4Z/ArjoqUauJv0wy+G786US9n9P1vD6X+hiV1Vue L0iagywjGWWTZJw6Cr1uKClGUTmJNRFC0EnNA4S2RzUw1XQITq5bgXlU8QfF9Q1zWEpN E/SpAFJNq+LhHWZ6WCWF9IBawfG7nYtybEgTo75npLEVQ4H8CyhvMH07dKg73copwI/H 49E1Y6LZ7PzsHJQmnVyw6vril9S6p1AoL+AptSIhY//od14+Os1BKic/sqw8uQRF2Ok5 LUzGaTuogV45oW5ff012FxSlHjSnKsqN0UJflMgirTuKBXN0Mi0YoWcPVVjNtE7iJrIx 7Esw== 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=f8owW6EpsmwqtLp0wnKoaaaHq0YX1Y+Qi9vsJyda86Q=; b=mbtCcW+SusDJ3ZSdykAcy25/0QALFiM36AAHR/dYY8qPyYmzQ1B6U74e2V8qfDlTi4 B78u3hOMbMCnUFZMfQgXksT3xJM1IE4oN2Sv+R5jiKlOOI+OSTnDrvwzbrED8PytXev7 gBFpC3viCTgo743nhjUx5GzdE+ExSkI5ryeyoK8SLBtXDs7xnN5S+B314QOEWco1X056 5nZdZ5PDk487cX40brEyPX4EggQR5n/eSzoBwF0CBcKP5Pf9qNg4KLga0WTmisowdiwa rQPwhn5BM9CE0LoZOS9mcXU5FJKBmSQDd5WS4zImWcYFoshVk2t5ArbEDcpF2N8itvyH SE2w== X-Gm-Message-State: APjAAAWoAOsEu6kKws7iW83sETxXhWJXw642qUb4EBxDmaODMjlrlah6 IAqYEEtmUZVcPPlRWvCgWkv4gA== X-Received: by 2002:a05:620a:15eb:: with SMTP id p11mr7740939qkm.23.1565957564536; Fri, 16 Aug 2019 05:12:44 -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 r4sm3294200qta.93.2019.08.16.05.12.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Aug 2019 05:12:43 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hyb63-0001mf-6H; Fri, 16 Aug 2019 09:12:43 -0300 Date: Fri, 16 Aug 2019 09:12:43 -0300 From: Jason Gunthorpe To: Daniel Vetter 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?SsOpcsO0bWU=?= Glisse , Ingo Molnar , Thomas Gleixner , David Rientjes , Wei Wang , Daniel Vetter , Andrew Morton , Andy Shevchenko , Christian =?utf-8?B?S8O2bmln?= Subject: Re: [Intel-gfx] [PATCH 2/5] kernel.h: Add non_block_start/end() Message-ID: <20190816121243.GB5398@ziepe.ca> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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? Jason