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: 11135763 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 ED76B1599 for ; Fri, 6 Sep 2019 17:47:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA56F208C3 for ; Fri, 6 Sep 2019 17:47:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="FRjTuqf9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA56F208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F07D66B0005; Fri, 6 Sep 2019 13:47:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EB9096B0006; Fri, 6 Sep 2019 13:47:38 -0400 (EDT) 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 D802C6B0007; Fri, 6 Sep 2019 13:47:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id B46AD6B0005 for ; Fri, 6 Sep 2019 13:47:38 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 693D155F94 for ; Fri, 6 Sep 2019 17:47:38 +0000 (UTC) X-FDA: 75905228196.27.brick56_868e9f437d08 X-Spam-Summary: 2,0,0,4f073816a8970f62,d41d8cd98f00b204,daniel.vetter@ffwll.ch,:linux-kernel@vger.kernel.org:dri-devel@lists.freedesktop.org:daniel.vetter@ffwll.ch:syzbot+aaedc50d99a03250fe1f@syzkaller.appspotmail.com:jgg@mellanox.com:daniel.vetter@intel.com:akpm@linux-foundation.org:jglisse@redhat.com:rcampbell@nvidia.com:jgg@ziepe.ca:ira.weiny@intel.com:mhocko@suse.com:sean.j.christopherson@intel.com:jean-philippe@linaro.org:,RULES_HIT:41:152:355:379:541:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1431:1437:1515:1516:1518:1535:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:3874:4321:5007:6261:6653:6742:10004:10400:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12679:12895:12986:13069:13221:13229:13311:13357:13846:13894:14181:14394:14659:14721:21080:21444:21451:21627,0,RBL:209.85.208.68:@ffwll.ch:.lbl8.mailshell.net-62.14.0.100 66.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,Doma inCache: X-HE-Tag: brick56_868e9f437d08 X-Filterd-Recvd-Size: 5017 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Fri, 6 Sep 2019 17:47:37 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id a23so4791254edv.5 for ; Fri, 06 Sep 2019 10:47:37 -0700 (PDT) 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-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=sea72Qupym6w5IMCziuQ7X10OFuQ0st8NSPzIsZlnKZFQI/SAaE7EeZVIFC/noNQI2 MF++6w9nCSPi/AkDNR5/tq77+omk1m3NpnicvFTnTeBkfuEac9crfKkKmxnQp7I2JkYh wBFkhBELAEoeJyAFOlYvjDHl7DZITzRpWFAUS7C/AlDp323ugzu4R74BPVwJFigXwDa1 EdKcpRYUHjrBPwyQDBf6VwiuTHMFbEcTEAjsBAwb3XPwTh/I8JKV0cfZDNYczcloX2GP Qj+8zL7DDD83qpvgi8bNRWWiP3lH3GDrw2LKGCzZ+EvvQHfwRviCiNrMxeBGDPvCaI2g XeYA== X-Gm-Message-State: APjAAAUG0e+u0BJCrdpLpNV29vLkrowSbCtvC9yp5Cj0MulG6FlTx0nP MPJBhXQTUOBViZXRKlsaIMZizA== 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 Cc: DRI Development , Daniel Vetter , syzbot+aaedc50d99a03250fe1f@syzkaller.appspotmail.com, Jason Gunthorpe , Daniel Vetter , Andrew Morton , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Ralph Campbell , Jason Gunthorpe , Ira Weiny , Michal Hocko , Sean Christopherson , Jean-Philippe Brucker , linux-mm@kvack.org 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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