[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51130927.7050805@cn.fujitsu.com>
Date: Thu, 07 Feb 2013 09:53:43 +0800
From: Zhang Yanfei <zhangyanfei@...fujitsu.com>
To: Randy Dunlap <rdunlap@...radead.org>
CC: Andrew Morton <akpm@...ux-foundation.org>, mgorman@...e.de,
minchan@...nel.org, kamezawa.hiroyu@...fujitsu.com,
Linux MM <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: accurately document nr_free_*_pages functions with
code comments
于 2013年02月07日 08:55, Randy Dunlap 写道:
> On 02/06/13 00:25, Zhang Yanfei wrote:
>> Functions nr_free_zone_pages, nr_free_buffer_pages and nr_free_pagecache_pages
>> are horribly badly named, so accurately document them with code comments
>> in case of the misuse of them.
>>
>> Signed-off-by: Zhang Yanfei <zhangyanfei@...fujitsu.com>
>> ---
>> mm/page_alloc.c | 23 +++++++++++++++++++----
>> 1 files changed, 19 insertions(+), 4 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index df2022f..0790716 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -2785,6 +2785,15 @@ void free_pages_exact(void *virt, size_t size)
>> }
>> EXPORT_SYMBOL(free_pages_exact);
>>
>> +/**
>> + * nr_free_zone_pages - get pages that is beyond high watermark
>> + * @offset - The zone index of the highest zone
>
> Function parameter format uses a ':', not a '-'. E.g.,
>
> * @offset: the zone index of the highest zone
Sorry for my mistake. Thanks for your review.
>
>
>> + *
>> + * The function counts pages which are beyond high watermark within
>> + * all zones at or below a given zone index. For each zone, the
>> + * amount of pages is calculated as:
>> + * present_pages - high_pages
>> + */
>> static unsigned int nr_free_zone_pages(int offset)
>> {
>> struct zoneref *z;
>> @@ -2805,8 +2814,11 @@ static unsigned int nr_free_zone_pages(int offset)
>> return sum;
>> }
>>
>> -/*
>> - * Amount of free RAM allocatable within ZONE_DMA and ZONE_NORMAL
>> +/**
>> + * nr_free_buffer_pages - get pages that is beyond high watermark
>> + *
>> + * The function counts pages which are beyond high watermark within
>> + * ZONE_DMA and ZONE_NORMAL.
>> */
>> unsigned int nr_free_buffer_pages(void)
>> {
>> @@ -2814,8 +2826,11 @@ unsigned int nr_free_buffer_pages(void)
>> }
>> EXPORT_SYMBOL_GPL(nr_free_buffer_pages);
>>
>> -/*
>> - * Amount of free RAM allocatable within all zones
>> +/**
>> + * nr_free_pagecache_pages - get pages that is beyond high watermark
>> + *
>> + * The function counts pages which are beyond high watermark within
>> + * all zones.
>> */
>> unsigned int nr_free_pagecache_pages(void)
>> {
>>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists