From patchwork Fri Sep 6 17:47:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11135765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87E0E1599 for ; Fri, 6 Sep 2019 17:47:41 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FD4D20640 for ; Fri, 6 Sep 2019 17:47:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FD4D20640 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E9996E326; Fri, 6 Sep 2019 17:47:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACBE36E326 for ; Fri, 6 Sep 2019 17:47:37 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id v38so7027947edm.7 for ; Fri, 06 Sep 2019 10:47:37 -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=AXnjF1eMA0qvhNi+oaAvRaU1Op/sm6+LQv/OHFTjjBs=; b=BWCFQnPlo34lLBxfMjkSbbpkYJRS2yY8UV32uT8tgCYeTc0FFERN11XXGl812tGi4s /beZKq1bhsziOE/YOguBXZIMP7PpyYszz10Os9eAGwQaje7wW7AFL4vkhfF0b/Z75/eJ tyOY1y7TTlqastLmmJBUtty6TeJtNWummwtEDzcOaxYOX1xR7vjHhk4RQyncL3no6BAR lFA1QOWrYpJb+lmOe3LCEBHN/5aiT7su3RmAF7qM/+XDAUa9gBhJpS2UYo2fA1gauTGG X+OVyNyUKijSDDg53ephmO5hSw9nVYzgp6e+AKkbK8CLRA8UrMsEjQk5Ien4WyTgImuy QLSw== X-Gm-Message-State: APjAAAWcEaAeyThZ26XcC/OFRlidKhBlNHEQtkQsccKOQyy/RZkk8JEJ nPToUvTCDULthubg4sRFmHy2dg== X-Google-Smtp-Source: APXvYqyXNSoipVDK3YxyEJ0q0hqumo6vbP/ePP5SeWNLJC+mFFPaXXQumLn2z+pO051A2VuoAWL5CA== X-Received: by 2002:a17:906:8158:: with SMTP id z24mr8426652ejw.54.1567792056188; Fri, 06 Sep 2019 10:47:36 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id m14sm537241edc.61.2019.09.06.10.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 10:47:35 -0700 (PDT) From: Daniel Vetter To: LKML Subject: [PATCH] mm, notifier: Fix early return case for new lockdep annotations Date: Fri, 6 Sep 2019 19:47:30 +0200 Message-Id: <20190906174730.22462-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Mailman-Original-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=AXnjF1eMA0qvhNi+oaAvRaU1Op/sm6+LQv/OHFTjjBs=; b=FRjTuqf9guqExV42vYGxD/fiJVxgZg0XxcBoMZkO3y4QM+JRyu5YDuJcT8dY4cwVtT 6/DchteyEMWB7Egugye1ennPXOFn5/y55kWgyjVlAxTOzKoAeV3mZZ1vkODIu9aV6ZZ/ wPg7BapUpyEmLjNdij5gnkTUktJpuxzhSOXy4= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Philippe Brucker , Ralph Campbell , Michal Hocko , linux-mm@kvack.org, Daniel Vetter , DRI Development , Jason Gunthorpe , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , Sean Christopherson , syzbot+aaedc50d99a03250fe1f@syzkaller.appspotmail.com, Daniel Vetter , Andrew Morton , Ira Weiny Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I missed that when extending the lockdep annotations to the nonblocking case. I missed this while testing since in the i915 mmu notifiers is hitting a nice lockdep splat already before the point of going into oom killer mode :-/ Reported-by: syzbot+aaedc50d99a03250fe1f@syzkaller.appspotmail.com Fixes: d2b219ed03d4 ("mm/mmu_notifiers: add a lockdep map for invalidate_range_start/end") Cc: Jason Gunthorpe Cc: Daniel Vetter Cc: Andrew Morton Cc: "Jérôme Glisse" Cc: Ralph Campbell Cc: Jason Gunthorpe Cc: Ira Weiny Cc: Michal Hocko Cc: Daniel Vetter Cc: Sean Christopherson Cc: Jean-Philippe Brucker Cc: linux-mm@kvack.org Signed-off-by: Daniel Vetter Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand --- include/linux/mmu_notifier.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 5a03417e5bf7..4edd98b06834 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -356,13 +356,14 @@ mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range) static inline int mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range) { + int ret = 0; lock_map_acquire(&__mmu_notifier_invalidate_range_start_map); if (mm_has_notifiers(range->mm)) { range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE; - return __mmu_notifier_invalidate_range_start(range); + ret = __mmu_notifier_invalidate_range_start(range); } lock_map_release(&__mmu_notifier_invalidate_range_start_map); - return 0; + return ret; } static inline void