From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E43CC433E0 for ; Wed, 3 Feb 2021 01:56:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7765264DA3 for ; Wed, 3 Feb 2021 01:56:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7765264DA3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB2236B0070; Tue, 2 Feb 2021 20:56:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E88AD6B0071; Tue, 2 Feb 2021 20:56:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC8496B0072; Tue, 2 Feb 2021 20:56:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0252.hostedemail.com [216.40.44.252]) by kanga.kvack.org (Postfix) with ESMTP id C6E4D6B0070 for ; Tue, 2 Feb 2021 20:56:31 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8BFF03634 for ; Wed, 3 Feb 2021 01:56:31 +0000 (UTC) X-FDA: 77775292182.07.pipe64_070811e275cf Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 738CB1803F9A9 for ; Wed, 3 Feb 2021 01:56:31 +0000 (UTC) X-HE-Tag: pipe64_070811e275cf X-Filterd-Recvd-Size: 2805 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Wed, 3 Feb 2021 01:56:29 +0000 (UTC) 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> 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: 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.