All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems
@ 2005-01-31  7:25 Matt Mackall
  2005-01-31  7:25 ` [PATCH 1/8] base-small: introduce the CONFIG_BASE_SMALL flag Matt Mackall
  2005-02-01  0:55 ` [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Horst von Brand
  0 siblings, 2 replies; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch series introduced a new pair of CONFIG_EMBEDDED options call
CONFIG_BASE_FULL/CONFIG_BASE_SMALL. Disabling CONFIG_BASE_FULL sets
the boolean CONFIG_BASE_SMALL to 1 and it is used to shrink a number
of core data structures. The space savings for the current batch is
around 14k.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/8] base-small: shrink major_names hash
  2005-01-31  7:25 ` [PATCH 1/8] base-small: introduce the CONFIG_BASE_SMALL flag Matt Mackall
@ 2005-01-31  7:25   ` Matt Mackall
  2005-01-31  7:25     ` [PATCH 3/8] base-small: shrink chrdevs hash Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL degrade genhd major names hash to linked list

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tq/drivers/block/genhd.c
===================================================================
--- tq.orig/drivers/block/genhd.c	2005-01-26 13:06:16.000000000 -0800
+++ tq/drivers/block/genhd.c	2005-01-26 13:08:23.000000000 -0800
@@ -15,7 +15,8 @@
 #include <linux/kmod.h>
 #include <linux/kobj_map.h>
 
-#define MAX_PROBE_HASH 255	/* random */
+/* degrade to linked list for small systems */
+#define MAX_PROBE_HASH (CONFIG_BASE_SMALL ? 1 : 255)
 
 static struct subsystem block_subsys;
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/8] base-small: introduce the CONFIG_BASE_SMALL flag
  2005-01-31  7:25 [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Matt Mackall
@ 2005-01-31  7:25 ` Matt Mackall
  2005-01-31  7:25   ` [PATCH 2/8] base-small: shrink major_names hash Matt Mackall
  2005-02-01  0:55 ` [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Horst von Brand
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Add CONFIG_BASE_SMALL for miscellaneous core size that don't warrant
their own options. Example users to follow.

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: mm2/init/Kconfig
===================================================================
--- mm2.orig/init/Kconfig	2005-01-30 21:26:29.000000000 -0800
+++ mm2/init/Kconfig	2005-01-30 21:51:08.000000000 -0800
@@ -286,6 +286,18 @@
 	   reported.  KALLSYMS_EXTRA_PASS is only a temporary workaround while
 	   you wait for kallsyms to be fixed.
 
+config BASE_FULL
+	default y
+	bool "Enable full-sized data structures for core" if EMBEDDED
+	help
+	  Disabling this option reduces the size of miscellaneous core
+	  kernel data structures.
+
+config BASE_SMALL
+	int
+	default 0 if BASE_FULL
+	default 1 if !BASE_FULL
+
 config FUTEX
 	bool "Enable futex support" if EMBEDDED
 	default y

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/8] base-small: shrink chrdevs hash
  2005-01-31  7:25   ` [PATCH 2/8] base-small: shrink major_names hash Matt Mackall
@ 2005-01-31  7:25     ` Matt Mackall
  2005-01-31  7:25       ` [PATCH 4/8] base-small: shrink PID tables Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL degrade char dev hash table to linked list

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tq/fs/char_dev.c
===================================================================
--- tq.orig/fs/char_dev.c	2005-01-26 13:06:15.000000000 -0800
+++ tq/fs/char_dev.c	2005-01-26 13:08:37.000000000 -0800
@@ -26,7 +26,8 @@
 
 static struct kobj_map *cdev_map;
 
-#define MAX_PROBE_HASH 255	/* random */
+/* degrade to linked list for small systems */
+#define MAX_PROBE_HASH (CONFIG_BASE_SMALL ? 1 : 255)
 
 static DEFINE_RWLOCK(chrdevs_lock);
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 5/8] base-small: shrink UID hash
  2005-01-31  7:25       ` [PATCH 4/8] base-small: shrink PID tables Matt Mackall
@ 2005-01-31  7:25         ` Matt Mackall
  2005-01-31  7:25           ` [PATCH 6/8] base-small: shrink futex queues Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL reduce UID lookup hash

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tq/kernel/user.c
===================================================================
--- tq.orig/kernel/user.c	2005-01-25 09:31:58.000000000 -0800
+++ tq/kernel/user.c	2005-01-26 13:11:10.000000000 -0800
@@ -18,7 +18,8 @@
  * UID task count cache, to get fast user lookup in "alloc_uid"
  * when changing user ID's (ie setuid() and friends).
  */
-#define UIDHASH_BITS		8
+
+#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
 #define UIDHASH_SZ		(1 << UIDHASH_BITS)
 #define UIDHASH_MASK		(UIDHASH_SZ - 1)
 #define __uidhashfn(uid)	(((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/8] base-small: shrink PID tables
  2005-01-31  7:25     ` [PATCH 3/8] base-small: shrink chrdevs hash Matt Mackall
@ 2005-01-31  7:25       ` Matt Mackall
  2005-01-31  7:25         ` [PATCH 5/8] base-small: shrink UID hash Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL reduce size of pidmap table for small machines

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tq/include/linux/threads.h
===================================================================
--- tq.orig/include/linux/threads.h	2005-01-25 09:26:16.000000000 -0800
+++ tq/include/linux/threads.h	2005-01-26 15:16:55.000000000 -0800
@@ -7,7 +7,7 @@
  * The default limit for the nr of threads is now in
  * /proc/sys/kernel/threads-max.
  */
- 
+
 /*
  * Maximum supported processors that can run under SMP.  This value is
  * set via configure setting.  The maximum is equal to the size of the
@@ -25,11 +25,12 @@
 /*
  * This controls the default maximum pid allocated to a process
  */
-#define PID_MAX_DEFAULT 0x8000
+#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
 
 /*
  * A maximum of 4 million PIDs should be enough for a while:
  */
-#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4*1024*1024 : PID_MAX_DEFAULT)
+#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
+	(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
 
 #endif

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 7/8] base-small: shrink timer hashes
  2005-01-31  7:25           ` [PATCH 6/8] base-small: shrink futex queues Matt Mackall
@ 2005-01-31  7:25             ` Matt Mackall
  2005-01-31  7:25               ` [PATCH 8/8] base-small: shrink console buffer Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL reduce timer list hashes

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: mm2/kernel/timer.c
===================================================================
--- mm2.orig/kernel/timer.c	2005-01-30 21:26:28.000000000 -0800
+++ mm2/kernel/timer.c	2005-01-30 21:51:16.000000000 -0800
@@ -51,8 +51,9 @@
 /*
  * per-CPU timer vector definitions:
  */
-#define TVN_BITS 6
-#define TVR_BITS 8
+
+#define TVN_BITS (CONFIG_BASE_SMALL ? 4 : 6)
+#define TVR_BITS (CONFIG_BASE_SMALL ? 6 : 8)
 #define TVN_SIZE (1 << TVN_BITS)
 #define TVR_SIZE (1 << TVR_BITS)
 #define TVN_MASK (TVN_SIZE - 1)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 6/8] base-small: shrink futex queues
  2005-01-31  7:25         ` [PATCH 5/8] base-small: shrink UID hash Matt Mackall
@ 2005-01-31  7:25           ` Matt Mackall
  2005-01-31  7:25             ` [PATCH 7/8] base-small: shrink timer hashes Matt Mackall
  0 siblings, 1 reply; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL reduce futex hash table

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: tq/kernel/futex.c
===================================================================
--- tq.orig/kernel/futex.c	2005-01-25 09:26:18.000000000 -0800
+++ tq/kernel/futex.c	2005-01-26 13:11:43.000000000 -0800
@@ -40,7 +40,7 @@
 #include <linux/pagemap.h>
 #include <linux/syscalls.h>
 
-#define FUTEX_HASHBITS 8
+#define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
 
 /*
  * Futexes are matched on equal values of this key.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 8/8] base-small: shrink console buffer
  2005-01-31  7:25             ` [PATCH 7/8] base-small: shrink timer hashes Matt Mackall
