Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2554380pxu; Fri, 9 Oct 2020 22:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQcn3/IR1BpYq11oEm62lWADrHt7uDkKOgAA0gMFTwcr+EK/v1Oj3b9xBMwHzSrxzJWA3D X-Received: by 2002:aa7:d30d:: with SMTP id p13mr2826982edq.315.1602309195383; Fri, 09 Oct 2020 22:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602309195; cv=none; d=google.com; s=arc-20160816; b=CbYXpvJAOuo65wnUWAn6o811br+CYv/tpot7Aa2ZVMxlydAAKTD+Vpudz026VE7iat CADH0bHZWku3PV0OeasWGO7IFIqPrPPiz0KByqiAwrYpMLXselEXQ9j/dfJPMXT0HS4B pdYZWvo25jKFRZUcdagZzhZxXCTgYeM1LjPaESejQzLYqg6HoZOj70ILqLuhUzDg2h3A j0y+cG4zS6oYQc2KWlN32idhRcV3/ahG2I2RIuJqk4y30FzYsDjZmia986QF9U0X8Qvn ZMSUZLeKg4yF9+RVgnh6ZcLD/k/jw8gtXX2Sp4TnrREaNizCanG7pu8k2xzffrNHZUKs Ekaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=nz8yz9ZXc2m7m7XOXj/8/onPp1Wjx60GDhG+ihk3PXI=; b=xYrW8h2pqx1hneX2llVeIX1qQEYz6JS2hZSkbHtUU8L4INOwhYcUObnj3jykwTAzW5 JTT4QENErsyizA2bvUqzi3qVPKIYlHSXbp8Hrtwucu+KT7JKTc34349uPFhpmJkYv0n9 sGQvtRZh0tOqT5JRuAOE2UXqzQ3epQcD9xVIOWRJKaxUX5xXcTmMopI5kInFDPdOpG6a LOm/h1GUkduv6LOjGJ5yPYywVh0ZV/8OJCHLupnokTeimtNLBscDJeSiMWw9vJ7gyqhT ctOmJls76NgGSnlln94O0jU26xEGQCzRbo44571rbRyUt9JMiXPt+fiEuCDn4PfrVHno sT2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HKkzyoIV; 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 f2si10855421edl.147.2020.10.09.22.52.50; Fri, 09 Oct 2020 22:53:15 -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=@kernel.org header.s=default header.b=HKkzyoIV; 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 S2392023AbgJIWu7 (ORCPT + 99 others); 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?