From patchwork Thu Nov 22 16:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10694495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E48041709 for ; Thu, 22 Nov 2018 16:51:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D33C12C76A for ; Thu, 22 Nov 2018 16:51:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D15392C8B1; Thu, 22 Nov 2018 16:51:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 414EB2C8C2 for ; Thu, 22 Nov 2018 16:51:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 411086B2C19; Thu, 22 Nov 2018 11:51:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3BFEA6B2C38; Thu, 22 Nov 2018 11:51:15 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B0E16B2C39; Thu, 22 Nov 2018 11:51:15 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id C4A536B2C19 for ; Thu, 22 Nov 2018 11:51:14 -0500 (EST) Received: by mail-ed1-f70.google.com with SMTP id n32-v6so4706286edc.17 for ; Thu, 22 Nov 2018 08:51:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:mime-version:content-transfer-encoding; bh=13pJYVMGB9tCfD3Cs0rY/5holFbqjrE34OgSpt8Zcuc=; b=lNxH9GOnIOTsCmEbxGanRtWstGQoGcdGB8GJiq9w2+r+6cyUVd5gaVu3u9D6mQV53D aOueQQW22MpwQOyMDm5beSKva/KLVauOU2ftCA4dMLHpE7i1ZFuty0j2PtjFIVbD1kDp 8vY22Nk9Ee1JFzWQD6M+zGybBuchCYD0TcBp/v8aKP6ftXjHDD8bss2p0oGQSuxKWHNp ckxu4CU8GHGzGIJwxAbKJb/TDClUI5Ct2n9EbQrQse0NXBNRwUxv8nNTtM+RH/ym3E/e rmj1kyI1CrdLT65pTB40+RBI/9hS7YfdBEADzortjZBU/KWbicEJW10eVCdVWj13DSiR DXfg== X-Gm-Message-State: AA+aEWZ+JTniYdWE71b4KfSJLkhrfzpD1IQIlfNztRWu8pVvscmVp5us PhMS8Y3zDreDnqgICprAJ7mJ6QCrKHHJIYhN3ent7/F3Dmd0hFUpK4//BADRyikBKEtFnN1cFYm +gnm3+WyBVi8E9v3Z28BePxTmF+H7uI9oXqvSiDg2ynJF/5B3p27/03Qrj+CyJmGiDTuxpfYyzM dn047NrxvXeN2bPbA8uRN/0DrsFudaUHExAK0Hj09Fjy2DXuk4U95JylgkWsn9QzsQFCOQUNmC7 GojO0F7W1nTKiHSd7HV/ieFyewOJMuUf4xcZ25CVpTLkhb2rY81PHVl+NauV+4eBA+k61HLoIas /cRpI7isxqM+8HPCXktI1/7xJSNKKC9W3bqJAsR9yLpFYvdNn7vcFXaM1tBJDBnNY/rTUatw0zd E X-Received: by 2002:a50:9849:: with SMTP id h9mr9548804edb.36.1542905474310; Thu, 22 Nov 2018 08:51:14 -0800 (PST) X-Received: by 2002:a50:9849:: with SMTP id h9mr9548762edb.36.1542905473307; Thu, 22 Nov 2018 08:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542905473; cv=none; d=google.com; s=arc-20160816; b=YGEAKNAKW3TjSI9RvDpmtfXeOvzFJLZv7grVmO9rwb9TpTB/0Yot9n3Qe7zyJ78e1W DFQdmuyEvyD8CDMQtmITLQdGJyyNAS1FIx5JiL5r17m1swvt8dpoRh8nd1rlllM0+Tuo nGJWR5DSBcYTCA36YJohCFY/1cpU2zxM0rz1LKDFHa184detbF6ZdcrSyTEpKbkT/y7v 4mMlUpwbE0EYjvQ1ONhuH1PN7lF1ImJwcj18MWpk9rexnAlzSyT+vcPkX0Pe5OuHiEmm Vd/q6hXKHYV4xfk3gGowZCo12yRPxIG2xLEmdpCzpOqdsZolxbU/d4g6Di7cY7EcRUKv B3WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=13pJYVMGB9tCfD3Cs0rY/5holFbqjrE34OgSpt8Zcuc=; b=u3pBTugjaLchDA/Qw23kBVDxXIvU7kkk3eavHx56vR2egViqF6xlVW4dEqWOH9jNt2 j1qfAPjpzubdlztXXl6MN/Exvc6pocvNcXAgAqdOGZXdirYTh7MOXjTyEpcB6fCBVATc kbs+aY+UZZThnxUQsHAMFzAcp/eRLBWwfto9/ZouBOuKeWAWfi+PrlHgDGMCYtVEYvXS XQvJbiQ4s8iVgfa3wh2ZdD+7Fy/1ltXt92LdJc8cmlzFwXuT2ksj/A72PawzhfKrbznm z283Ej2PSlkA2NILi4JvMuaSjkkbYC93H4nIwUuoWalfum/epbtMQpqHOhp/wwNLKXqg XXVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=SD1vfvUC; spf=neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of daniel.vetter@ffwll.ch) smtp.mailfrom=daniel.vetter@ffwll.ch Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x9-v6sor1058377edq.14.2018.11.22.08.51.13 for (Google Transport Security); Thu, 22 Nov 2018 08:51:13 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of daniel.vetter@ffwll.ch) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=SD1vfvUC; spf=neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of daniel.vetter@ffwll.ch) smtp.mailfrom=daniel.vetter@ffwll.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=13pJYVMGB9tCfD3Cs0rY/5holFbqjrE34OgSpt8Zcuc=; b=SD1vfvUC3PH6eSRNSTvtqWtZMSJbRv9QbHtEFwa5B6W3uCi5N752BXBv/RsKp+S8rs l22gARMIsjkqE/g2R+4k9u0X7YGS8g3vwkLqGQnl1P5gCxbO2mnuRqYYOTBwuwmOtg50 TmckAElAHf2hVm7Q8zaTFIcW5HNcgO5JtvV3U= X-Google-Smtp-Source: AFSGD/ViGtkqcW7sn54Rl1zvogaQNfMRvBp6pk2KuDbn13KpCSNlRZK81jLa0PJTZ7xaoiLTpsfMKA== X-Received: by 2002:a50:f489:: with SMTP id s9mr10020576edm.101.1542905472847; Thu, 22 Nov 2018 08:51:12 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id s12sm12914780edb.43.2018.11.22.08.51.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 08:51:12 -0800 (PST) From: Daniel Vetter To: LKML Cc: Linux MM , Intel Graphics Development , DRI Development , Daniel Vetter Subject: [PATCH 0/3] RFC: mmu notifier debug checks Date: Thu, 22 Nov 2018 17:51:03 +0100 Message-Id: <20181122165106.18238-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000017, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Hi all, We're having some good fun with the i915 mmu notifier (it deadlocks), and I think it'd be very useful to have a bunch more runtime debug checks to catch screw-ups. I'm also working on some lockdep improvements in gpu code (better annotations and stuff like that). Together with this series here this seems to catch a lot of bugs pretty much instantly, which previously took hours/days of CI workloads to reproduce. Plus now you get nice backtraces and the kernel keeps working, whereas without this it's real deadlocks with piles of stuck processes (the deadlock needed at least 3 processes, but generally it took more to close the loop, plus everyone piling in on top). If this looks like a good idea I'm happy to polish it for merging. Thanks, Daniel Daniel Vetter (3): mm: Check if mmu notifier callbacks are allowed to fail mm, notifier: Catch sleeping/blocking for !blockable mm, notifier: Add a lockdep map for invalidate_range_start include/linux/mmu_notifier.h | 7 +++++++ mm/mmu_notifier.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-)