From patchwork Thu Nov 22 16:51:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10694501 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 0342615A7 for ; Thu, 22 Nov 2018 16:51:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E60A82CC3A for ; Thu, 22 Nov 2018 16:51:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E441A2CCC3; Thu, 22 Nov 2018 16:51:19 +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 7295D2CCEF for ; Thu, 22 Nov 2018 16:51:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 681366B2C38; Thu, 22 Nov 2018 11:51:16 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 634546B2C39; Thu, 22 Nov 2018 11:51:16 -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 3EDF76B2C3A; Thu, 22 Nov 2018 11:51:16 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id D77B96B2C38 for ; Thu, 22 Nov 2018 11:51:15 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id l45so4780037edb.1 for ; Thu, 22 Nov 2018 08:51:15 -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:in-reply-to:references:mime-version :content-transfer-encoding; bh=35SA+A3zSGOUwg2DuEDiDQyYR9o/qAXgi6nZL2aj8/Q=; b=UwUMkkiMjoiEMQFCjc3zZTumP+oPh34mR9axJtTVnU7GrXAHe63T7GqS3NlVoEf2Q8 LoW89vywgMX8nyOvstBzZ00EtIFnXmt8D6NrMBVOSLJOOknE/6Ze3RWRtWhMRm+xUmB6 wAzJZlDEgmJEFgAjQmYHGGodgyCfmCctUu+qS9FrQPni2erDGuY4D6btJN25gZ0sUMqL KN/8F5lHgwDXCWIFA2L30oLi8J+LD5AW6QuHxM/I85BWpQDgUN6wvWMSguys4nNPKZQg 2wU7FV9cmw6fTUgDvoJFHkdvLcxQR3IMsQDId1tTf0AL6NxLt94vk3tpcjZd2onll4pM nGzA== X-Gm-Message-State: AA+aEWYnGm6OIAlvsYPySEg3UjbXSLmX5j4rwO34lw7grkaqrt2qolOz axIRUd5klJaS2cOccHdDLWHGUS+J+Bndl82gXmBXKZcluNXa2dyjj2ls3kXjzON6/UPIxTWFZ3m TI1VgV9yP16auV9ydG1YDn4q2DvzaLLvEy5EUOd0HuV8NgUfVspmzdJ/6HaJ4uGv1wTdDPJwlvn YrD+mtZ9IM0TnCqYVAxSZcxLNIWJZivIJZ8F2RT7U4DDLDXp8N03wZv2794pHywFng6hKbn1/hr AUdfc+P4cd1pA5LgWkSgtmHyU3BVZGIctQyl0BF0BAABzVloJSOtNj2pJYMMoFT7t1mvgofUACd 6233ltj3WlUhwYbAdpBlMS7kr1RlJtuD4GbXXEU/IWRPImz1amMx3uzMNtdeG9EqBFw5gNLp+eK P X-Received: by 2002:a50:b3b8:: with SMTP id s53mr10215649edd.122.1542905475399; Thu, 22 Nov 2018 08:51:15 -0800 (PST) X-Received: by 2002:a50:b3b8:: with SMTP id s53mr10215612edd.122.1542905474570; Thu, 22 Nov 2018 08:51:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542905474; cv=none; d=google.com; s=arc-20160816; b=iLb/AuuUXALwTFUAXFk9EnCFk4B2l8bj+kDvWV9AY8dpWl073GV74oyEz8bqpE4Zmj Z5sMC9RQgBFOvaYZTsA1l8q+AEfS+ZrVthQd9zBtlI+yYwzMMGurVe7yKTvdDYnt0vh5 TblVMo9MNBWkBBAyj9pAJrGOXG+5ep75wWYImslaUutjqqb9sCv+oU3HgmGAqdqY0GmH 7YbPrTWY77XK71meh+3peAhsAgqv/xHFkbhyVPDIDZE1wZYVWiLlwDBxfPJm6sE445mV mwgnzTK6pc1P5Yo1+ccI4nIl+2Oorw9HRKnZi8kJEXPMpymURg9HuSo4554Hs51eFEwL I7Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=35SA+A3zSGOUwg2DuEDiDQyYR9o/qAXgi6nZL2aj8/Q=; b=Og8s17vELuJvoY5ZQfKNuLA6z2B/Go88wyqVJpTebJkrNvYae1tXtsIQzvzKT+7wcs Ql7HY6XTuLC+CkM66gih+pE9eEM5o/Yjtn5+z03yhRGxKAxAS1DwpIE7dipBXs5pzrfp Wd5PWo3Esn5UstJLcT0rwVQ6ATX6Vjy9bsGAi+X+h1sgNu9bEx4T8ZPLAiptxvOlkL63 uJ2aztqbfsfeUYWcV1XEuNxQTLQ2VdpE+avp0qeQqowFVmnhrPPK3JBhv48lMFsBoufL v+yP6a2RBJTkAS3UpDRU0qUpefeIYOC7Er/2Rnb/nqfhVak3jv7+OMA34kmP8x5IYZWQ Wmrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=T6LI94Z0; 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 p16-v6sor25801703eds.29.2018.11.22.08.51.14 for (Google Transport Security); Thu, 22 Nov 2018 08:51:14 -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=T6LI94Z0; 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=35SA+A3zSGOUwg2DuEDiDQyYR9o/qAXgi6nZL2aj8/Q=; b=T6LI94Z0asV3yzmoBf2IesRD6VsGBDpIYF984cFK/5uoflQEU62+7Gv+8nL8dSimEH VVRZdWL4nrC7LT8+R6AClQYQf+KnkfZA92h+SBHYngfeeoFcXGNrLQCHsLR54Vv7Llds ZElU3K4qoo2YLnpkZIDN5WzFwtGdErLMEcxIg= X-Google-Smtp-Source: AFSGD/UaEjvJQp9C/3K0fUJG/8rVELf5/0i7gzNYdUB5+WGaWrnZRqdyJkJ9AKcGEmio8EYKSuwHCg== X-Received: by 2002:a50:bdc8:: with SMTP id z8mr3626337edh.46.1542905474153; Thu, 22 Nov 2018 08:51:14 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 08:51:13 -0800 (PST) From: Daniel Vetter To: LKML Cc: Linux MM , Intel Graphics Development , DRI Development , Daniel Vetter , Andrew Morton , Michal Hocko , =?utf-8?q?Christian_K=C3=B6nig?= , David Rientjes , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Paolo Bonzini , Daniel Vetter Subject: [PATCH 1/3] mm: Check if mmu notifier callbacks are allowed to fail Date: Thu, 22 Nov 2018 17:51:04 +0100 Message-Id: <20181122165106.18238-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122165106.18238-1-daniel.vetter@ffwll.ch> References: <20181122165106.18238-1-daniel.vetter@ffwll.ch> 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: X-Virus-Scanned: ClamAV using ClamSMTP 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. 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 Signed-off-by: Daniel Vetter Acked-by: Christian König --- mm/mmu_notifier.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c index 5119ff846769..59e102589a25 100644 --- a/mm/mmu_notifier.c +++ b/mm/mmu_notifier.c @@ -190,6 +190,8 @@ int __mmu_notifier_invalidate_range_start(struct mm_struct *mm, pr_info("%pS callback failed with %d in %sblockable context.\n", mn->ops->invalidate_range_start, _ret, !blockable ? "non-" : ""); + WARN(blockable,"%pS callback failure not allowed\n", + mn->ops->invalidate_range_start); ret = _ret; } }