Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp85555ybv; Wed, 5 Feb 2020 01:39:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzmgFlIbhtwgtnGLoux9rcd8qtj86KKb5ZFuW85LYeDln2XwxOj/YtRegM6CiyCTgXR/dAz X-Received: by 2002:a9d:4f02:: with SMTP id d2mr8608130otl.368.1580895541265; Wed, 05 Feb 2020 01:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580895541; cv=none; d=google.com; s=arc-20160816; b=yjwG/qNgFpxCL9tLUOE8EdjDIByap2mefz281bUg0HfwH7vcSPX8tJ5HaShkht+cwz L4mKEA+1uxYvQB/nvvDFG3fpOy3eA6RdhK+pNxYBmLI334b5V8K8Ozr+8miYHE3mv9sz h7KlIQYzr1zHAfhO5MNrTDVp654HbBgXlsSRBJ9gwGaD91g7fcouQniwOfnxRJXbgLlX NimJGV0E47qUIoAddxT9snVTEpVP8YHlawdoCt/eyQOIo7Y6P1+5WwvK1bVw31HAoWgd XMux0Ho85AzwRK8Kp2DCn5ZdhjxQHG/zim4CLFdPNf5nHxu0ScfcY2eYiDcZ8+mMsVhf NZPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=upWqwoKmZU3T59Wp7iKwG0RjmqdkzmboquLsdZekzhg=; b=Ugu5M6Euz+YQOVLZbW1prFbQGvhNIdck90L7qwP8/gpw1rXLUFAwVylNnL91XCF5WH vZKfAbyYAGOuBhC3XXyF+daq6LDnWr61fVAbS4qHLD/aGjZaCJub5Zxdvos0eDe8Bmos zbfbSK0YEZSor0kj+SxTxMx7P9xet5fUXwobgSeH+GRkfMivmMpquKB+N4Y6k46gFU9o Z+9ubwrWAWixW7RdQ+ahx/vHms9jcBITXAdFuIsP9h1RkWAO9rggYKFWFN5ZXapvnbjr AhE0YrXkDEWeUZNhEDWGyeZOIcca6f00SU0VofewIhRb2auzEiZhiiEtio7XyMRMaRb2 Byxg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si10978277oic.220.2020.02.05.01.38.49; Wed, 05 Feb 2020 01:39:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728188AbgBEJhn (ORCPT + 99 others); Wed, 5 Feb 2020 04:37:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:60316 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728030AbgBEJhm (ORCPT ); Wed, 5 Feb 2020 04:37:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F2830AE2C; Wed, 5 Feb 2020 09:37:39 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id ED8431E0A51; Wed, 5 Feb 2020 10:37:33 +0100 (CET) Date: Wed, 5 Feb 2020 10:37:33 +0100 From: Jan Kara To: John Hubbard Cc: Andrew Morton , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , "Kirill A . Shutemov" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v4 10/12] mm/gup: /proc/vmstat: pin_user_pages (FOLL_PIN) reporting Message-ID: <20200205093733.GB28058@quack2.suse.cz> References: <20200204234117.2974687-1-jhubbard@nvidia.com> <20200204234117.2974687-11-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200204234117.2974687-11-jhubbard@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 04-02-20 15:41:15, John Hubbard wrote: > Now that pages are "DMA-pinned" via pin_user_page*(), and unpinned via > unpin_user_pages*(), we need some visibility into whether all of this is > working correctly. > > Add two new fields to /proc/vmstat: > > nr_foll_pin_acquired > nr_foll_pin_released > > These are documented in Documentation/core-api/pin_user_pages.rst. > They represent the number of pages (since boot time) that have been > pinned ("nr_foll_pin_acquired") and unpinned ("nr_foll_pin_released"), > via pin_user_pages*() and unpin_user_pages*(). > > In the absence of long-running DMA or RDMA operations that hold pages > pinned, the above two fields will normally be equal to each other. > > Also: update Documentation/core-api/pin_user_pages.rst, to remove an > earlier (now confirmed untrue) claim about a performance problem with > /proc/vmstat. > > Also: updated Documentation/core-api/pin_user_pages.rst to rename the > new /proc/vmstat entries, to the names listed here. > > Signed-off-by: John Hubbard ... > @@ -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? Otherwise I like the new stat names better :). Honza -- Jan Kara SUSE Labs, CR