From: Nitin Gupta <ngupta@nitingupta.dev>
To: Baoquan He <bhe@redhat.com>, Nitin Gupta <nigupta@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Luis Chamberlain <mcgrof@kernel.org>,
Kees Cook <keescook@chromium.org>,
Iurii Zaikin <yzaikin@google.com>,
Vlastimil Babka <vbabka@suse.cz>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
open list <linux-kernel@vger.kernel.org>,
"open list:PROC SYSCTL" <linux-fsdevel@vger.kernel.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: Use unsigned types for fragmentation score
Date: Thu, 18 Jun 2020 07:24:57 -0700 [thread overview]
Message-ID: <f2bac2a3-f14a-1156-23e5-eabfcee7141d@nitingupta.dev> (raw)
In-Reply-To: <20200618134142.GD3346@MiWiFi-R3L-srv>
On 6/18/20 6:41 AM, Baoquan He wrote:
> On 06/17/20 at 06:03pm, Nitin Gupta wrote:
>> Proactive compaction uses per-node/zone "fragmentation score" which
>> is always in range [0, 100], so use unsigned type of these scores
>> as well as for related constants.
>>
>> Signed-off-by: Nitin Gupta <nigupta@nvidia.com>
>> ---
>> include/linux/compaction.h | 4 ++--
>> kernel/sysctl.c | 2 +-
>> mm/compaction.c | 18 +++++++++---------
>> mm/vmstat.c | 2 +-
>> 4 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
>> index 7a242d46454e..25a521d299c1 100644
>> --- a/include/linux/compaction.h
>> +++ b/include/linux/compaction.h
>> @@ -85,13 +85,13 @@ static inline unsigned long compact_gap(unsigned int order)
>>
>> #ifdef CONFIG_COMPACTION
>> extern int sysctl_compact_memory;
>> -extern int sysctl_compaction_proactiveness;
>> +extern unsigned int sysctl_compaction_proactiveness;
>> extern int sysctl_compaction_handler(struct ctl_table *table, int write,
>> void *buffer, size_t *length, loff_t *ppos);
>> extern int sysctl_extfrag_threshold;
>> extern int sysctl_compact_unevictable_allowed;
>>
>> -extern int extfrag_for_order(struct zone *zone, unsigned int order);
>> +extern unsigned int extfrag_for_order(struct zone *zone, unsigned int order);
>> extern int fragmentation_index(struct zone *zone, unsigned int order);
>> extern enum compact_result try_to_compact_pages(gfp_t gfp_mask,
>> unsigned int order, unsigned int alloc_flags,
>> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
>> index 58b0a59c9769..40180cdde486 100644
>> --- a/kernel/sysctl.c
>> +++ b/kernel/sysctl.c
>> @@ -2833,7 +2833,7 @@ static struct ctl_table vm_table[] = {
>> {
>> .procname = "compaction_proactiveness",
>> .data = &sysctl_compaction_proactiveness,
>> - .maxlen = sizeof(int),
>> + .maxlen = sizeof(sysctl_compaction_proactiveness),
>
> Patch looks good to me. Wondering why not using 'unsigned int' here,
> just curious.
>
It's just coding style preference. I see the same style used for many
other sysctls too (min_free_kbytes etc.).
Thanks,
Nitin
next prev parent reply other threads:[~2020-06-18 14:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-18 1:03 [PATCH] mm: Use unsigned types for fragmentation score Nitin Gupta
2020-06-18 13:41 ` Baoquan He
2020-06-18 14:24 ` Nitin Gupta [this message]
2020-06-19 12:42 ` Baoquan He
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2bac2a3-f14a-1156-23e5-eabfcee7141d@nitingupta.dev \
--to=ngupta@nitingupta.dev \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=nigupta@nvidia.com \
--cc=vbabka@suse.cz \
--cc=yzaikin@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).