Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1351176pxu; Fri, 16 Oct 2020 09:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN6fEYM3KkG8ePF5Qn7G+NGkuzWojYpoicbcpFU3syMaykDdcGCEv0TIanAQKvqYjUfU7c X-Received: by 2002:a17:906:1d11:: with SMTP id n17mr4669200ejh.280.1602866884481; Fri, 16 Oct 2020 09:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602866884; cv=none; d=google.com; s=arc-20160816; b=hqsylkj36AsbGzV8hVh074UXDHBMzQP+2WLeMr9LXonknNaJC7dgIB5noIq2UBIvlx 4RLzqRwDHODUUZITvOY0R44plzLxod9VM9QZ6v/CQ4712PaORMCA+pbYHAyNKfVmvCgj 5r1ty7s2dGuGR99Jv14RGB1XeffRiAhyE3PB9xvB274VhMMTIq4G7Ts+cyzdfJoMcwGS 7aHEetiOG71ItbMCHw4Zo+fqfD9Hw8yjM790sU0Mk+wQL4YBjTjbeJv3sbiIUFna88wl we7c9b4mLdR5flGaCoaf6AjrMxDvtQv79yLd/gO7UCmI4SkePBLP+93zkrkdonN4S5o7 dM/g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SzfzkDBitQIi0dWl8hQ69VYetsUqJh1EpiO/PjfBVJ4=; b=WH8n6tlmSAgG8avAEwrkGeuRDLNXfzp/kmtwS5tSXnfDtR4Wt1X+3GFLxiF8skohya vUfgbx3OjahSWOyXHPzuJKDLJH8i+wOKengKt10lQQJ2GV3CwvL8Lt0oy5yNAM4H2Oyx S3KN6PKenGdNMJVCPWN4gqvpu8DCDvJnDfumieXPe/HfouLeK29cTvD6/2PV/93pSQax kbxZfogDUSIGYKgWh4UMJpuNX8NwZSMK1bZ/89Sj7TLIRpMO9yZSkZLnUSHtD7qgrl6G 8PhVM2B8w9Q9jLjw/nYbwG6DWkJLRCgQm45Oslpv0rHrldrjCDp8q6eSbIH5ECujdli5 rNQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=jYFxSj0G; 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 ba26si2068556edb.572.2020.10.16.09.47.41; Fri, 16 Oct 2020 09:48:04 -0700 (PDT) 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=@ziepe.ca header.s=google header.b=jYFxSj0G; 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 S2409781AbgJPQNY (ORCPT + 99 others); Fri, 16 Oct 2020 12:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409713AbgJPQNX (ORCPT ); Fri, 16 Oct 2020 12:13:23 -0400 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A5DC0613D3 for ; Fri, 16 Oct 2020 09:13:23 -0700 (PDT) Received: by mail-io1-xd43.google.com with SMTP id n6so4423400ioc.12 for ; Fri, 16 Oct 2020 09:13:23 -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; bh=SzfzkDBitQIi0dWl8hQ69VYetsUqJh1EpiO/PjfBVJ4=; b=jYFxSj0G8MEyNA6azgjTlI3p9WfsDHDEmQs6T3SvBZ2nPAHKqlNsKge/SQ531tHmcc AKcp/SO2BB1Fkw4uqOgO4xPcvAuls/is8lUdMvYQC/f3NKFiu0nmtm+Bn/y3IMI27SdB EVv/SiDOsylMgzjjUSuVh2dBkVf+OTtUjnLp3EDWRYIFPsNAVbZ7XEPR1ge5yEo9tPvw 1/WhhUZywzgh4WCtd9LFge+gy+I3UA6EWus/7VeckFhN9Wh36+DPxt+JU+rla7OrDvof UEOc4BTCnqfvCbZ6fIrXvMvG72jUwxm1v/fpGdA22meHccsaDiS5CqNvbuhFAWPV/aO9 7jZg== 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; bh=SzfzkDBitQIi0dWl8hQ69VYetsUqJh1EpiO/PjfBVJ4=; b=okL9PN+JPN4uXEcQjvOgAJZKvZqrUIdBzHbcCxedX6ruu+rjFvLJSqW89CzNhuWm/e /Tt24M635Oi6jTsWPefJWmrRcjuOQIgYA784L2sWybn4VnztlKBWWKVL/n5xyaT/XE3z E35LVpE4YxrFUpTIWKVfhFbKsuO1olVdtNS0p2OjPtA5pZxCWMBY8rK1wwxNChBk/KBz V2XMNw2DLu+htuYZr6lkwvHMKDWiQnI0wBGKSVSGV0fj4KVLjjRnPHBrq8dQ1reWVHC1 +uXrcoAeXgSCJKC4idXxNTV49h5O5KRqs90awHuEH+Uw4Ve1HALe+UW1k98Ykzzmlfov eaIA== X-Gm-Message-State: AOAM532wjcYk/T2H5xOEodXLVMZClXoXRqjNtvUqoFaYli1Of1NFQpIi haqPiZxa9FyaPE2xHx7YA5YuWA== X-Received: by 2002:a02:b80f:: with SMTP id o15mr3153369jam.103.1602864802734; Fri, 16 Oct 2020 09:13:22 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id g17sm2378255ilq.15.2020.10.16.09.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 09:13:22 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kTSM5-000edC-4i; Fri, 16 Oct 2020 13:13:21 -0300 Date: Fri, 16 Oct 2020 13:13:21 -0300 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, chris@chris-wilson.co.uk, airlied@redhat.com, daniel@ffwll.ch, sumit.semwal@linaro.org, willy@infradead.org, jhubbard@nvidia.com, linmiaohe@huawei.com Subject: Re: [PATCH 2/2] mm: introduce vma_set_file function v4 Message-ID: <20201016161321.GF36674@ziepe.ca> References: <20201012085203.56119-1-christian.koenig@amd.com> <20201012085203.56119-2-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201012085203.56119-2-christian.koenig@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 10:52:03AM +0200, Christian König wrote: > Add the new vma_set_file() function to allow changing > vma->vm_file with the necessary refcount dance. > > v2: add more users of this. > v3: add missing EXPORT_SYMBOL, rebase on mmap cleanup, > add comments why we drop the reference on two occasions. > v4: make it clear that changing an anonymous vma is illegal. > > Signed-off-by: Christian König > Reviewed-by: Daniel Vetter (v2) > --- > drivers/dma-buf/dma-buf.c | 3 +-- > drivers/gpu/drm/etnaviv/etnaviv_gem.c | 4 +--- > drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 3 +-- > drivers/gpu/drm/i915/gem/i915_gem_mman.c | 5 +++-- > drivers/gpu/drm/msm/msm_gem.c | 4 +--- > drivers/gpu/drm/omapdrm/omap_gem.c | 3 +-- > drivers/gpu/drm/vgem/vgem_drv.c | 3 +-- > drivers/staging/android/ashmem.c | 6 +++--- > include/linux/mm.h | 2 ++ > mm/mmap.c | 12 ++++++++++++ > 10 files changed, 26 insertions(+), 19 deletions(-) Reviewed-by: Jason Gunthorpe Jason