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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 44079C433DF for ; Fri, 9 Oct 2020 22:51:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13B6722384 for ; Fri, 9 Oct 2020 22:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602283860; bh=zcmB/pdpydbCgKBcPlaBkRATTHHSFEh+mhWUqm1eToM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=a3t1eKLiWdMdvdMbwQ1oOItylXkoKIcuEmoHyaWc5Yp0PcLXuP2/0K1Sdw591dC6e s0xeYZLY7iwHs8KxgUt1Adj0XCcUCRdOvgWEyZuHb9+sN5ezpH5N0/i7pO/OsIxS3+ 2F/UpfvjOJpTocBnuSsSFtP27+hhf0QFn/gGPVrQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392027AbgJIWu7 (ORCPT ); Fri, 9 Oct 2020 18:50:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:43388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389409AbgJIWu6 (ORCPT ); Fri, 9 Oct 2020 18:50:58 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DA05222EB; Fri, 9 Oct 2020 22:50:56 +0000 (UTC) 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= Date: Fri, 9 Oct 2020 15:50:55 -0700 From: Andrew Morton To: Ralph Campbell Cc: , , , Johannes Weiner , Michal Hocko , Vladimir Davydov , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Balbir Singh , Ira Weiny , Subject: Re: [PATCH] mm/memcg: fix device private memcg accounting Message-Id: <20201009155055.f87de51ea04d4ea879e3981a@linux-foundation.org> In-Reply-To: <20201009215952.2726-1-rcampbell@nvidia.com> References: <20201009215952.2726-1-rcampbell@nvidia.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?