From: Andrew Morton Subject: Re: [PATCH] mm/memcg: fix device private memcg accounting Date: Fri, 9 Oct 2020 15:50:55 -0700 Message-ID: <20201009155055.f87de51ea04d4ea879e3981a@linux-foundation.org> References: <20201009215952.2726-1-rcampbell@nvidia.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602283857; bh=zcmB/pdpydbCgKBcPlaBkRATTHHSFEh+mhWUqm1eToM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HKkzyoIV5otAbM1mB0lNAjMilwTpPBpdQ1VIUp5kruHuS/yJ79W6djbNnWC8BTWkN cU1zEuiFy994wfhNta/RB5YOw21Sqv38bVgPtSszaB84k2dkPOftB7Hyx21TkfZgN6 Kb4ynNbxddISq4R/yaEo6Cfpx27gJOdgEFPxzg18= In-Reply-To: <20201009215952.2726-1-rcampbell@nvidia.com> List-ID: Content-Type: text/plain; charset="us-ascii" To: Ralph Campbell Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Vladimir Davydov , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Balbir Singh , Ira Weiny , stable@vger.kernel.org On Fri, 9 Oct 2020 14:59:52 -0700 Ralph Campbell wrote: > The code in mc_handle_swap_pte() checks for non_swap_entry() and returns > NULL before checking is_device_private_entry() so device private pages > are never handled. > Fix this by checking for non_swap_entry() after handling device private > swap PTEs. > > Cc: stable@vger.kernel.org I was going to ask "what are the end-user visible effects of the bug". This is important information with a cc:stable. > > I'm not sure exactly how to test this. I ran the HMM self tests but > that is a minimal sanity check. I think moving the self test from one > memory cgroup to another while it is running would exercise this patch. > I'm looking at how the test could move itself to another group after > migrating some anonymous memory to the test driver. > But this makes me suspect the answer is "there aren't any that we know of". Are you sure a cc:stable is warranted?