From: Matthew Wilcox <willy@infradead.org>
To: Greg Thelen <gthelen@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: convert scan_control.priority int => byte
Date: Mon, 28 May 2018 19:57:22 -0700 [thread overview]
Message-ID: <20180529025722.GA25784@bombadil.infradead.org> (raw)
In-Reply-To: <20180529024025.58353-1-gthelen@google.com>
On Mon, May 28, 2018 at 07:40:25PM -0700, Greg Thelen wrote:
> Reclaim priorities range from 0..12(DEF_PRIORITY).
> scan_control.priority is a 4 byte int, which is overkill.
>
> Since commit 6538b8ea886e ("x86_64: expand kernel stack to 16K") x86_64
> stack overflows are not an issue. But it's inefficient to use 4 bytes
> for priority.
If you're looking to shave a few more bytes, allocation order can fit
in a u8 too (can't be more than 6 bits, and realistically won't be more
than 4 bits). reclaim_idx likewise will fit in a u8, and actually won't
be more than 3 bits.
I am sceptical that nr_to_reclaim should really be an unsigned long; I
don't think we should be trying to free 4 billion pages in a single call.
nr_scanned might be over 4 billion (!) but nr_reclaimed can probably
shrink to unsigned int along with nr_to_reclaim.
next prev parent reply other threads:[~2018-05-29 2:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 2:40 [PATCH] mm: convert scan_control.priority int => byte Greg Thelen
2018-05-29 2:57 ` Matthew Wilcox [this message]
2018-05-30 6:12 ` Greg Thelen
2018-05-30 6:12 ` [PATCH v2] mm: condense scan_control Greg Thelen
2018-06-20 20:52 ` Greg Thelen
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=20180529025722.GA25784@bombadil.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.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).