@ 2005-01-31  7:25               ` Matt Mackall
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Mackall @ 2005-01-31  7:25 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

CONFIG_BASE_SMALL reduce console transfer buffer

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: mm2/include/linux/vt_kern.h
===================================================================
--- mm2.orig/include/linux/vt_kern.h	2005-01-30 21:26:28.000000000 -0800
+++ mm2/include/linux/vt_kern.h	2005-01-30 21:51:19.000000000 -0800
@@ -84,7 +84,8 @@
  * vc_screen.c shares this temporary buffer with the console write code so that
  * we can easily avoid touching user space while holding the console spinlock.
  */
-#define CON_BUF_SIZE	PAGE_SIZE
+
+#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
 extern char con_buf[CON_BUF_SIZE];
 extern struct semaphore con_buf_sem;
 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems
  2005-01-31  7:25 [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Matt Mackall
  2005-01-31  7:25 ` [PATCH 1/8] base-small: introduce the CONFIG_BASE_SMALL flag Matt Mackall
@ 2005-02-01  0:55 ` Horst von Brand
  2005-02-01  4:18   ` Matt Mackall
  1 sibling, 1 reply; 11+ messages in thread
From: Horst von Brand @ 2005-02-01  0:55 UTC (permalink / raw)
  To: Matt Mackall; +Cc: Andrew Morton, linux-kernel

Matt Mackall <mpm@selenic.com> said:
> This patch series introduced a new pair of CONFIG_EMBEDDED options call
> CONFIG_BASE_FULL/CONFIG_BASE_SMALL. Disabling CONFIG_BASE_FULL sets
> the boolean CONFIG_BASE_SMALL to 1 and it is used to shrink a number
> of core data structures. The space savings for the current batch is
> around 14k.

Why _two_ config options?
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems
  2005-02-01  0:55 ` [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Horst von Brand
@ 2005-02-01  4:18   ` Matt Mackall
  0 siblings, 0 replies; 11+ messages in thread
From: Matt Mackall @ 2005-02-01  4:18 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Andrew Morton, linux-kernel

On Mon, Jan 31, 2005 at 09:55:32PM -0300, Horst von Brand wrote:
> Matt Mackall <mpm@selenic.com> said:
> > This patch series introduced a new pair of CONFIG_EMBEDDED options call
> > CONFIG_BASE_FULL/CONFIG_BASE_SMALL. Disabling CONFIG_BASE_FULL sets
> > the boolean CONFIG_BASE_SMALL to 1 and it is used to shrink a number
> > of core data structures. The space savings for the current batch is
> > around 14k.
> 
> Why _two_ config options?

Um, Andrew made me do it?

One option is an int and is used thusly:

#define FOO (CONFIG_BASE_SMALL ? 1 : 1000)

But it's also sometimes useful to have two opposing options so that
you can use:

obj-(CONFIG_OBJ_A) += a.obj obj-(CONFIG_OBJ_B) += b.obj

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-02-01  4:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-31  7:25 [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Matt Mackall
2005-01-31  7:25 ` [PATCH 1/8] base-small: introduce the CONFIG_BASE_SMALL flag Matt Mackall
2005-01-31  7:25   ` [PATCH 2/8] base-small: shrink major_names hash Matt Mackall
2005-01-31  7:25     ` [PATCH 3/8] base-small: shrink chrdevs hash Matt Mackall
2005-01-31  7:25       ` [PATCH 4/8] base-small: shrink PID tables Matt Mackall
2005-01-31  7:25         ` [PATCH 5/8] base-small: shrink UID hash Matt Mackall
2005-01-31  7:25           ` [PATCH 6/8] base-small: shrink futex queues Matt Mackall
2005-01-31  7:25             ` [PATCH 7/8] base-small: shrink timer hashes Matt Mackall
2005-01-31  7:25               ` [PATCH 8/8] base-small: shrink console buffer Matt Mackall
2005-02-01  0:55 ` [PATCH 0/8] base-small: CONFIG_BASE_SMALL for small systems Horst von Brand
2005-02-01  4:18   ` Matt Mackall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.