From: Rene Herman <rene.herman@gmail.com>
To: Matt Mackall <mpm@selenic.com>
Cc: Ray Lee <ray-lk@madrabbit.org>, Bodo Eggert <7eggert@gmx.de>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Jesper Juhl <jesper.juhl@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
William Lee Irwin III <wli@holomorphy.com>,
David Chinner <dgc@sgi.com>,
Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH][RFC] 4K stacks default, not a debug thing any more...?
Date: Wed, 18 Jul 2007 04:38:19 +0200 [thread overview]
Message-ID: <469D7D1B.4050909@gmail.com> (raw)
In-Reply-To: <20070716232755.GD11115@waste.org>
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
On 07/17/2007 01:27 AM, Matt Mackall wrote:
> Larger soft pages waste tremendous amounts of memory (mostly in page
> cache) for minimal benefit on, say, the typical desktop. While there
> are workloads where it's a win, it's probably on a small percentage of
> machines.
>
> So it's absolutely no help in fixing our order-1 allocation problem
> because we don't want to force large pages on people.
I was just now looking at how much space is in fact wasted in pagecache for
various pagesizes by running the attached dumb little program from a few
selected directories (heavy stack recursion, never mind).
Well, hmmm. This is on a (compiled) git tree:
rene@7ixe4:~/src/linux/local$ pageslack
total : 447350347
4k : 67738037 (15%)
8k : 147814837 (33%)
16k : 324614581 (72%)
32k : 724629941 (161%)
64k : 1592785333 (356%)
Nicely constant factor 2.2 instead of the 2 one would expect but oh well. On
a collection of larger files the percentages obviously drop. This is on a
directory of ogg vorbis files:
root@7ixe4:/mnt/ogg/.../... # pageslack
total : 70817974
4k : 26442 (0%)
8k : 67402 (0%)
16k : 124746 (0%)
32k : 288586 (0%)
64k : 419658 (0%)
The "typical desktop" is presented by neither I guess but does involve audio
and (much larger still) video and bloody huge browser apps.
Not too sure then that 8K wouldn't be something I'd want, given fewer
pagefaults and all that...
Rene.
[-- Attachment #2: pageslack.c --]
[-- Type: text/plain, Size: 1552 bytes --]
/* gcc -W -Wall -o pageslack pageslack.c */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE - 1))
unsigned long long total;
unsigned long long slack[5];
void do_dir(const char *name)
{
DIR *dir;
struct dirent *ent;
dir = opendir(name);
if (!dir) {
perror("opendir");
exit(EXIT_FAILURE);
}
while ((ent = readdir(dir))) {
struct stat buf;
char path[PATH_MAX];
if (!strcmp(ent->d_name, "."))
continue;
if (!strcmp(ent->d_name, ".."))
continue;
sprintf(path, "%s/%s", name, ent->d_name);
if (stat(path, &buf)) {
perror("stat");
exit(EXIT_FAILURE);
}
if (S_ISDIR(buf.st_mode)) {
do_dir(path);
continue;
}
if (S_ISREG(buf.st_mode)) {
int i;
for (i = 0; i < 5; i++) {
unsigned long PAGE_SHIFT = 12 + i;
slack[i] += (PAGE_SIZE - (buf.st_size % PAGE_SIZE)) % PAGE_SIZE;
}
total += buf.st_size;
}
}
if (closedir(dir)) {
perror("closedir");
exit(EXIT_FAILURE);
}
}
int main(void)
{
do_dir(".");
printf("total\t: %llu\n", total);
printf(" 4k\t: %llu (%llu%%)\n", slack[0], (100 * slack[0]) / total);
printf(" 8k\t: %llu (%llu%%)\n", slack[1], (100 * slack[1]) / total);
printf("16k\t: %llu (%llu%%)\n", slack[2], (100 * slack[2]) / total);
printf("32k\t: %llu (%llu%%)\n", slack[3], (100 * slack[3]) / total);
printf("64k\t: %llu (%llu%%)\n", slack[4], (100 * slack[4]) / total);
return EXIT_SUCCESS;
}
next prev parent reply other threads:[~2007-07-18 2:39 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8FO1e-2jW-35@gated-at.bofh.it>
[not found] ` <8FYWD-2eS-7@gated-at.bofh.it>
[not found] ` <8GdsH-8dc-13@gated-at.bofh.it>
[not found] ` <8Ghmx-60z-17@gated-at.bofh.it>
[not found] ` <8Gj55-hJ-5@gated-at.bofh.it>
[not found] ` <8GkNo-2Vb-1@gated-at.bofh.it>
[not found] ` <8GtnN-7TG-23@gated-at.bofh.it>
[not found] ` <8GVjY-PL-25@gated-at.bofh.it>
2007-07-15 17:17 ` [PATCH][RFC] 4K stacks default, not a debug thing any more...? Bodo Eggert
2007-07-15 17:35 ` Arjan van de Ven
2007-07-15 18:32 ` Måns Rullgård
2007-07-15 17:46 ` Rene Herman
2007-07-16 13:43 ` Bodo Eggert
2007-07-16 22:28 ` Rene Herman
2007-07-16 22:37 ` Ray Lee
2007-07-16 22:54 ` Alan Cox
2007-07-16 22:53 ` Ray Lee
2007-07-16 23:05 ` Rene Herman
2007-07-16 23:15 ` Ray Lee
2007-07-18 0:14 ` Alan Cox
2007-07-18 6:39 ` Ray Lee
2007-07-17 17:01 ` William Lee Irwin III
2007-07-17 23:39 ` Jesper Juhl
2007-07-18 0:22 ` Rene Herman
2007-07-16 22:54 ` Jesper Juhl
2007-07-16 23:01 ` Rene Herman
2007-07-16 23:42 ` Bodo Eggert
2007-07-16 23:51 ` Jesper Juhl
2007-07-19 19:34 ` Denis Vlasenko
2007-07-19 20:04 ` Bodo Eggert
2007-07-16 22:55 ` Rene Herman
2007-07-16 23:07 ` Matt Mackall
2007-07-16 23:12 ` Rene Herman
2007-07-16 23:27 ` Matt Mackall
2007-07-16 23:32 ` Rene Herman
2007-07-18 2:38 ` Rene Herman [this message]
2007-07-18 16:54 ` Matt Mackall
2007-07-18 17:17 ` Rene Herman
2007-07-19 0:15 ` Andrea Arcangeli
2007-07-19 0:39 ` Alan Cox
2007-07-19 1:33 ` Andrea Arcangeli
2007-07-19 1:37 ` Matt Mackall
2007-07-19 1:56 ` Rene Herman
2007-07-19 11:24 ` Andrea Arcangeli
2007-07-19 11:44 ` Alan Cox
2007-07-27 13:02 ` Eric Sandeen
2007-07-27 17:38 ` Alan Cox
2007-07-27 18:31 ` Satyam Sharma
2007-08-01 3:53 ` Eric Sandeen
2007-08-01 8:11 ` Dan Merillat
2007-08-01 10:04 ` Neil Brown
2007-08-10 4:51 ` Dan Merillat
2007-08-10 4:59 ` Neil Brown
2007-08-01 13:33 ` Andrea Arcangeli
2007-08-01 15:44 ` Alan Cox
2007-08-10 1:03 ` Dan Merillat
2007-07-19 9:23 ` Alan Cox
2007-07-19 10:52 ` Andrea Arcangeli
2007-07-27 13:03 ` Eric Sandeen
2007-07-27 17:18 ` Krzysztof Halasa
2007-07-19 0:41 ` Matt Mackall
2007-07-19 0:48 ` Rene Herman
2007-07-19 1:28 ` Matt Mackall
2007-07-16 23:13 ` Ray Lee
2007-07-16 23:22 ` Rene Herman
2007-07-16 23:35 ` Jesper Juhl
2007-07-16 23:40 ` Ray Lee
2007-07-17 0:57 ` Rene Herman
2007-07-17 16:14 ` Shawn Bohrer
2007-07-17 16:52 ` Rene Herman
2007-07-17 17:45 ` Zan Lynx
2007-07-18 0:16 ` Alan Cox
2007-07-16 23:45 ` Bodo Eggert
2007-07-17 0:28 ` Rene Herman
2007-07-17 10:06 ` Bodo Eggert
2007-07-17 14:38 ` Rene Herman
2007-07-17 23:19 ` Bodo Eggert
2007-07-17 23:29 ` Arjan van de Ven
2007-07-19 17:20 ` Bodo Eggert
2007-07-17 23:57 ` Rene Herman
2007-07-19 17:05 ` Bodo Eggert
2007-07-16 23:26 ` utz lehmann
2007-07-16 23:39 ` Måns Rullgård
2007-07-17 1:00 ` Rene Herman
2007-07-17 14:45 ` John Stoffel
2007-07-17 23:46 ` utz lehmann
[not found] <8IdHQ-7Pm-25@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-27@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-29@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-31@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-33@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-35@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-37@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-39@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-41@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-43@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-45@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-47@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-49@gated-at.bofh.it>
[not found] ` <8IdHQ-7Pm-23@gated-at.bofh.it>
2007-07-18 11:09 ` Nick Craig-Wood
[not found] <8HfVl-71J-15@gated-at.bofh.it>
[not found] ` <8Hgoq-7Cd-21@gated-at.bofh.it>
[not found] ` <8Hz7K-38K-37@gated-at.bofh.it>
[not found] ` <8HHeZ-7R1-21@gated-at.bofh.it>
[not found] ` <8HHoA-835-21@gated-at.bofh.it>
[not found] ` <8HHI2-8r2-27@gated-at.bofh.it>
[not found] ` <8HI1k-Dn-25@gated-at.bofh.it>
[not found] ` <8HIb2-PD-11@gated-at.bofh.it>
[not found] ` <8HIun-1e7-33@gated-at.bofh.it>
[not found] ` <8HJA3-2Nq-9@gated-at.bofh.it>
[not found] ` <8HXWo-8t2-17@gated-at.bofh.it>
[not found] ` <8HYzd-PZ-25@gated-at.bofh.it>
[not found] ` <8HZlt-27o-7@gated-at.bofh.it>
2007-07-18 8:37 ` Nick Craig-Wood
[not found] ` <8HHRD-rK-19@gated-at.bofh.it>
[not found] ` <8HI1j-Dn-21@gated-at.bofh.it>
[not found] ` <8HIb2-PD-5@gated-at.bofh.it>
[not found] ` <8IrUr-4SZ-9@gated-at.bofh.it>
[not found] ` <8IsdO-5g4-7@gated-at.bofh.it>
[not found] ` <8It9R-6Eb-3@gated-at.bofh.it>
[not found] ` <8IAkZ-WW-1@gated-at.bofh.it>
2007-07-19 13:37 ` Bodo Eggert
2007-07-11 17:16 Jesper Juhl
2007-07-11 17:54 ` Zan Lynx
2007-07-11 20:05 ` Daniel Phillips
2007-07-11 22:09 ` Neil Brown
2007-07-12 3:15 ` Daniel Phillips
2007-07-12 4:16 ` David Chinner
2007-07-12 4:59 ` Ray Lee
2007-07-12 20:24 ` Jesper Juhl
2007-07-13 0:34 ` Jeremy Fitzhardinge
2007-07-13 2:25 ` Jesper Juhl
2007-07-13 4:14 ` Jeremy Fitzhardinge
2007-07-13 9:19 ` Jan Engelhardt
2007-07-13 13:20 ` Rene Herman
2007-07-14 19:17 ` Matt Mackall
2007-07-14 22:19 ` Rene Herman
2007-07-16 23:38 ` Matt Mackall
2007-07-17 13:46 ` Rene Herman
2007-07-18 17:19 ` Phillip Susi
2007-07-18 17:32 ` Rene Herman
2007-07-18 17:32 ` Alan Cox
2007-07-18 17:33 ` Phillip Susi
2007-07-14 19:42 ` Matt Mackall
2007-07-12 6:08 ` Jeremy Fitzhardinge
2007-07-12 6:37 ` David Chinner
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=469D7D1B.4050909@gmail.com \
--to=rene.herman@gmail.com \
--cc=7eggert@gmx.de \
--cc=arjan@infradead.org \
--cc=dgc@sgi.com \
--cc=jeremy@goop.org \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=ray-lk@madrabbit.org \
--cc=wli@holomorphy.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