Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp815860ybv; Wed, 5 Feb 2020 15:14:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwtEVsrSX6bRPyABti0Q0voATtFhQgdy5pM+5VK+UOq3TVo0L0n7LEkUH5zJB1RZ/vt7o2H X-Received: by 2002:aca:1b11:: with SMTP id b17mr4966306oib.45.1580944478538; Wed, 05 Feb 2020 15:14:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580944478; cv=none; d=google.com; s=arc-20160816; b=IfX/3b2ukby91B4QfdRASKXgEG00NqVGWxECxcQNubO3g86lBAZr3zQnucwBWxH0ei jurpNf4zBwNVxqmP+4heLL6Nonf41VIStGzQEadAtiU7BYDfLqMD+C+bhN7nLTI4rkTu Qpw0f1pcNmt8S00nhPfMkOm3tv6KzXgF6GJmvKriVUC1xsGJJNZZ/aH39/B0c27HNCRV Erjdc+r9HLvvAJuxpAYFZQhzWosnXbjRRzibi5dtKTzZfJGRzL6xx6wEwNAX9qlpgG8M lNUxZuEp0GDhtmLciyrt4bR0TdOghqPiqbpFkAGK1ITHWBmERJsrXAhqpjuvI1Bc7Juy Obkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=QZo2rYgRggJLhdhuOglfdT26CygAzcQcsm1mvo4G27A=; b=nMbbdOWnZE0nAR5VFuCSIDdWe2LmLR4KafZ0tNsg4sdRAKRPPRdOLqsBiuAvADjkQ2 LW1Q7KDa660Afok2O819RvbbD/9HliQN63Zc2IhjzQFX4AhvD0k684zU3QIAPl91xaQl BU35ABQiB6tE1HpzrtIolzQYGqwnm+QiWkd96p6wcU9obQok/UORkVe5Ole5CSHebWuO iRCDEYoWz1qj4QwjMqv5324234ixoX74bWlXzQLaltOgBZ9cYsrbYkV5FUdZZ7inie08 zDtNBxZOyGWgpWQn4iq0nv5qDyiSL35oifPjs/+SW7OxfUFoyzdpxtJ/nM66w7IsnZ3M fiZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rET6ClPJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si684187otp.4.2020.02.05.15.14.25; Wed, 05 Feb 2020 15:14:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=rET6ClPJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727542AbgBEXNc (ORCPT + 99 others); Wed, 5 Feb 2020 18:13:32 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:1635 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727149AbgBEXNc (ORCPT ); Wed, 5 Feb 2020 18:13:32 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 05 Feb 2020 15:13:04 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 05 Feb 2020 15:13:28 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 05 Feb 2020 15:13:28 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 5 Feb 2020 23:13:28 +0000 Subject: Re: [PATCH v4 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting To: Jan Kara CC: Andrew Morton , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jason Gunthorpe , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Kirill A . Shutemov" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , , , , , , LKML References: <20200204234117.2974687-1-jhubbard@nvidia.com> <20200204234117.2974687-11-jhubbard@nvidia.com> <20200205093733.GB28058@quack2.suse.cz> From: John Hubbard X-Nvconfidentiality: public Message-ID: <09b49b0d-85cc-87b8-9176-0963f6c8c735@nvidia.com> Date: Wed, 5 Feb 2020 15:13:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200205093733.GB28058@quack2.suse.cz> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1580944384; bh=QZo2rYgRggJLhdhuOglfdT26CygAzcQcsm1mvo4G27A=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=rET6ClPJ1i9ucTvvRWF/1/c462K2mCH6nZx8WiCBRBOHIYQjg+sBdCGrPEtzpJsKC oKyCPZwjz3pxDIMTZQ64WUhXMxGUcmo2sbbCBiqNCUtVm8IDqmSKyYGkw81oZa918B N0ScNcSKXjJywqnA2ZRAnUbR9x/eLSSwDq662e/d+ttmimG7GT1j+2mJRKDHI6zZbH 86HZzVIKep/0LUPMJQsvDeV54HT0Y46r7c6qo8I9SUAiapmADqg+pUsaOz9YoF0uW1 Jn2PUL4F9EQ2HxmAkHcoSFDySLMhNHZs2ZqJAAvZxFMlEtNxpUbGKwxFOdO35tSUdu Cvzd7Xz67EEww== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/20 1:37 AM, Jan Kara wrote: > ... > >> @@ -104,6 +106,9 @@ static __maybe_unused struct page *try_grab_compound_head(struct page *page, >> if (hpage_pincount_available(page)) >> hpage_pincount_add(page, refs); >> >> + mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_ACQUIRED, >> + orig_refs); >> + >> return page; >> } >> > > It seems to me you miss mod_node_page_state() in put_compound_head(), don't > you? Yes, that was definitely missing. I've added this for the next version: diff --git a/mm/gup.c b/mm/gup.c index 7c543849181b..ae503c51bc7f 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2268,6 +2268,8 @@ static int record_subpages(struct page *page, unsigned long addr, static void put_compound_head(struct page *page, int refs, unsigned int flags) { + int orig_refs = refs; + if (flags & FOLL_PIN) { if (hpage_pincount_available(page)) hpage_pincount_sub(page, refs); @@ -2283,6 +2285,8 @@ static void put_compound_head(struct page *page, int refs, unsigned int flags) if (refs > 1) page_ref_sub(page, refs - 1); put_page(page); + + mod_node_page_state(page_pgdat(page), NR_FOLL_PIN_RELEASED, orig_refs); } #ifdef CONFIG_ARCH_HAS_HUGEPD > > Otherwise I like the new stat names better :). > > Honza > Glad to hear that! :) thanks, -- John Hubbard NVIDIA