Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp764437pxb; Tue, 2 Feb 2021 17:59:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTXNbTWX0DWvJ4Wg8NicGaSbJB6zityinNWPCeECmq7jl+aox9Y0ujhqC5OcELGtoejRxB X-Received: by 2002:a17:907:10c1:: with SMTP id rv1mr924780ejb.74.1612317575983; Tue, 02 Feb 2021 17:59:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612317575; cv=none; d=google.com; s=arc-20160816; b=JgxQqX9cK0Eot/FS8FAgJkL4GVDsxIg7dKhwVyv+kmefjGXepLW4pBlPp6LzTmPIqu tboGICNvt0DJp+jsgUK0WkOvw65bzEpZADqjBZ2DV1EyybQuV5m13/AdyYjolr9gvOhk 4vVhdmb8gkogxuLxXR/4bdJ6fzgFhz9Dg5KDCfRv/N0p4LISOzuqaljylp+TJodrSEEW 7qxE1QwfESITuGeeReq/VV/jyfo4wCRz6vHP0Ra1DwU6cAUPLYh2ayHCHJ1EYVsvGYgJ 4nfe87WEJb7VvhV9I7DGTU5aQ43e1eLXW5daTdJBLPj7ANKdcZ8fQMFjLJZ3ECMys0qR nykA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QFRyLZQvy4ORvvMG6SE1r1pZqMndDwp/jNnta/YZPo8=; b=O95AQflof89GL+JqsxSxU7dqpeIYE57mESmEC5bsk+843Xb/i/diSTrokcoMNKAPVQ dZDvO/gFNnFrf+lz3JeOOZQeCVra8ZA0ZTsblKYnqsxStd4mOBhYhW95tDC+qXR8NcAV rEdboq3pzATN+6lRcRFs1ZBaiMx7MSdxsriKQN0pZxT8+ALUrWJB0GJwEa0MXgb9Sx7o xNwn2OpNgeYzRICN3i3NjBk0hzvg4sEBrPfvHEULEZKio6/vibCNzA2g5n5WEYWxi6VZ 3IPJRQFlsLQjVlvK1pv7DDP93bbv7c10+XuohhmZn92HSIRyosHRtVGFWklfxyXxqjLD KlEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HdDDoWTb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si321504edm.110.2021.02.02.17.59.09; Tue, 02 Feb 2021 17:59:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=HdDDoWTb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbhBCB5G (ORCPT + 99 others); Tue, 2 Feb 2021 20:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231787AbhBCB5E (ORCPT ); Tue, 2 Feb 2021 20:57:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FAC7C0613D6; Tue, 2 Feb 2021 17:56:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QFRyLZQvy4ORvvMG6SE1r1pZqMndDwp/jNnta/YZPo8=; b=HdDDoWTb8bo9AwL1G5w2J7c9ny j9Kua+EMQKkyR33mcx4U6ibju3pWjrJGQa02FxuTrLNz9NBpwLaKOvLfpaXV22U0v1Sx6SUkWumSy b+9rFFzl8yXHvy1u97aR2dVMeG2MC+qkdmQoNwdKcSMBjvjrsnZDKdAQVIDt/wtpYp0unwvRLJ4UC m86VphVHnSR9fSiWoorXllaHjnU3wmYZU3k5LO7GZD+v1R/y8v3lDqvGEZdCzjy5bU8uc9DjdlI9G DG7cOhCNVxr7TcvyPCzO5Topma3ZvmP8uG91WBbYdaAb7AGxYKJLcWJFwRgRGCzQYpYBlutPt9UOz c4nNEUFA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l77Ob-00G1Gl-Gl; Wed, 03 Feb 2021 01:55:54 +0000 Date: Wed, 3 Feb 2021 01:55:53 +0000 From: Matthew Wilcox To: Suren Baghdasaryan Cc: sumit.semwal@linaro.org, akpm@linux-foundation.org, hch@infradead.org, lmark@codeaurora.org, labbott@redhat.com, Brian.Starkey@arm.com, john.stultz@linaro.org, christian.koenig@amd.com, cgoldswo@codeaurora.org, orjan.eide@arm.com, robin.murphy@arm.com, jajones@nvidia.com, minchan@kernel.org, hridya@google.com, sspatil@google.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 1/2] mm: replace BUG_ON in vm_insert_page with a return of an error Message-ID: <20210203015553.GX308988@casper.infradead.org> References: <20210203003134.2422308-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210203003134.2422308-1-surenb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 02, 2021 at 04:31:33PM -0800, Suren Baghdasaryan wrote: > Replace BUG_ON(vma->vm_flags & VM_PFNMAP) in vm_insert_page with > WARN_ON_ONCE and returning an error. This is to ensure users of the > vm_insert_page that set VM_PFNMAP are notified of the wrong flag usage > and get an indication of an error without panicing the kernel. > This will help identifying drivers that need to clear VM_PFNMAP before > using dmabuf system heap which is moving to use vm_insert_page. NACK. The system may not _panic_, but it is clearly now _broken_. The device doesn't work, and so the system is useless. You haven't really improved anything here. Just bloated the kernel with yet another _ONCE variable that in a normal system will never ever ever be triggered.