Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp907298ybi; Wed, 19 Jun 2019 09:52:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqygV4KlIBGPWaC15S8ec/nMJIAIos7wgXzpIvjUsoBzxug89fQcqf3njYK0WQCd2aLK2yVE X-Received: by 2002:a65:534b:: with SMTP id w11mr8732364pgr.210.1560963153447; Wed, 19 Jun 2019 09:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560963153; cv=none; d=google.com; s=arc-20160816; b=HT5Syh417ZPrw9E3Op0aF0l+26jMHV6yNrisUp+PcUOGBvn6y3xT6u3gGbxd5ZmhJd TjeYofmDO5lHt3tNj+7fUzdvb+hhX6gnUEjjRyLRe03oRnqtwjBrVRO7TUr5MKIM1xzZ 9Pfj3jzS7A/Gh2XuuEqctkHIjreizi4CDfphFYjQ8FQTfrTvgn4/me46u3lWP1Xx4r57 X8VsDdUTmAbeGTl783zdvM9dhC87+L9B7oWFOnIK7eDstiuUhaAIT9pO6nqMc5tSE58h IiCF736Tc7TTvxJ4S/zXHhH4L4jcAwe1fVHlRbzN2Q7ViUO5q9UoDzc9QCKtnjJMHwHR cl4w== 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-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=qZ7DILVFzp78tcp4G5VOohWGeQIPrvQGvihKnIg9H7E=; b=fkZEfUqZ57BJwnkC+tVIBqz+azAGSHsKQTlbYvUeZdOQcCRzSVOOle87lxp4SAEKOs fvj3p/GH7cxqVrxWcaYmsKV0IJni3e5Z4AqPRYPa3Bo65mkHRwBOxXxshpfogIJxkeKU gRZZv9XcPlRhJ57lvCpdWK3oNoMyeWC7xd1ddlYoj3KouvhOO2NtVv8Y65/7DM+lJxL1 3+Ypc0ePqdltNvxY7E3YvNK9NEUkSAUTQH7cv0GUnAogagsBWbJJgxneL48heD/0op6F p1R2saGBLYSOg6D0baT+6LjQt4pCxlb8HmvTC9CABwRdmEDIT3pL4DDyDI7jS0xsz3D5 VkYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=KMoNMAk8; 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 g10si1769936pjp.74.2019.06.19.09.52.17; Wed, 19 Jun 2019 09:52:33 -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=KMoNMAk8; 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 S1730092AbfFSQu5 (ORCPT + 99 others); Wed, 19 Jun 2019 12:50:57 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:33746 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbfFSQu5 (ORCPT ); Wed, 19 Jun 2019 12:50:57 -0400 Received: by mail-qt1-f193.google.com with SMTP id x2so20767601qtr.0 for ; Wed, 19 Jun 2019 09:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qZ7DILVFzp78tcp4G5VOohWGeQIPrvQGvihKnIg9H7E=; b=KMoNMAk8Ui9/LtKeNa7HIyVKWhexKtOyUwM0YsZQI+1McUXlVPzPHPca+hUWtgwo/6 03T2AvAUYyMxuNukN8dIy79whNPI9nkupfg9cH6LdySpEzUgauwhQFADzdyRe4Hvu1pY fDPLXTlCjygXw/QMhggf2P4CsbK4+s0v1QuBXUz4vFWJeGTQZFX/hUl7EC5MO9D/u2Xs NbXmeZUZ9Rt9lNVx3eXE/mU35xwWdDiw3jHn52j89OeRFlTDfy6CEZ1RraQEIP19d7mm VyWkyW+DGheaUcNRMXcsg92KDqLEdhfiLfFXP/kmU/pLCATJWbXUUz0VDhB0JqXgdvW1 UIiQ== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qZ7DILVFzp78tcp4G5VOohWGeQIPrvQGvihKnIg9H7E=; b=d78jfzMJdDjoNpM/eKgaLX6tHo6B+g0vwwpAMPCvM9gf21y4T+b6I/jR77GNCJAHmo LcvupxS1RdOiI+D4di9/XDsHwT5lB7mN8zHLIAijiqlYFN/Ho/loKheQHFdA/r13SYaa 4UWK752WqsLQY0sORGN02cRnUtet1ceWvI01QimcNh14mmjxZrJCGcOwX0sllD0Fd8lA yx/e1kTDi6bfMcv8yi5sHjDf9dvSnJq2/ASswudce3LTC0vSaFyyjoaUgeqFogMA99vw r7y7yYX+V2il4xgfPXeWjgLv7FN7nYZoc1zbZDRQ2/FNB4dDPQK1XqGYxtlmoOCr+DZB vM+g== X-Gm-Message-State: APjAAAV/wmVKSsW05gyjBsrFSCwM0NZRkksCt5UBsN1LeaX5RD4t6Qj3 PoiOTBDiFHNG1IOQWgjfkjV0+w== X-Received: by 2002:a0c:e6a2:: with SMTP id j2mr32663508qvn.190.1560963056606; Wed, 19 Jun 2019 09:50:56 -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 m44sm14096849qtm.54.2019.06.19.09.50.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Jun 2019 09:50:56 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hddnT-00022a-N7; Wed, 19 Jun 2019 13:50:55 -0300 Date: Wed, 19 Jun 2019 13:50:55 -0300 From: Jason Gunthorpe To: Jerome Glisse , Michal Hocko , Daniel Vetter , Intel Graphics Development , LKML , DRI Development , Linux MM , David Rientjes , Paolo Bonzini , Andrew Morton , Christian =?utf-8?B?S8O2bmln?= Subject: Re: [PATCH 1/4] mm: Check if mmu notifier callbacks are allowed to fail Message-ID: <20190619165055.GI9360@ziepe.ca> References: <20190520213945.17046-1-daniel.vetter@ffwll.ch> <20190521154411.GD3836@redhat.com> <20190618152215.GG12905@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618152215.GG12905@phenom.ffwll.local> 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 Tue, Jun 18, 2019 at 05:22:15PM +0200, Daniel Vetter wrote: > On Tue, May 21, 2019 at 11:44:11AM -0400, Jerome Glisse wrote: > > On Mon, May 20, 2019 at 11:39:42PM +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). I disagree with this v2 note, the WARN_ON/WARN will trigger checkers like syzkaller to report a bug, while a random pr_warn probably will not. I do agree the backtrace is not useful here, but we don't have a warn-no-backtrace version.. IMHO, kernel/driver bugs should always be reported by WARN & friends. We never expect to see the print, so why do we care how big it is? Also note that WARN integrates an unlikely() into it so the codegen is automatically a bit more optimal that the if & pr_warn combination. Jason