Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3906853ybi; Tue, 18 Jun 2019 08:22:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPXoJIN+By8EH/Q7usOF283bnMmSoa4bh0+bCA0f9nSax1QJwK1gKtHx57vVn+K/Xj41oc X-Received: by 2002:a17:90b:d8a:: with SMTP id bg10mr5761021pjb.92.1560871365646; Tue, 18 Jun 2019 08:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560871365; cv=none; d=google.com; s=arc-20160816; b=mYHYeLduNyLJ/NsCdvF4DaBcad17UXYUhxBU6xG4ssDoY9j854WWL2K/+x615lK9KX EJ2ObfMvW1l6kzNYRJt8euAU7QVrZTNhFSYeI31xDDcaPuGdtJlUL7DLwUpf7RUtgFmL OO1DEVp0OEE8TVVL1/v8Gr2KnxTq/nL84x8mKrP/3tzgI9drg9zDgdT0LeH45LtV7I24 FHnko7qyBY87ymnpt+JAK7sliK3YEN365fkQPnOsRp4s7fNKXK2pREEHbyIQZZSQe+hv orMRywJiCz3E4BH3YPM0h57Xa3C5dwLlsbqrHUe4uxtXOUu+45a3RV+Z03PRsubCN/MJ dxFw== 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-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=E/qk0N+cIbM6HKj1qhjne1NfpocVmMqaX5q+/tL+ueI=; b=oQ5melZ2yZrVfdMK924Zk0CZypo7fcjGPPeqfKgVKHdIuXQtezQtpQJoqbVFFOFCB7 gc9bU1LAWlLHGs8QOIyhimLeGLIBbm9lHrfAS03WvkekVNen2axgLamwRSZMZIWZRyJj kQQVF1IHzRL8IEFdY9Chyc1Ye/eQt1gzddhV8FvUtVp26C1PckUxJpHdbtQtcE+r5Dqf v7FKQTX+tB4uBNIk83pXLmE3b4TIiPXkXgx6Ge0U02I2ByC1Z7wn+5murJmpXtg3EctT JuZZjB23oAS5IOeeV5nfWsNdbvk46IP/s4zIGn8Y7cqZmJDdPPizd9lAw74mRjv080Ng Q1Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=S0baOBWq; 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 l129si417134pga.580.2019.06.18.08.22.28; Tue, 18 Jun 2019 08:22:45 -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=fail header.i=@ffwll.ch header.s=google header.b=S0baOBWq; 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 S1729371AbfFRPWV (ORCPT + 99 others); Tue, 18 Jun 2019 11:22:21 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:33703 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729038AbfFRPWU (ORCPT ); Tue, 18 Jun 2019 11:22:20 -0400 Received: by mail-ed1-f67.google.com with SMTP id i11so22351557edq.0 for ; Tue, 18 Jun 2019 08:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=E/qk0N+cIbM6HKj1qhjne1NfpocVmMqaX5q+/tL+ueI=; b=S0baOBWqecd8R9Fv9S0yBSLlPx0B4vYX0TvI7oaRAzSf4d2jvMU2DZNwb2RG3dYdoB 4+rZlzI6OA2RQxSWsdDqUVmzxXcyYpc2/nLIKI8MXqYfLfBjl7BetsvlRKqBiD5NuAUg AXHEz2PEzrj8GeuDgxkf0L8t0EXnxlWwtpkRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=E/qk0N+cIbM6HKj1qhjne1NfpocVmMqaX5q+/tL+ueI=; b=m4gk/MaJRWhNr0/+SidV6kK9bJQuR2phu2i8irkKu9btjo6vu3vvEDoYdhRctBTwDN 1nqHyw3TDvuKDkdg1HoNekESKOaC+rIyebPdXB4LLS1knd6R5aTF4VagVbuARuHxhXQe MnE4sqSpVbsC9J0ecCk5DG6vDUEuJmk8QvDcHOGCdWdZ20CyiUTJrflACB3Me3RnE52B RVTJjQfHTuhgq86UVvyPoUbyFceZb6dA9VFkVBdc1jQd4ObLuIdvPz75yck5CxYo45q/ WV3l4xi2yGy1AIBe2RbmimWgLGRTZ645J5dTw6Vr/z9DOBhesl4fFVkKLADVMddaHrnK A2qg== X-Gm-Message-State: APjAAAWaNmgg9Gm2Icv8rqwUI9n5Q8YGV4wIzJClxstEkuH7Wp/jjbRh hqwT27s4nqOWxCDPAneHZHe5qoVSQ2s= X-Received: by 2002:a50:8825:: with SMTP id b34mr48288557edb.22.1560871338412; Tue, 18 Jun 2019 08:22:18 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id 9sm1439769ejg.49.2019.06.18.08.22.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 08:22:17 -0700 (PDT) Date: Tue, 18 Jun 2019 17:22:15 +0200 From: Daniel Vetter To: Jerome Glisse Cc: Daniel Vetter , Michal Hocko , Daniel Vetter , Intel Graphics Development , LKML , DRI Development , Linux MM , David Rientjes , Paolo Bonzini , Andrew Morton , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH 1/4] mm: Check if mmu notifier callbacks are allowed to fail Message-ID: <20190618152215.GG12905@phenom.ffwll.local> Mail-Followup-To: Jerome Glisse , Michal Hocko , Daniel Vetter , Intel Graphics Development , LKML , DRI Development , Linux MM , David Rientjes , Paolo Bonzini , Andrew Morton , Christian =?iso-8859-1?Q?K=F6nig?= References: <20190520213945.17046-1-daniel.vetter@ffwll.ch> <20190521154411.GD3836@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190521154411.GD3836@redhat.com> X-Operating-System: Linux phenom 4.19.0-5-amd64 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 Tue, May 21, 2019 at 11:44:11AM -0400, Jerome Glisse wrote: > On Mon, May 20, 2019 at 11:39:42PM +0200, Daniel Vetter wrote: > > Just a bit of paranoia, since if we start pushing this deep into > > callchains it's hard to spot all places where an mmu notifier > > implementation might fail when it's not allowed to. > > > > Inspired by some confusion we had discussing i915 mmu notifiers and > > whether we could use the newly-introduced return value to handle some > > corner cases. Until we realized that these are only for when a task > > has been killed by the oom reaper. > > > > An alternative approach would be to split the callback into two > > versions, one with the int return value, and the other with void > > return value like in older kernels. But that's a lot more churn for > > fairly little gain I think. > > > > Summary from the m-l discussion on why we want something at warning > > level: This allows automated tooling in CI to catch bugs without > > humans having to look at everything. If we just upgrade the existing > > pr_info to a pr_warn, then we'll have false positives. And as-is, no > > one will ever spot the problem since it's lost in the massive amounts > > of overall dmesg noise. > > > > v2: Drop the full WARN_ON backtrace in favour of just a pr_warn for > > the problematic case (Michal Hocko). > > > > v3: Rebase on top of Glisse's arg rework. > > > > v4: More rebase on top of Glisse reworking everything. > > > > Cc: Andrew Morton > > Cc: Michal Hocko > > Cc: "Christian K?nig" > > Cc: David Rientjes > > Cc: Daniel Vetter > > Cc: "J?r?me Glisse" > > Cc: linux-mm@kvack.org > > Cc: Paolo Bonzini > > Reviewed-by: Christian K?nig > > Signed-off-by: Daniel Vetter > > Reviewed-by: J?r?me Glisse -mm folks, is this (entire series of 4 patches) planned to land in the 5.3 merge window? Or do you want more reviews/testing/polish? I think with all the hmm rework going on, a bit more validation and checks in this tricky area would help. Thanks, Daniel > > > --- > > mm/mmu_notifier.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c > > index ee36068077b6..c05e406a7cd7 100644 > > --- a/mm/mmu_notifier.c > > +++ b/mm/mmu_notifier.c > > @@ -181,6 +181,9 @@ int __mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) > > pr_info("%pS callback failed with %d in %sblockable context.\n", > > mn->ops->invalidate_range_start, _ret, > > !mmu_notifier_range_blockable(range) ? "non-" : ""); > > + if (!mmu_notifier_range_blockable(range)) > > + pr_warn("%pS callback failure not allowed\n", > > + mn->ops->invalidate_range_start); > > ret = _ret; > > } > > } > > -- > > 2.20.1 > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch