From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hugh Dickins <hughd@google.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH mmotm] mm: use unsigned int for page order fix 2
Date: Fri, 16 Oct 2015 16:07:04 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.11.1510161603420.31270@eggly.anvils> (raw)
In-Reply-To: <20151016160050.621082b8b1080c28487e764f@linux-foundation.org>
On Fri, 16 Oct 2015, Andrew Morton wrote:
> On Fri, 16 Oct 2015 15:51:34 -0700 (PDT) Hugh Dickins <hughd@google.com> wrote:
>
> > Some configs now end up with MAX_ORDER and pageblock_order having
> > different types: silence compiler warning in __free_one_page().
> >
> > ...
> >
> > @@ -679,7 +679,7 @@ static inline void __free_one_page(struc
> > * pageblock. Without this, pageblock isolation
> > * could cause incorrect freepage accounting.
> > */
> > - max_order = min(MAX_ORDER, pageblock_order + 1);
> > + max_order = min_t(unsigned int, MAX_ORDER, pageblock_order + 1);
> > } else {
> > __mod_zone_freepage_state(zone, 1 << order, migratetype);
> > }
>
> Well. If we're ordaining that "page order has type uint" then can we
> do that more consistently? Something like
Yes, if we are going this way, then it is better to be thorough than
patch around it as I did. (But personally I think the exercise is a
waste of time, so I just took the quickest way out, sorry.)
Hugh
>
> --- a/include/linux/mmzone.h~a
> +++ a/include/linux/mmzone.h
> @@ -21,9 +21,9 @@
>
> /* Free memory management - zoned buddy allocator. */
> #ifndef CONFIG_FORCE_MAX_ZONEORDER
> -#define MAX_ORDER 11
> +#define MAX_ORDER 11U
> #else
> -#define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
> +#define MAX_ORDER ((unsigned int)CONFIG_FORCE_MAX_ZONEORDER)
> #endif
> #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
>
> diff -puN include/linux/pageblock-flags.h~a include/linux/pageblock-flags.h
> --- a/include/linux/pageblock-flags.h~a
> +++ a/include/linux/pageblock-flags.h
> @@ -49,7 +49,7 @@ extern unsigned int pageblock_order;
> #else /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
>
> /* Huge pages are a constant size */
> -#define pageblock_order HUGETLB_PAGE_ORDER
> +#define pageblock_order ((unsigned int)HUGETLB_PAGE_ORDER)
>
> #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
>
> _
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-10-16 23:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 22:51 Hugh Dickins
2015-10-16 23:00 ` Andrew Morton
2015-10-16 23:07 ` Hugh Dickins [this message]
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=alpine.LSU.2.11.1510161603420.31270@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sfr@canb.auug.org.au \
/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