From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Jack Steiner <steiner@sgi.com>,
Linux Memory Management <linux-mm@kvack.org>
Subject: [patch] clamp batch size to (2^n)-1
Date: Sun, 10 Apr 2005 00:03:21 +1000 [thread overview]
Message-ID: <4257E0A9.5010609@yahoo.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 355 bytes --]
Oh, this is the other thing.
I'm thinking it would be a good idea to get this into -mm ASAP,
even before you guys have fully tested it. Just to get the wheels
in motion early.
Yeah? Or did you have something else in mind?
(It is actually against the previous patchset, but obviously that
won't be merged before this patch).
--
SUSE Labs, Novell Inc.
[-- Attachment #2: pcp-modify-batch.patch --]
[-- Type: text/plain, Size: 922 bytes --]
Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c 2005-04-09 23:13:53.000000000 +1000
+++ linux-2.6/mm/page_alloc.c 2005-04-09 23:59:36.000000000 +1000
@@ -1623,6 +1623,18 @@ void __init build_percpu_pagelists(void)
if (batch < 1)
batch = 1;
+ /*
+ * Clamp the batch to a 2^n - 1 value. Having a power
+ * of 2 value was found to be more likely to have
+ * suboptimal cache aliasing properties in some cases.
+ *
+ * For example if 2 tasks are alternately allocating
+ * batches of pages, one task can end up with a lot
+ * of pages of one half of the possible page colors
+ * and the other with pages of the other colors.
+ */
+ batch = (1 << fls(batch + batch/2)) - 1;
+
init_percpu_pageset(&zone->pageset, batch);
for (cpu = 0; cpu < NR_CPUS; cpu++) {
struct zone_pagesets *zp;
reply other threads:[~2005-04-09 14:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4257E0A9.5010609@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=linux-mm@kvack.org \
--cc=steiner@sgi.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