Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4016496pxb; Tue, 25 Jan 2022 01:28:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOhfs/vTgxOhRZzl+k/EZDvG+KfjiYFgYQCnqquGr4vuBt5ZZNigrQnsOihWPM7/WKqUG/ X-Received: by 2002:a17:90a:2d86:: with SMTP id p6mr2613385pjd.222.1643102896386; Tue, 25 Jan 2022 01:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643102896; cv=none; d=google.com; s=arc-20160816; b=xFZRu7aK1dhoyBybI0Z+mgYoE7CACXt5UPx+fI18FgoRx8D0k5ho2k9sgLdEtzTgXT bKN6KuhyG9ifnQXDA4IM+Tc9hJpZrHFq+AnvwXpH3HNwqfUD+YAC2Ybma7QNmaU9eIdW EWQzlZnIBtvFcJ//PXPtasBjjSNpLKUbYlhKZLFKnOvFbcwQhjeEavebBnZpt/PUDhpf obMnHIIWicptc2iV9q301BK1EERUXrOlcJQ08QK7hUC2VN+9v6iEmc+qzQ2IsOsVXIEO thGQB2DfvukeV7w1ss2Z0GqlOhE4nXu6BawH1BJYVb58b61XZSYTu4iFr/srqFNrAXRY LL7Q== 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=s2TIx0Lumj330J9Y/TuskU8wzfas1h11AIKlLA6aruE=; b=nOCKrV7uOX3Gl8JX4eV0KH/84OwyDsIOv+BVb4dmgL6lKvlcbQVLrwVE2OgWMyus6N UMVFQfopNRd3J1wNinpfwaubWzwT8AwvTwskPLCd3vQaxBP3NuKuMBkCBwYlvZl42qM0 FH9dmhAmgtmr8GaMyhPwfovogu+OcH5KADXHvdrO1ahkq4IrJowSialnbJTx+rVBTORy SkK21lgzEqc0fqTFijyAmDPTV9dB2FEqa424Q7nbg1/d14tAms1nadkbwgaa7kpnG4lE t7P0CH2tKPsZ2PNapfqBpAU5x3G3Cgv9VBZQebExlumhOePNCMAtxZqL7Jjbu+MsVcPU pObQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nsRcNYp9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw8si19597pjb.0.2022.01.25.01.28.04; Tue, 25 Jan 2022 01:28:16 -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=@linuxfoundation.org header.s=korg header.b=nsRcNYp9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1449628AbiAYISy (ORCPT + 99 others); Tue, 25 Jan 2022 03:18:54 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:41198 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448806AbiAYIQV (ORCPT ); Tue, 25 Jan 2022 03:16:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5357861354; Tue, 25 Jan 2022 08:16:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12BD0C340E0; Tue, 25 Jan 2022 08:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643098580; bh=j0tZzZOrnwVB4wbKHRy+RU8Y6rBsvR3ZlnbOYKPxPT8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nsRcNYp9fpObActyzs4p3qGTzjmVp+6XUM669JRpuHe+73xvWTfSK+EH3uvxQ6841 W+vh8em+1Ta4sQf6mMyt+c0VA6FVhrhff8mIQJppO+R6ObBh0SYseuwhCTvmHZK1iR RE9XtEfnqNSgDO7Vp84Q3/C8gojx6/VfyFq8F8Is= Date: Tue, 25 Jan 2022 09:16:17 +0100 From: Greg Kroah-Hartman To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Felix Kuehling , David Yat Sin , Rajneesh Bhardwaj , Alex Deucher , Sasha Levin Subject: Re: [PATCH 5.16 0702/1039] drm/amdgpu: Dont inherit GEM object VMAs in child process Message-ID: References: <20220124184125.121143506@linuxfoundation.org> <20220124184148.931014095@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 25, 2022 at 08:26:20AM +0100, Christian K?nig wrote: > Hi Greg, > > Am 24.01.22 um 19:41 schrieb Greg Kroah-Hartman: > > From: Rajneesh Bhardwaj > > > > [ Upstream commit fbcdbfde87509d523132b59f661a355c731139d0 ] > > > > When an application having open file access to a node forks, its shared > > mappings also get reflected in the address space of child process even > > though it cannot access them with the object permissions applied. With the > > existing permission checks on the gem objects, it might be reasonable to > > also create the VMAs with VM_DONTCOPY flag so a user space application > > doesn't need to explicitly call the madvise(addr, len, MADV_DONTFORK) > > system call to prevent the pages in the mapped range to appear in the > > address space of the child process. It also prevents the memory leaks > > due to additional reference counts on the mapped BOs in the child > > process that prevented freeing the memory in the parent for which we had > > worked around earlier in the user space inside the thunk library. > > > > Additionally, we faced this issue when using CRIU to checkpoint restore > > an application that had such inherited mappings in the child which > > confuse CRIU when it mmaps on restore. Having this flag set for the > > render node VMAs helps. VMAs mapped via KFD already take care of this so > > this is needed only for the render nodes. > > > > To limit the impact of the change to user space consumers such as OpenGL > > etc, limit it to KFD BOs only. > > > > Acked-by: Felix Kuehling > > Reviewed-by: Christian K?nig > > Signed-off-by: David Yat Sin > > Signed-off-by: Rajneesh Bhardwaj > > Signed-off-by: Alex Deucher > > Signed-off-by: Sasha Levin > > Please drop this patch from all stable versions since it was reverted from > upstream later on. The revert comes later in the patch series, so all should be ok :) thanks, greg k-h