Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1189321ybl; Fri, 16 Aug 2019 10:20:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMB0AGNb1VnGf+e7Qh3UZ4XuCMZrmeXHTvBUvbaVPqul0fK8T+XG8/z+8M+KduQ6o/HrEG X-Received: by 2002:a63:607:: with SMTP id 7mr8669428pgg.240.1565976000692; Fri, 16 Aug 2019 10:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565976000; cv=none; d=google.com; s=arc-20160816; b=JxLZaexi3r0TDtPZJncsIpezsF7S61KfCDJPJPqQdjinCv20gJLyAI0w53F8PaJmDS 6zjqMHZ/j4w0+XliQ5ZVSHCuFHDOHprW6IQ9zcik6P8ulLRuAdbLpxqhKDrYCb+iQiMi TcetpgtVoMc8Nyn5zGgjeuL25CReWyFMS7GLc/xKM+EE6Y/F8jk1ldt/IlbVZNVSz2+s MIyY0MrFYwKklUv5w9zXoRcqn939+aeBPN88lXfCrq3qVpyNa0Tc1BzDfTyOM4xusH0T +x1HxS0wYMiiJRMj9foK+XtkYwTH3a7hsh/QFf68y3EP9NWuMZXsSvchTC+aYaET4YYI 1x0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aAuJkx3tYtzzL6W59IWOcvDtZCZIe1mJoCimZUlEFnw=; b=ZcJzKlrmnPrXhCbbqm3OlswbMGqNu9sXBfNUauY20v5SEDc2XobFQRmcBRrf5t28Ir rZgERTCI5c7YxcKQd8QtSr61jeWxyhpCVk2pQ6zSGLHK/O9L23PjZC8a7n++KcB7Q3xj AiaaWA9d7iqSubwGVAxhxfyQkrYJCaDKElO2tC8uCBLbVVt1QAE8UP0wmFQbh5vtGYYi yM88y65UQ/WLMZceFD6DKYATcIcHTqxSx3VMb4CAMKUjfuXDAozxtQw6VFjo3+pXoyi5 vzLw7Odb9NlROu67HUAGwrqeQaeytomTnrM69LDKustuPGElr7vCt5FVWcRWip07+v9T Fzew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kbat1qAe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u38si4268802pgn.79.2019.08.16.10.19.44; Fri, 16 Aug 2019 10:20:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=kbat1qAe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727493AbfHPRTH (ORCPT + 99 others); Fri, 16 Aug 2019 13:19:07 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:37042 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727302AbfHPRTG (ORCPT ); Fri, 16 Aug 2019 13:19:06 -0400 Received: by mail-qt1-f195.google.com with SMTP id y26so6876621qto.4 for ; Fri, 16 Aug 2019 10:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=aAuJkx3tYtzzL6W59IWOcvDtZCZIe1mJoCimZUlEFnw=; b=kbat1qAeKGkrmhubzeBSEX8UlXXey9lnVfQ/Vx0g766LW7GP2lpryQR7t+0vkFRRGb Jbg7BZUZkb7DQaUs/r2IBK+ejH2xzPCnmBv1XUEwYR4RJushKgYjcaKQFI1RQe5rxK2u iur/yAF+59Yi7khOcb0j1JRo9YgGqPOFo6YmToQ8a2GmkZUYQJzcSUeijq+xHVelXCf1 SOBFkRoNZd6kH5Ae3nP7KGtraL7KLomnzgXBrJ+y2e8mrPRSpM/Bdc74HMV39ga4awdz VMW6PcO2Z8gNJRCIQXyLtl+PzOxTnwGROhY174YQjkrcOzSPj7hlg9pNW9UlEhadULXM hQ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=aAuJkx3tYtzzL6W59IWOcvDtZCZIe1mJoCimZUlEFnw=; b=QIWK/wWSU5aUk7FnJqYOKWObTMxOayPP2zSXOcG1K8YXr5iX1SXw0G6sy9GmlKP+72 TWpwa6/OYWxh2yjNc8joFrJv94O606guqGk7iVegvXXnYrexTNFXw8CD/qPyDiw74jUo vnS4Np0TA6BnGE10ah2roYOrTW972Huk2BdREB1AFKON5Qzj/TKp1ORc8Q8Ux8ovGk/z w8ApsxPqwxPJoc2xSwuxD77nYkRjG4kfh/QrKLTPY92/QLKkzskLRvoBRCxnIFtXjkT2 ryO0V9svdT+PG/kabFGQdCOoYB3Co0ujQM3ENfNRK11sCCLr86eERVXgUsWOOBwPoJFG xQIQ== X-Gm-Message-State: APjAAAXvu8+bB4azA7ZagBj5XTk62BYyD0Di7WiGwh/s0UOiPH8xsj+B pvEvCmQxlhxT+8jMRS2U5K5zew== X-Received: by 2002:ac8:450c:: with SMTP id q12mr9723027qtn.298.1565975945646; Fri, 16 Aug 2019 10:19:05 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id f133sm3160880qke.62.2019.08.16.10.19.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Aug 2019 10:19:05 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hyfsW-0000pk-Hu; Fri, 16 Aug 2019 14:19:04 -0300 Date: Fri, 16 Aug 2019 14:19:04 -0300 From: Jason Gunthorpe To: Daniel Vetter Cc: LKML , linux-mm@kvack.org, DRI Development , Intel Graphics Development , Andrew Morton , Michal Hocko , Christian =?utf-8?B?S8O2bmln?= , David Rientjes , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Paolo Bonzini , Daniel Vetter Subject: Re: [PATCH 1/5] mm: Check if mmu notifier callbacks are allowed to fail Message-ID: <20190816171904.GA3166@ziepe.ca> References: <20190814202027.18735-1-daniel.vetter@ffwll.ch> <20190814202027.18735-2-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190814202027.18735-2-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 10:20:23PM +0200, Daniel Vetter wrote: > 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. > > Inspired by some confusion we had discussing i915 mmu notifiers and > whether we could use the newly-introduced return value to handle some > corner cases. Until we realized that these are only for when a task > has been killed by the oom reaper. > > An alternative approach would be to split the callback into two > versions, one with the int return value, and the other with void > return value like in older kernels. But that's a lot more churn for > fairly little gain I think. > > Summary from the m-l discussion on why we want something at warning > level: This allows automated tooling in CI to catch bugs without > humans having to look at everything. If we just upgrade the existing > pr_info to a pr_warn, then we'll have false positives. And as-is, no > one will ever spot the problem since it's lost in the massive amounts > of overall dmesg noise. > > v2: Drop the full WARN_ON backtrace in favour of just a pr_warn for > the problematic case (Michal Hocko). > > v3: Rebase on top of Glisse's arg rework. > > v4: More rebase on top of Glisse reworking everything. > > v5: Fixup rebase damage and also catch failures != EAGAIN for > !blockable (Jason). Also go back to WARN_ON as requested by Jason, so > automatic checkers can easily catch bugs by setting panic_on_warn. > > 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 > Cc: Jason Gunthorpe > Signed-off-by: Daniel Vetter > --- > mm/mmu_notifier.c | 2 ++ > 1 file changed, 2 insertions(+) Applied to hmm.git, thanks Jason