From patchwork Thu Oct 25 14:35:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10655901 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 DAA5114BB for ; Thu, 25 Oct 2018 14:35:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA97C2BC1B for ; Thu, 25 Oct 2018 14:35:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEE482BC39; Thu, 25 Oct 2018 14:35:40 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 852D42BC1B for ; Thu, 25 Oct 2018 14:35:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B29E66E1F0; Thu, 25 Oct 2018 14:35:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A06A6E1CE for ; Thu, 25 Oct 2018 14:35:35 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id e2-v6so8725172edn.2 for ; Thu, 25 Oct 2018 07:35:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3xoPohRkDcGEQr1U4IOTikUpxc7yt3hbhTrZwxxhl0o=; b=f+udKbeZY4jXVX0Hl5kp1g64hYmLAU9SjuhUmj2tNCjdTq6HARrnEV6e6R60+J5CPM 9/do9S/mT9TRHCQyFdQAvb7naJyVcNBwo5FQUJ9L0iUrGi/05ZoSEcWeh4VsOi4okuBk dqv58yd76MIg5exAqLnZEP9Y8uZQQUBBPF7EfShvzYcwJnT2mY0RYYluaDfJFJ/qvpG+ A6vNNPF5djRohG9IngKFN9oFOwvUsvM8uVglsa6KkgjJjVeC9SPlyOvKy4dTbtL2YmHi oENs5ot2aXlOsGGzHclPvPvXQI48LIrGF6+SGsH0q/pMJKSfWFmI/hQPTKFdPonKBM5P ZtWQ== X-Gm-Message-State: AGRZ1gJbh/4tl/CfUDlD6henQFWQ5/DgkpXAM6x2C9kSOTLGKgRqwuc9 bnOz8Vr1SZRQ65jTBeshvMUL4w== X-Google-Smtp-Source: AJdET5cn/05Q+gEAAgIdLsvwxLXGQrH7kGnUWf5zbXz41yuL4D1y8lGZklDZyswWWNo8tsHJB3U3Ww== X-Received: by 2002:a17:906:4ac4:: with SMTP id u4-v6mr1367190ejt.202.1540478133690; Thu, 25 Oct 2018 07:35:33 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id k51-v6sm124353edb.85.2018.10.25.07.35.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Oct 2018 07:35:32 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Thu, 25 Oct 2018 16:35:21 +0200 Message-Id: <20181025143527.8575-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/6] attempts at catching mmu_notifer deadlocks X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, So this is my 2nd attempt (more successful I hope also with CI) at catching the mmu notifier deadlock using lockdep. Ingredients: - cross-release patches resurrect (so that lockdep see through flush_workqueue). - fake lock context for mmu notifier callbacks (similar trick to fs_reclaim) - bunch of sanity checks because hey! paranoia is good Intentionally not yet submitting to core/mm since I want to figure out whether this is indeed useful for us first. Cheers, Daniel Daniel Vetter (6): locking/lockdep: restore cross-release checks kthread: finer-grained lockdep/cross-release completion lockdep: Remove GFP_NOLOCKDEP annotation mm: Check if mmut notifier callbacks are allowed to fail mm, notifier: Catch sleeping/blocking for !blockable mm, notifier: Add a lockdep map for invalidate_range_start .../admin-guide/kernel-parameters.txt | 3 + Documentation/locking/crossrelease.txt | 874 ++++++++++++++++++ include/linux/completion.h | 46 + include/linux/gfp.h | 10 +- include/linux/irqflags.h | 4 + include/linux/kthread.h | 48 +- include/linux/lockdep.h | 127 +++ include/linux/mmu_notifier.h | 7 + include/linux/sched.h | 11 + kernel/kthread.c | 68 +- kernel/locking/lockdep.c | 652 ++++++++++++- kernel/sched/completion.c | 5 + lib/Kconfig.debug | 33 + mm/mmu_notifier.c | 17 +- mm/page_alloc.c | 3 - 15 files changed, 1832 insertions(+), 76 deletions(-) create mode 100644 Documentation/locking/crossrelease.txt