Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580AbbKJA2S (ORCPT ); Mon, 9 Nov 2015 19:28:18 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:48227 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbbKJA2P (ORCPT ); Mon, 9 Nov 2015 19:28:15 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: iamjoonsoo.kim@lge.com X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Tue, 10 Nov 2015 09:28:42 +0900 From: Joonsoo Kim To: "Kirill A. Shutemov" Cc: Sergey Senozhatsky , Andrew Morton , Michal Nazarewicz , Minchan Kim , Mel Gorman , Vlastimil Babka , "Kirill A. Shutemov" , Linux Memory Management List , LKML , linux-api@vger.kernel.org Subject: Re: [PATCH 1/2] mm: introduce page reference manipulation functions Message-ID: <20151110002842.GC13894@js1304-P5Q-DELUXE> References: <1447053784-27811-1-git-send-email-iamjoonsoo.kim@lge.com> <20151109075337.GC472@swordfish> <20151109114537.GA3903@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151109114537.GA3903@node.shutemov.name> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2020 Lines: 57 On Mon, Nov 09, 2015 at 01:45:37PM +0200, Kirill A. Shutemov wrote: > On Mon, Nov 09, 2015 at 05:00:32PM +0900, Joonsoo Kim wrote: > > 2015-11-09 16:53 GMT+09:00 Sergey Senozhatsky > > : > > > Hi, > > > > > > On (11/09/15 16:23), Joonsoo Kim wrote: > > > [..] > > >> +static inline int page_count(struct page *page) > > >> +{ > > >> + return atomic_read(&compound_head(page)->_count); > > >> +} > > >> + > > >> +static inline void set_page_count(struct page *page, int v) > > >> +{ > > >> + atomic_set(&page->_count, v); > > >> +} > > >> + > > >> +/* > > >> + * Setup the page count before being freed into the page allocator for > > >> + * the first time (boot or memory hotplug) > > >> + */ > > >> +static inline void init_page_count(struct page *page) > > >> +{ > > >> + set_page_count(page, 1); > > >> +} > > >> + > > >> +static inline void page_ref_add(struct page *page, int nr) > > >> +{ > > >> + atomic_add(nr, &page->_count); > > >> +} > > > > > > Since page_ref_FOO wrappers operate with page->_count and there > > > are already page_count()/set_page_count()/etc. may be name new > > > wrappers in page_count_FOO() manner? > > > > Hello, > > > > I used that page_count_ before but change my mind. > > I think that ref is more relevant to this operation. > > Perhaps, it'd be better to change page_count()/set_page_count() > > to page_ref()/set_page_ref(). > > What about get_page() vs. page_cache_get() and put_page() vs. > page_cache_release()? Two different helpers for the same thing is annyoing > me for some time (plus PAGE_SIZE vs. PAGE_CACHE_SIZE, etc.). > > If you want coherent API you might want to get them consitent too. In fact, consistent naming is out of interest of this patchset. :) Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/