* [Patch:004/005] wait_table and zonelist initializing for memory hotadd (wait_table initialization)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
Wait_table is initialized according to zone size at boot time.
But, we cannot know the maixmum zone size when memory hotplug is enabled.
It can be changed.... And resizing of wait_table is hard.
So kernel allocate and initialzie wait_table as its maximum size.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
mm/page_alloc.c | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 15:15:36.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 19:03:23.000000000 +0900
@@ -1786,6 +1786,7 @@ void __init build_all_zonelists(void)
*/
#define PAGES_PER_WAITQUEUE 256
+#ifndef CONFIG_MEMORY_HOTPLUG
static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
{
unsigned long size = 1;
@@ -1804,6 +1805,33 @@ static inline unsigned long wait_table_h
return max(size, 4UL);
}
+#else
+/*
+ * XXX: Because zone size might be changed by hot-add,
+ * It is hard to determin suitable value for wait_table as traditional.
+ * So, we use maximum entries now.
+ *
+ * The max wait table size = 4096 x sizeof(wait_queue_head_t) byte.
+ * ex:
+ * i386 (preemption config) : 4096 x 16 = 64Kbyte.
+ * ia64, x86-64 (no preemption): 4096 x 20 = 80Kbyte.
+ * ia64, x86-64 (preemption) : 4096 x 24 = 96Kbyte.
+ *
+ * The maximum entries are prepared when a zone's memory is
+ * (512K + 256) pages or more by traditional way. (See above)
+ * It equals ....
+ * i386, x86-64, powerpc(4K page size) : = ( 2G + 1M)byte.
+ * ia64(16K page size) : = ( 8G + 4M)byte.
+ * powerpc (64K page size) : = (32G +16M)byte.
+ *
+ * If system doesn't have this size or more memory in the future,
+ * wait_table might be too bigger than suitable.
+ */
+static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
+{
+ return 4096UL;
+}
+#endif
/*
* This is an integer logarithm so that shifts can be used later
@@ -2072,10 +2100,11 @@ void __init setup_per_cpu_pageset(void)
#endif
static __meminit
-void zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
+int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
{
int i;
struct pglist_data *pgdat = zone->zone_pgdat;
+ size_t alloc_size;
/*
* The per-page waitqueue mechanism uses hashed waitqueues
@@ -2085,12 +2114,32 @@ void zone_wait_table_init(struct zone *z
wait_table_hash_nr_entries(zone_size_pages);
zone->wait_table_bits =
wait_table_bits(zone->wait_table_hash_nr_entries);
- zone->wait_table = (wait_queue_head_t *)
- alloc_bootmem_node(pgdat, zone->wait_table_hash_nr_entries
- * sizeof(wait_queue_head_t));
+ alloc_size = zone->wait_table_hash_nr_entries
+ * sizeof(wait_queue_head_t);
+
+ if (system_state == SYSTEM_BOOTING) {
+ zone->wait_table = (wait_queue_head_t *)
+ alloc_bootmem_node(pgdat, alloc_size);
+ } else {
+ /*
+ * XXX: This case means that a zone whose size was 0 gets new
+ * memory by memory hot-add.
+ * But, this may be the case that "new node" is hotadded.
+ * If its case, vmalloc() will not get this new node's
+ * memory. Because this wait_table must be initialized
+ * to use this new node itself too.
+ * To use this new node's memory, further consideration
+ * will be necessary.
+ */
+ zone->wait_table = (wait_queue_head_t *)vmalloc(alloc_size);
+ }
+ if (!zone->wait_table)
+ return -ENOMEM;
for(i = 0; i < zone->wait_table_hash_nr_entries; ++i)
init_waitqueue_head(zone->wait_table + i);
+
+ return 0;
}
static __meminit void zone_pcp_init(struct zone *zone)
@@ -2117,8 +2166,10 @@ __meminit int init_currently_empty_zone(
unsigned long size)
{
struct pglist_data *pgdat = zone->zone_pgdat;
-
- zone_wait_table_init(zone, size);
+ int ret;
+ ret = zone_wait_table_init(zone, size);
+ if (ret)
+ return ret;
pgdat->nr_zones = zone_idx(zone) + 1;
zone->zone_start_pfn = zone_start_pfn;
--
Yasunori Goto
^ permalink raw reply
* [Patch:005/005] wait_table and zonelist initializing for memory hotadd (update zonelists)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
In current code, zonelist is considered to be build once, no modification.
But MemoryHotplug can add new zone/pgdat. It must be updated.
This patch modifies build_all_zonelists().
By this, build_all_zonelist() can reconfig pgdat's zonelists.
To update them safety, this patch use stop_machine_run().
Other cpus don't touch among updating them by using it.
In old version (V2 of node hotadd), kernel updated them after zone
initialization.
But present_page of its new zone is still 0, because online_page()
is not called yet at this time.
Build_zonelists() checks present_pages to find present zone.
It was too early. So, I changed it after online_pages().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
mm/memory_hotplug.c | 12 ++++++++++++
mm/page_alloc.c | 26 +++++++++++++++++++++-----
2 files changed, 33 insertions(+), 5 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-10 14:15:24.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-10 14:15:34.000000000 +0900
@@ -37,6 +37,7 @@
#include <linux/nodemask.h>
#include <linux/vmalloc.h>
#include <linux/mempolicy.h>
+#include <linux/stop_machine.h>
#include <asm/tlbflush.h>
#include "internal.h"
@@ -1763,14 +1764,29 @@ static void __meminit build_zonelists(pg
#endif /* CONFIG_NUMA */
-void __init build_all_zonelists(void)
+/* return values int ....just for stop_machine_run() */
+static int __meminit __build_all_zonelists(void *dummy)
{
- int i;
+ int nid;
+ for_each_online_node(nid)
+ build_zonelists(NODE_DATA(nid));
+ return 0;
+}
+
+void __meminit build_all_zonelists(void)
+{
+ if (system_state == SYSTEM_BOOTING) {
+ __build_all_zonelists(0);
+ cpuset_init_current_mems_allowed();
+ } else {
+ /* we have to stop all cpus to guaranntee there is no user
+ of zonelist */
+ stop_machine_run(__build_all_zonelists, NULL, NR_CPUS);
+ /* cpuset refresh routine should be here */
+ }
- for_each_online_node(i)
- build_zonelists(NODE_DATA(i));
printk("Built %i zonelists\n", num_online_nodes());
- cpuset_init_current_mems_allowed();
+
}
/*
Index: pgdat10/mm/memory_hotplug.c
===================================================================
--- pgdat10.orig/mm/memory_hotplug.c 2006-04-10 14:15:13.000000000 +0900
+++ pgdat10/mm/memory_hotplug.c 2006-04-10 14:15:34.000000000 +0900
@@ -123,6 +123,7 @@ int online_pages(unsigned long pfn, unsi
unsigned long flags;
unsigned long onlined_pages = 0;
struct zone *zone;
+ int need_zonelists_rebuild = 0;
/*
* This doesn't need a lock to do pfn_to_page().
@@ -135,6 +136,14 @@ int online_pages(unsigned long pfn, unsi
grow_pgdat_span(zone->zone_pgdat, pfn, pfn + nr_pages);
pgdat_resize_unlock(zone->zone_pgdat, &flags);
+ /*
+ * If this zone is not populated, then it is not in zonelist.
+ * This means the page allocator ignores this zone.
+ * So, zonelist must be updated after online.
+ */
+ if (!populated_zone(zone))
+ need_zonelists_rebuild = 1;
+
for (i = 0; i < nr_pages; i++) {
struct page *page = pfn_to_page(pfn + i);
online_page(page);
@@ -145,5 +154,8 @@ int online_pages(unsigned long pfn, unsi
setup_per_zone_pages_min();
+ if (need_zonelists_rebuild)
+ build_all_zonelists();
+
return 0;
}
--
Yasunori Goto
^ permalink raw reply
* [PATCH] Separate the raw diff and patch with a newline
From: Petr Baudis @ 2006-04-11 11:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vr7456jb4.fsf@assigned-by-dhcp.cox.net>
More friendly for human reading I believe, and possibly friendlier to some
parsers (although only by an epsilon).
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
combine-diff.c | 1 +
diff.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/combine-diff.c b/combine-diff.c
index 748dc30..0e25788 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -867,6 +867,7 @@ const char *diff_tree_combined_merge(con
header = NULL;
}
opt->output_format = DIFF_FORMAT_PATCH;
+ putchar(opt->line_termination);
}
for (p = paths; p; p = p->next) {
if (show_combined_diff(p, num_parent, dense,
diff --git a/diff.c b/diff.c
index 00c79aa..86e4251 100644
--- a/diff.c
+++ b/diff.c
@@ -1322,6 +1322,7 @@ void diff_flush(struct diff_options *opt
struct diff_filepair *p = q->queue[i];
flush_one_pair(p, DIFF_FORMAT_RAW, options);
}
+ putchar(options->line_termination);
}
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
^ permalink raw reply related
* 3.0.2-testing: pci_set_dma_mask, pci_set_consistent_dma_mask(pci, 0x0fffffff) returns < 0 (ICE1712)
From: Tom Hibbert @ 2006-04-11 11:31 UTC (permalink / raw)
To: xen-devel
Hi all,
I'm currently running on Ubuntu Dapper and xen 3.0 testing. I noticed my
sound card didnt work.
I looked in dmesg and found this:
Apr 9 17:49:29 phoenix kernel: [ 27.490852] architecture does not
support 28bit PCI busmaster DMA
Grepping the kernel I came up with this, from sound/pci/ice1712/ice1712.c:
/* check, if we can restrict PCI DMA transfers to 28 bits */
if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||
pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {
snd_printk(KERN_ERR "architecture does not support 28bit
PCI busmaster DMA\n");
pci_disable_device(pci);
return -ENXIO;
}
I commented it out, and the module loaded but I got a burst of static
from the speakers. I suspect that this code is incompatible with Xen.
Why does Xen not allow the dom0 to set these parameters? My development
workstation is my main home box, and I like to have sound on it.
Thanks
Tom
^ permalink raw reply
* [Patch:002/005] wait_table and zonelist initializing for memory hotadd (change to meminit for build_zonelist)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
This is a patch to change definition of some functions and data
from __init to __meminit.
These functions and data can be used after bootup by this patch to
be used for hot-add codes.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/bootmem.h | 4 ++--
mm/page_alloc.c | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 14:07:26.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 15:15:28.000000000 +0900
@@ -82,8 +82,8 @@ EXPORT_SYMBOL(zone_table);
static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" };
int min_free_kbytes = 1024;
-unsigned long __initdata nr_kernel_pages;
-unsigned long __initdata nr_all_pages;
+unsigned long __meminitdata nr_kernel_pages;
+unsigned long __meminitdata nr_all_pages;
#ifdef CONFIG_DEBUG_VM
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
@@ -1576,7 +1576,7 @@ void show_free_areas(void)
*
* Add all populated zones of a node to the zonelist.
*/
-static int __init build_zonelists_node(pg_data_t *pgdat,
+static int __meminit build_zonelists_node(pg_data_t *pgdat,
struct zonelist *zonelist, int nr_zones, int zone_type)
{
struct zone *zone;
@@ -1612,7 +1612,7 @@ static inline int highest_zone(int zone_
#ifdef CONFIG_NUMA
#define MAX_NODE_LOAD (num_online_nodes())
-static int __initdata node_load[MAX_NUMNODES];
+static int __meminitdata node_load[MAX_NUMNODES];
/**
* find_next_best_node - find the next node that should appear in a given node's fallback list
* @node: node whose fallback list we're appending
@@ -1627,7 +1627,7 @@ static int __initdata node_load[MAX_NUMN
* on them otherwise.
* It returns -1 if no node is found.
*/
-static int __init find_next_best_node(int node, nodemask_t *used_node_mask)
+static int __meminit find_next_best_node(int node, nodemask_t *used_node_mask)
{
int n, val;
int min_val = INT_MAX;
@@ -1673,7 +1673,7 @@ static int __init find_next_best_node(in
return best_node;
}
-static void __init build_zonelists(pg_data_t *pgdat)
+static void __meminit build_zonelists(pg_data_t *pgdat)
{
int i, j, k, node, local_node;
int prev_node, load;
@@ -1725,7 +1725,7 @@ static void __init build_zonelists(pg_da
#else /* CONFIG_NUMA */
-static void __init build_zonelists(pg_data_t *pgdat)
+static void __meminit build_zonelists(pg_data_t *pgdat)
{
int i, j, k, node, local_node;
@@ -2133,7 +2133,7 @@ static __meminit void init_currently_emp
* - mark all memory queues empty
* - clear the memory bitmaps
*/
-static void __init free_area_init_core(struct pglist_data *pgdat,
+static void __meminit free_area_init_core(struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long *zholes_size)
{
unsigned long j;
@@ -2213,7 +2213,7 @@ static void __init alloc_node_mem_map(st
#endif /* CONFIG_FLAT_NODE_MEM_MAP */
}
-void __init free_area_init_node(int nid, struct pglist_data *pgdat,
+void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long node_start_pfn,
unsigned long *zholes_size)
{
Index: pgdat10/include/linux/bootmem.h
===================================================================
--- pgdat10.orig/include/linux/bootmem.h 2006-04-10 18:30:42.000000000 +0900
+++ pgdat10/include/linux/bootmem.h 2006-04-11 14:07:27.000000000 +0900
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid,
}
#endif
-extern unsigned long __initdata nr_kernel_pages;
-extern unsigned long __initdata nr_all_pages;
+extern unsigned long nr_kernel_pages;
+extern unsigned long nr_all_pages;
extern void *__init alloc_large_system_hash(const char *tablename,
unsigned long bucketsize,
--
Yasunori Goto
^ permalink raw reply
* [Patch:003/005] wait_table and zonelist initializing for memory hotadd(add return code for init_current_empty_zone)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
When add_zone() is called against empty zone (not populated zone),
we have to initialize the zone which didn't initialize at boot time.
But, init_currently_empty_zone() may fail due to allocation of
wait table. So, this patch is to catch its error code.
Changes against wait_table is in the next patch.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/mmzone.h | 3 +++
mm/memory_hotplug.c | 15 +++++++++++++--
mm/page_alloc.c | 11 ++++++++---
3 files changed, 24 insertions(+), 5 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 15:15:36.000000000 +0900
@@ -2112,8 +2112,9 @@ static __meminit void zone_pcp_init(stru
zone->name, zone->present_pages, batch);
}
-static __meminit void init_currently_empty_zone(struct zone *zone,
- unsigned long zone_start_pfn, unsigned long size)
+__meminit int init_currently_empty_zone(struct zone *zone,
+ unsigned long zone_start_pfn,
+ unsigned long size)
{
struct pglist_data *pgdat = zone->zone_pgdat;
@@ -2125,6 +2126,8 @@ static __meminit void init_currently_emp
memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn);
zone_init_free_lists(pgdat, zone, zone->spanned_pages);
+
+ return 0;
}
/*
@@ -2139,6 +2142,7 @@ static void __meminit free_area_init_cor
unsigned long j;
int nid = pgdat->node_id;
unsigned long zone_start_pfn = pgdat->node_start_pfn;
+ int ret;
pgdat_resize_init(pgdat);
pgdat->nr_zones = 0;
@@ -2180,7 +2184,8 @@ static void __meminit free_area_init_cor
continue;
zonetable_add(zone, nid, j, zone_start_pfn, size);
- init_currently_empty_zone(zone, zone_start_pfn, size);
+ ret = init_currently_empty_zone(zone, zone_start_pfn, size);
+ BUG_ON(ret);
zone_start_pfn += size;
}
}
Index: pgdat10/mm/memory_hotplug.c
===================================================================
--- pgdat10.orig/mm/memory_hotplug.c 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/mm/memory_hotplug.c 2006-04-11 15:15:36.000000000 +0900
@@ -26,7 +26,7 @@
extern void zonetable_add(struct zone *zone, int nid, int zid, unsigned long pfn,
unsigned long size);
-static void __add_zone(struct zone *zone, unsigned long phys_start_pfn)
+static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
{
struct pglist_data *pgdat = zone->zone_pgdat;
int nr_pages = PAGES_PER_SECTION;
@@ -34,8 +34,15 @@ static void __add_zone(struct zone *zone
int zone_type;
zone_type = zone - pgdat->node_zones;
+ if (!populated_zone(zone)) {
+ int ret = 0;
+ ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages);
+ if (ret < 0)
+ return ret;
+ }
memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn);
zonetable_add(zone, nid, zone_type, phys_start_pfn, nr_pages);
+ return 0;
}
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
@@ -50,7 +57,11 @@ static int __add_section(struct zone *zo
if (ret < 0)
return ret;
- __add_zone(zone, phys_start_pfn);
+ ret = __add_zone(zone, phys_start_pfn);
+
+ if (ret < 0)
+ return ret;
+
return register_new_memory(__pfn_to_section(phys_start_pfn));
}
Index: pgdat10/include/linux/mmzone.h
===================================================================
--- pgdat10.orig/include/linux/mmzone.h 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/include/linux/mmzone.h 2006-04-11 15:15:36.000000000 +0900
@@ -332,6 +332,9 @@ void wakeup_kswapd(struct zone *zone, in
int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
int classzone_idx, int alloc_flags);
+extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
+ unsigned long size);
+
#ifdef CONFIG_HAVE_MEMORY_PRESENT
void memory_present(int nid, unsigned long start, unsigned long end);
#else
--
Yasunori Goto
^ permalink raw reply
* Re: [klibc] [PATCH] kbuild: rebuild initramfs if included files changes
From: Sam Ravnborg @ 2006-04-11 11:30 UTC (permalink / raw)
To: LKML, klibc, H. Peter Anvin
In-Reply-To: <20060410223209.GA16842@mars.ravnborg.org>
On Tue, Apr 11, 2006 at 12:32:09AM +0200, Sam Ravnborg wrote:
> On Sun, Apr 09, 2006 at 10:59:20PM +0200, Sam Ravnborg wrote:
> > This fix has been implemented in preparation for the upcoming klibc
> > merge in -mm. But as it fixes a real (but rare I hope) bug in vanilla
> > kernel it will be added to my pending 2.6.17 kbuild queue.
> >
> > I've done quite some changes to the gen_initramfs script and
> > being shell programming newbie review by more experienced shell
> > hackers would be appreciated.
> >
> > I did a git mv scripts/gen_initramfs_list.sh usr/gen_initramfs.sh
> > But the changes was so many that git does not see the rename.
> > Due to the rename the diffstat shows a bit mroe changes than reality.
>
> This patch turned out to be bogus.
> I have something new in the works - will be finished tomorrow.
And here it goes.
scripts/gen_initramfs_list.sh | 225 ++++++++++++++++++++++++++++--------------
usr/Makefile | 91 ++++++----------
2 files changed, 189 insertions(+), 127 deletions(-)
diff-tree d39a206bc35d46a3b2eb98cd4f34e340d5e56a50 (from d9df92e22aca939857c5bc9ecb130ef22307ccc1)
Author: Sam Ravnborg <sam@mars.ravnborg.org>
Date: Tue Apr 11 13:24:32 2006 +0200
kbuild: rebuild initramfs if content of initramfs changes
initramfs.cpio.gz being build in usr/ and included in the
kernel was not rebuild when the included files changed.
To fix this the following was done:
- let gen_initramfs.sh generate a list of files and directories included
in the initramfs
- gen_initramfs generate the gzipped cpio archive so we could simplify
the kbuild file (Makefile)
- utilising the kbuild infrastructure so when uid/gid root mapping changes
the initramfs will be rebuild
With this change we have a much more robust initramfs generation.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 6d41116..56b3bed 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -1,22 +1,55 @@
#!/bin/bash
# Copyright (C) Martin Schlemmer <azarah@nosferatu.za.org>
-# Released under the terms of the GNU GPL
-#
-# Generate a newline separated list of entries from the file/directory
-# supplied as an argument.
-#
-# If a file/directory is not supplied then generate a small dummy file.
+# Copyright (c) 2006 Sam Ravnborg <sam@ravnborg.org>
#
-# The output is suitable for gen_init_cpio built from usr/gen_init_cpio.c.
+# Released under the terms of the GNU GPL
#
+# Generate a cpio packed initramfs. It uses gen_init_cpio to generate
+# the cpio archive, and gzip to pack it.
+# The script may also be used to generate the inputfile used for gen_init_cpio
+# This script assumes that gen_init_cpio is located in usr/ directory
+
+# error out on errors
+set -e
+
+usage() {
+cat << EOF
+Usage:
+$0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ...
+ -o <file> Create gzipped initramfs file named <file> using
+ gen_init_cpio and gzip
+ -u <uid> User ID to map to user ID 0 (root).
+ <uid> is only meaningful if <cpio_source>
+ is a directory.
+ -g <gid> Group ID to map to group ID 0 (root).
+ <gid> is only meaningful if <cpio_source>
+ is a directory.
+ <cpio_source> File list or directory for cpio archive.
+ If <cpio_source> is a .cpio file it will be used
+ as direct input to initramfs.
+ -d Output the default cpio list.
+
+All options except -o and -l may be repeated and are interpreted
+sequentially and immediately. -u and -g states are preserved across
+<cpio_source> options so an explicit "-u 0 -g 0" is required
+to reset the root/group mapping.
+EOF
+}
+list_default_initramfs() {
+ # echo usr/kinit/kinit
+ :
+}
+
default_initramfs() {
- cat <<-EOF
+ cat <<-EOF >> ${output}
# This is a very simple, default initramfs
dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
dir /root 0700 0 0
+ # file /kinit usr/kinit/kinit 0755 0 0
+ # slink /init kinit 0755 0 0
EOF
}
@@ -40,20 +73,30 @@ filetype() {
echo "invalid"
fi
return 0
+}
+
+list_print_mtime() {
+ :
}
print_mtime() {
- local argv1="$1"
local my_mtime="0"
- if [ -e "${argv1}" ]; then
- my_mtime=$(find "${argv1}" -printf "%T@\n" | sort -r | head -n 1)
+ if [ -e "$1" ]; then
+ my_mtime=$(find "$1" -printf "%T@\n" | sort -r | head -n 1)
fi
-
- echo "# Last modified: ${my_mtime}"
- echo
+
+ echo "# Last modified: ${my_mtime}" >> ${output}
+ echo "" >> ${output}
+}
+
+list_parse() {
+ echo "$1 \\"
}
+# for each file print a line in following format
+# <filetype> <name> <path to file> <octal mode> <uid> <gid>
+# for links, devices etc the format differs. See gen_init_cpio for details
parse() {
local location="$1"
local name="${location/${srcdir}//}"
@@ -99,80 +142,112 @@ parse() {
;;
esac
- echo "${str}"
+ echo "${str}" >> ${output}
return 0
}
-usage() {
- printf "Usage:\n"
- printf "$0 [ [-u <root_uid>] [-g <root_gid>] [-d | <cpio_source>] ] . . .\n"
- printf "\n"
- printf -- "-u <root_uid> User ID to map to user ID 0 (root).\n"
- printf " <root_uid> is only meaningful if <cpio_source>\n"
- printf " is a directory.\n"
- printf -- "-g <root_gid> Group ID to map to group ID 0 (root).\n"
- printf " <root_gid> is only meaningful if <cpio_source>\n"
- printf " is a directory.\n"
- printf "<cpio_source> File list or directory for cpio archive.\n"
- printf " If <cpio_source> is not provided then a\n"
- printf " a default list will be output.\n"
- printf -- "-d Output the default cpio list. If no <cpio_source>\n"
- printf " is given then the default cpio list will be output.\n"
- printf "\n"
- printf "All options may be repeated and are interpreted sequentially\n"
- printf "and immediately. -u and -g states are preserved across\n"
- printf "<cpio_source> options so an explicit \"-u 0 -g 0\" is required\n"
- printf "to reset the root/group mapping.\n"
+unknown_option() {
+ printf "ERROR: unknown option \"$arg\"\n" >&2
+ printf "If the filename validly begins with '-', " >&2
+ printf "then it must be prefixed\n" >&2
+ printf "by './' so that it won't be interpreted as an option." >&2
+ printf "\n" >&2
+ usage >&2
+ exit 1
+}
+
+list_header() {
+ echo "deps_initramfs := \\"
+}
+
+header() {
+ printf "\n#####################\n# $1\n" >> ${output}
+}
+
+# process one directory (incl sub-directories)
+dir_filelist() {
+ ${dep_list}header "$1"
+
+ srcdir=$(echo "$1" | sed -e 's://*:/:g')
+ dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" 2>/dev/null)
+
+ # If $dirlist is only one line, then the directory is empty
+ if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
+ ${dep_list}print_mtime "$1"
+
+ echo "${dirlist}" | \
+ while read x; do
+ ${dep_list}parse ${x}
+ done
+ fi
}
-build_list() {
- printf "\n#####################\n# $cpio_source\n"
-
- if [ -f "$cpio_source" ]; then
- print_mtime "$cpio_source"
- cat "$cpio_source"
- elif [ -d "$cpio_source" ]; then
- srcdir=$(echo "$cpio_source" | sed -e 's://*:/:g')
- dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" 2>/dev/null)
-
- # If $dirlist is only one line, then the directory is empty
- if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
- print_mtime "$cpio_source"
-
- echo "${dirlist}" | \
- while read x; do
- parse ${x}
- done
+# if only one file is specified and it is .cpio file then use it direct as fs
+# if a directory is specified then add all files in given direcotry to fs
+# if a regular file is specified assume it is in gen_initramfs format
+input_file() {
+ source="$1"
+ if [ -f "$1" ]; then
+ ${dep_list}header "$1"
+ is_cpio="$(echo "$1" | sed 's/^.*\.cpio/cpio/')"
+ if [ $2 -eq 0 -a ${is_cpio} == "cpio" ]; then
+ cpio_file=$1
+ [ ! -z ${dep_list} ] && echo "$1"
+ return 0
+ fi
+ if [ -z ${dep_list} ]; then
+ print_mtime "$1" >> ${output}
+ cat "$1" >> ${output}
else
- # Failsafe in case directory is empty
- default_initramfs
+ grep ^file "$1" | cut -d ' ' -f 3
fi
+ elif [ -d "$1" ]; then
+ dir_filelist "$1"
else
- echo " $0: Cannot open '$cpio_source'" >&2
+ echo " ${prog}: Cannot open '$1'" >&2
exit 1
fi
}
-
+prog=$0
root_uid=0
root_gid=0
+dep_list=
+cpio_file=
+cpio_list=
+output="/dev/stdout"
+output_file=""
+arg="$1"
+case "$arg" in
+ "-l") # files included in initramfs - used by kbuild
+ dep_list="list_"
+ shift
+ ;;
+ "-o") # generate gzipped cpio image named $1
+ shift
+ output_file="$1"
+ cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
+ output=${cpio_list}
+ shift
+ ;;
+esac
while [ $# -gt 0 ]; do
arg="$1"
shift
case "$arg" in
- "-u")
+ "-u") # map $1 to uid=0 (root)
root_uid="$1"
shift
;;
- "-g")
+ "-g") # map $1 to gid=0 (root)
root_gid="$1"
shift
;;
- "-d")
+ "-d") # display default initramfs list
default_list="$arg"
- default_initramfs
+ ${dep_list}default_initramfs
;;
"-h")
usage
@@ -181,23 +256,27 @@ while [ $# -gt 0 ]; do
*)
case "$arg" in
"-"*)
- printf "ERROR: unknown option \"$arg\"\n" >&2
- printf "If the filename validly begins with '-', then it must be prefixed\n" >&2
- printf "by './' so that it won't be interpreted as an option." >&2
- printf "\n" >&2
- usage >&2
- exit 1
+ unknown_option
;;
- *)
- cpio_source="$arg"
- build_list
+ *) # input file/dir - process it
+ input_file "$arg" "$#"
;;
esac
;;
esac
done
-
-# spit out the default cpio list if a source hasn't been specified
-[ -z "$cpio_source" -a -z "$default_list" ] && default_initramfs
+# If output_file is set we will generate cpio archive and gzip it
+# we are carefull to delete tmp files
+if [ ! -z ${output_file} ]; then
+ if [ -z ${cpio_file} ]; then
+ cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)"
+ usr/gen_init_cpio ${cpio_list} > ${cpio_tfile}
+ else
+ cpio_tfile=${cpio_file}
+ fi
+ rm ${cpio_list}
+ cat ${cpio_tfile} | gzip -f -9 - > ${output_file}
+ [ -z ${cpio_file} ] && rm ${cpio_tfile}
+fi
exit 0
diff --git a/usr/Makefile b/usr/Makefile
index e2129cb..19d74e6 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -1,65 +1,48 @@
+#
+# kbuild file for usr/ - including initramfs image
+#
-obj-y := initramfs_data.o
-
-hostprogs-y := gen_init_cpio
+klibcdirs:;
-clean-files := initramfs_data.cpio.gz initramfs_list
+# Generate builtin.o based on initramfs_data.o
+obj-y := initramfs_data.o
# initramfs_data.o contains the initramfs_data.cpio.gz image.
# The image is included using .incbin, a dependency which is not
# tracked automatically.
$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
-
-ifdef CONFIG_INITRAMFS_ROOT_UID
-gen_initramfs_args += -u $(CONFIG_INITRAMFS_ROOT_UID)
-endif
-
-ifdef CONFIG_INITRAMFS_ROOT_GID
-gen_initramfs_args += -g $(CONFIG_INITRAMFS_ROOT_GID)
-endif
-
-# The $(shell echo $(CONFIG_INITRAMFS_SOURCE)) is to remove the
-# gratuitous begin and end quotes from the Kconfig string type.
-# Internal, escaped quotes in the Kconfig string will loose the
-# escape and become active quotes.
-quotefixed_initramfs_source := $(shell echo $(CONFIG_INITRAMFS_SOURCE))
-
-filechk_initramfs_list = $(CONFIG_SHELL) \
- $(srctree)/scripts/gen_initramfs_list.sh $(gen_initramfs_args) $(quotefixed_initramfs_source)
-
-$(obj)/initramfs_list: $(obj)/Makefile FORCE
- $(call filechk,initramfs_list)
-quiet_cmd_cpio = CPIO $@
- cmd_cpio = ./$< $(obj)/initramfs_list > $@
-
-
-# Check if the INITRAMFS_SOURCE is a cpio archive
-ifneq (,$(findstring .cpio,$(quotefixed_initramfs_source)))
-
-# INITRAMFS_SOURCE has a cpio archive - verify that it's a single file
-ifneq (1,$(words $(quotefixed_initramfs_source)))
-$(error Only a single file may be specified in CONFIG_INITRAMFS_SOURCE (="$(quotefixed_initramfs_source)") when a cpio archive is directly specified.)
-endif
-# Now use the cpio archive directly
-initramfs_data_cpio = $(quotefixed_initramfs_source)
-targets += $(quotefixed_initramfs_source)
-
-else
-
-# INITRAMFS_SOURCE is not a cpio archive - create one
-$(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio \
- $(initramfs-y) $(obj)/initramfs_list FORCE
- $(call if_changed,cpio)
-
-targets += initramfs_data.cpio
-initramfs_data_cpio = $(obj)/initramfs_data.cpio
-
+#####
+# Generate the initramfs cpio archive
+
+hostprogs-y := gen_init_cpio
+initramfs := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
+ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
+ $(CONFIG_INITRAMFS_SOURCE),-d)
+ramfs-args := \
+ $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
+ $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
+ $(ramfs-input)
+
+# .initramfs_data.cpio.gz.d is used to identify all files included
+# in initramfs and to detect if any files are added/removed.
+# Removed files are identified by directory timestamp being updated
+# The dependency list is generated by gen_initramfs.sh -l
+ifneq ($(wildcard $(obj)/.initramfs_data.cpio.gz.d),)
+ include $(obj)/.initramfs_data.cpio.gz.d
endif
-
-
-$(obj)/initramfs_data.cpio.gz: $(initramfs_data_cpio) FORCE
- $(call if_changed,gzip)
-targets += initramfs_data.cpio.gz
+quiet_cmd_initfs = GEN $@
+ cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
+
+targets := initramfs_data.cpio.gz
+$(deps_initramfs): klibcdirs
+# We rebuild initramfs_data.cpio.gz if:
+# 1) Any included file is newer then initramfs_data.cpio.gz
+# 2) There are changes in which files are included (added or deleted)
+# 3) If gen_init_cpio are newer than initramfs_data.cpio.gz
+# 4) arguments to gen_initramfs.sh changes
+$(obj)/initramfs_data.cpio.gz: $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
+ $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.gz.d
+ $(call if_changed,initfs)
^ permalink raw reply related
* [Patch:005/005] wait_table and zonelist initializing for memory hotadd (update zonelists)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
In current code, zonelist is considered to be build once, no modification.
But MemoryHotplug can add new zone/pgdat. It must be updated.
This patch modifies build_all_zonelists().
By this, build_all_zonelist() can reconfig pgdat's zonelists.
To update them safety, this patch use stop_machine_run().
Other cpus don't touch among updating them by using it.
In old version (V2 of node hotadd), kernel updated them after zone
initialization.
But present_page of its new zone is still 0, because online_page()
is not called yet at this time.
Build_zonelists() checks present_pages to find present zone.
It was too early. So, I changed it after online_pages().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
mm/memory_hotplug.c | 12 ++++++++++++
mm/page_alloc.c | 26 +++++++++++++++++++++-----
2 files changed, 33 insertions(+), 5 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-10 14:15:24.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-10 14:15:34.000000000 +0900
@@ -37,6 +37,7 @@
#include <linux/nodemask.h>
#include <linux/vmalloc.h>
#include <linux/mempolicy.h>
+#include <linux/stop_machine.h>
#include <asm/tlbflush.h>
#include "internal.h"
@@ -1763,14 +1764,29 @@ static void __meminit build_zonelists(pg
#endif /* CONFIG_NUMA */
-void __init build_all_zonelists(void)
+/* return values int ....just for stop_machine_run() */
+static int __meminit __build_all_zonelists(void *dummy)
{
- int i;
+ int nid;
+ for_each_online_node(nid)
+ build_zonelists(NODE_DATA(nid));
+ return 0;
+}
+
+void __meminit build_all_zonelists(void)
+{
+ if (system_state == SYSTEM_BOOTING) {
+ __build_all_zonelists(0);
+ cpuset_init_current_mems_allowed();
+ } else {
+ /* we have to stop all cpus to guaranntee there is no user
+ of zonelist */
+ stop_machine_run(__build_all_zonelists, NULL, NR_CPUS);
+ /* cpuset refresh routine should be here */
+ }
- for_each_online_node(i)
- build_zonelists(NODE_DATA(i));
printk("Built %i zonelists\n", num_online_nodes());
- cpuset_init_current_mems_allowed();
+
}
/*
Index: pgdat10/mm/memory_hotplug.c
===================================================================
--- pgdat10.orig/mm/memory_hotplug.c 2006-04-10 14:15:13.000000000 +0900
+++ pgdat10/mm/memory_hotplug.c 2006-04-10 14:15:34.000000000 +0900
@@ -123,6 +123,7 @@ int online_pages(unsigned long pfn, unsi
unsigned long flags;
unsigned long onlined_pages = 0;
struct zone *zone;
+ int need_zonelists_rebuild = 0;
/*
* This doesn't need a lock to do pfn_to_page().
@@ -135,6 +136,14 @@ int online_pages(unsigned long pfn, unsi
grow_pgdat_span(zone->zone_pgdat, pfn, pfn + nr_pages);
pgdat_resize_unlock(zone->zone_pgdat, &flags);
+ /*
+ * If this zone is not populated, then it is not in zonelist.
+ * This means the page allocator ignores this zone.
+ * So, zonelist must be updated after online.
+ */
+ if (!populated_zone(zone))
+ need_zonelists_rebuild = 1;
+
for (i = 0; i < nr_pages; i++) {
struct page *page = pfn_to_page(pfn + i);
online_page(page);
@@ -145,5 +154,8 @@ int online_pages(unsigned long pfn, unsi
setup_per_zone_pages_min();
+ if (need_zonelists_rebuild)
+ build_all_zonelists();
+
return 0;
}
--
Yasunori Goto
--
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>
^ permalink raw reply
* [Patch:004/005] wait_table and zonelist initializing for memory hotadd (wait_table initialization)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
Wait_table is initialized according to zone size at boot time.
But, we cannot know the maixmum zone size when memory hotplug is enabled.
It can be changed.... And resizing of wait_table is hard.
So kernel allocate and initialzie wait_table as its maximum size.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
mm/page_alloc.c | 47 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 41 insertions(+), 6 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 15:15:36.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 19:03:23.000000000 +0900
@@ -1786,6 +1786,7 @@ void __init build_all_zonelists(void)
*/
#define PAGES_PER_WAITQUEUE 256
+#ifndef CONFIG_MEMORY_HOTPLUG
static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
{
unsigned long size = 1;
@@ -1804,6 +1805,33 @@ static inline unsigned long wait_table_h
return max(size, 4UL);
}
+#else
+/*
+ * XXX: Because zone size might be changed by hot-add,
+ * It is hard to determin suitable value for wait_table as traditional.
+ * So, we use maximum entries now.
+ *
+ * The max wait table size = 4096 x sizeof(wait_queue_head_t) byte.
+ * ex:
+ * i386 (preemption config) : 4096 x 16 = 64Kbyte.
+ * ia64, x86-64 (no preemption): 4096 x 20 = 80Kbyte.
+ * ia64, x86-64 (preemption) : 4096 x 24 = 96Kbyte.
+ *
+ * The maximum entries are prepared when a zone's memory is
+ * (512K + 256) pages or more by traditional way. (See above)
+ * It equals ....
+ * i386, x86-64, powerpc(4K page size) : = ( 2G + 1M)byte.
+ * ia64(16K page size) : = ( 8G + 4M)byte.
+ * powerpc (64K page size) : = (32G +16M)byte.
+ *
+ * If system doesn't have this size or more memory in the future,
+ * wait_table might be too bigger than suitable.
+ */
+static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
+{
+ return 4096UL;
+}
+#endif
/*
* This is an integer logarithm so that shifts can be used later
@@ -2072,10 +2100,11 @@ void __init setup_per_cpu_pageset(void)
#endif
static __meminit
-void zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
+int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
{
int i;
struct pglist_data *pgdat = zone->zone_pgdat;
+ size_t alloc_size;
/*
* The per-page waitqueue mechanism uses hashed waitqueues
@@ -2085,12 +2114,32 @@ void zone_wait_table_init(struct zone *z
wait_table_hash_nr_entries(zone_size_pages);
zone->wait_table_bits =
wait_table_bits(zone->wait_table_hash_nr_entries);
- zone->wait_table = (wait_queue_head_t *)
- alloc_bootmem_node(pgdat, zone->wait_table_hash_nr_entries
- * sizeof(wait_queue_head_t));
+ alloc_size = zone->wait_table_hash_nr_entries
+ * sizeof(wait_queue_head_t);
+
+ if (system_state == SYSTEM_BOOTING) {
+ zone->wait_table = (wait_queue_head_t *)
+ alloc_bootmem_node(pgdat, alloc_size);
+ } else {
+ /*
+ * XXX: This case means that a zone whose size was 0 gets new
+ * memory by memory hot-add.
+ * But, this may be the case that "new node" is hotadded.
+ * If its case, vmalloc() will not get this new node's
+ * memory. Because this wait_table must be initialized
+ * to use this new node itself too.
+ * To use this new node's memory, further consideration
+ * will be necessary.
+ */
+ zone->wait_table = (wait_queue_head_t *)vmalloc(alloc_size);
+ }
+ if (!zone->wait_table)
+ return -ENOMEM;
for(i = 0; i < zone->wait_table_hash_nr_entries; ++i)
init_waitqueue_head(zone->wait_table + i);
+
+ return 0;
}
static __meminit void zone_pcp_init(struct zone *zone)
@@ -2117,8 +2166,10 @@ __meminit int init_currently_empty_zone(
unsigned long size)
{
struct pglist_data *pgdat = zone->zone_pgdat;
-
- zone_wait_table_init(zone, size);
+ int ret;
+ ret = zone_wait_table_init(zone, size);
+ if (ret)
+ return ret;
pgdat->nr_zones = zone_idx(zone) + 1;
zone->zone_start_pfn = zone_start_pfn;
--
Yasunori Goto
--
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>
^ permalink raw reply
* Re: Slow swapon for big (12GB) swap
From: Jan Engelhardt @ 2006-04-11 11:30 UTC (permalink / raw)
To: Grzegorz Kulewski; +Cc: Helge Hafting, linux-kernel
In-Reply-To: <Pine.LNX.4.63.0604101205300.31989@alpha.polcom.net>
>
> Well - I use it for /var/tmp for compiling packages in Gentoo. Most compiles
> use < 1MB of it and it is *much* faster that way because immendiate data never
> touch disk. And the disk stays idle the whole time so can be put to sleep and
> should live longer.
>
Spinning the disk up and down more often than a continuously-running disk
is also a issue.
Jan Engelhardt
--
^ permalink raw reply
* [Patch:003/005] wait_table and zonelist initializing for memory hotadd(add return code for init_current_empty_zone)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
When add_zone() is called against empty zone (not populated zone),
we have to initialize the zone which didn't initialize at boot time.
But, init_currently_empty_zone() may fail due to allocation of
wait table. So, this patch is to catch its error code.
Changes against wait_table is in the next patch.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/mmzone.h | 3 +++
mm/memory_hotplug.c | 15 +++++++++++++--
mm/page_alloc.c | 11 ++++++++---
3 files changed, 24 insertions(+), 5 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 15:15:36.000000000 +0900
@@ -2112,8 +2112,9 @@ static __meminit void zone_pcp_init(stru
zone->name, zone->present_pages, batch);
}
-static __meminit void init_currently_empty_zone(struct zone *zone,
- unsigned long zone_start_pfn, unsigned long size)
+__meminit int init_currently_empty_zone(struct zone *zone,
+ unsigned long zone_start_pfn,
+ unsigned long size)
{
struct pglist_data *pgdat = zone->zone_pgdat;
@@ -2125,6 +2126,8 @@ static __meminit void init_currently_emp
memmap_init(size, pgdat->node_id, zone_idx(zone), zone_start_pfn);
zone_init_free_lists(pgdat, zone, zone->spanned_pages);
+
+ return 0;
}
/*
@@ -2139,6 +2142,7 @@ static void __meminit free_area_init_cor
unsigned long j;
int nid = pgdat->node_id;
unsigned long zone_start_pfn = pgdat->node_start_pfn;
+ int ret;
pgdat_resize_init(pgdat);
pgdat->nr_zones = 0;
@@ -2180,7 +2184,8 @@ static void __meminit free_area_init_cor
continue;
zonetable_add(zone, nid, j, zone_start_pfn, size);
- init_currently_empty_zone(zone, zone_start_pfn, size);
+ ret = init_currently_empty_zone(zone, zone_start_pfn, size);
+ BUG_ON(ret);
zone_start_pfn += size;
}
}
Index: pgdat10/mm/memory_hotplug.c
===================================================================
--- pgdat10.orig/mm/memory_hotplug.c 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/mm/memory_hotplug.c 2006-04-11 15:15:36.000000000 +0900
@@ -26,7 +26,7 @@
extern void zonetable_add(struct zone *zone, int nid, int zid, unsigned long pfn,
unsigned long size);
-static void __add_zone(struct zone *zone, unsigned long phys_start_pfn)
+static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
{
struct pglist_data *pgdat = zone->zone_pgdat;
int nr_pages = PAGES_PER_SECTION;
@@ -34,8 +34,15 @@ static void __add_zone(struct zone *zone
int zone_type;
zone_type = zone - pgdat->node_zones;
+ if (!populated_zone(zone)) {
+ int ret = 0;
+ ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages);
+ if (ret < 0)
+ return ret;
+ }
memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn);
zonetable_add(zone, nid, zone_type, phys_start_pfn, nr_pages);
+ return 0;
}
extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
@@ -50,7 +57,11 @@ static int __add_section(struct zone *zo
if (ret < 0)
return ret;
- __add_zone(zone, phys_start_pfn);
+ ret = __add_zone(zone, phys_start_pfn);
+
+ if (ret < 0)
+ return ret;
+
return register_new_memory(__pfn_to_section(phys_start_pfn));
}
Index: pgdat10/include/linux/mmzone.h
===================================================================
--- pgdat10.orig/include/linux/mmzone.h 2006-04-11 15:15:28.000000000 +0900
+++ pgdat10/include/linux/mmzone.h 2006-04-11 15:15:36.000000000 +0900
@@ -332,6 +332,9 @@ void wakeup_kswapd(struct zone *zone, in
int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
int classzone_idx, int alloc_flags);
+extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
+ unsigned long size);
+
#ifdef CONFIG_HAVE_MEMORY_PRESENT
void memory_present(int nid, unsigned long start, unsigned long end);
#else
--
Yasunori Goto
--
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>
^ permalink raw reply
* [Patch:001/005] wait_table and zonelist initializing for memory hotadd (change name of wait_table_size())
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
This is just to rename from wait_table_size() to wait_table_hash_nr_entries().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/mmzone.h | 4 ++--
mm/page_alloc.c | 12 +++++++-----
2 files changed, 9 insertions(+), 7 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-10 18:30:42.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-10 20:20:09.000000000 +0900
@@ -1786,7 +1786,7 @@ void __init build_all_zonelists(void)
*/
#define PAGES_PER_WAITQUEUE 256
-static inline unsigned long wait_table_size(unsigned long pages)
+static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
{
unsigned long size = 1;
@@ -2081,13 +2081,15 @@ void zone_wait_table_init(struct zone *z
* The per-page waitqueue mechanism uses hashed waitqueues
* per zone.
*/
- zone->wait_table_size = wait_table_size(zone_size_pages);
- zone->wait_table_bits = wait_table_bits(zone->wait_table_size);
+ zone->wait_table_hash_nr_entries =
+ wait_table_hash_nr_entries(zone_size_pages);
+ zone->wait_table_bits =
+ wait_table_bits(zone->wait_table_hash_nr_entries);
zone->wait_table = (wait_queue_head_t *)
- alloc_bootmem_node(pgdat, zone->wait_table_size
+ alloc_bootmem_node(pgdat, zone->wait_table_hash_nr_entries
* sizeof(wait_queue_head_t));
- for(i = 0; i < zone->wait_table_size; ++i)
+ for(i = 0; i < zone->wait_table_hash_nr_entries; ++i)
init_waitqueue_head(zone->wait_table + i);
}
Index: pgdat10/include/linux/mmzone.h
===================================================================
--- pgdat10.orig/include/linux/mmzone.h 2006-04-10 18:30:40.000000000 +0900
+++ pgdat10/include/linux/mmzone.h 2006-04-10 20:19:33.000000000 +0900
@@ -196,7 +196,7 @@ struct zone {
/*
* wait_table -- the array holding the hash table
- * wait_table_size -- the size of the hash table array
+ * wait_table_hash_nr_entries -- the size of the hash table array
* wait_table_bits -- wait_table_size == (1 << wait_table_bits)
*
* The purpose of all these is to keep track of the people
@@ -219,7 +219,7 @@ struct zone {
* free_area_init_core() performs the initialization of them.
*/
wait_queue_head_t * wait_table;
- unsigned long wait_table_size;
+ unsigned long wait_table_hash_nr_entries;
unsigned long wait_table_bits;
/*
--
Yasunori Goto
^ permalink raw reply
* [Patch:002/005] wait_table and zonelist initializing for memory hotadd (change to meminit for build_zonelist)
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
This is a patch to change definition of some functions and data
from __init to __meminit.
These functions and data can be used after bootup by this patch to
be used for hot-add codes.
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/bootmem.h | 4 ++--
mm/page_alloc.c | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-11 14:07:26.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-11 15:15:28.000000000 +0900
@@ -82,8 +82,8 @@ EXPORT_SYMBOL(zone_table);
static char *zone_names[MAX_NR_ZONES] = { "DMA", "DMA32", "Normal", "HighMem" };
int min_free_kbytes = 1024;
-unsigned long __initdata nr_kernel_pages;
-unsigned long __initdata nr_all_pages;
+unsigned long __meminitdata nr_kernel_pages;
+unsigned long __meminitdata nr_all_pages;
#ifdef CONFIG_DEBUG_VM
static int page_outside_zone_boundaries(struct zone *zone, struct page *page)
@@ -1576,7 +1576,7 @@ void show_free_areas(void)
*
* Add all populated zones of a node to the zonelist.
*/
-static int __init build_zonelists_node(pg_data_t *pgdat,
+static int __meminit build_zonelists_node(pg_data_t *pgdat,
struct zonelist *zonelist, int nr_zones, int zone_type)
{
struct zone *zone;
@@ -1612,7 +1612,7 @@ static inline int highest_zone(int zone_
#ifdef CONFIG_NUMA
#define MAX_NODE_LOAD (num_online_nodes())
-static int __initdata node_load[MAX_NUMNODES];
+static int __meminitdata node_load[MAX_NUMNODES];
/**
* find_next_best_node - find the next node that should appear in a given node's fallback list
* @node: node whose fallback list we're appending
@@ -1627,7 +1627,7 @@ static int __initdata node_load[MAX_NUMN
* on them otherwise.
* It returns -1 if no node is found.
*/
-static int __init find_next_best_node(int node, nodemask_t *used_node_mask)
+static int __meminit find_next_best_node(int node, nodemask_t *used_node_mask)
{
int n, val;
int min_val = INT_MAX;
@@ -1673,7 +1673,7 @@ static int __init find_next_best_node(in
return best_node;
}
-static void __init build_zonelists(pg_data_t *pgdat)
+static void __meminit build_zonelists(pg_data_t *pgdat)
{
int i, j, k, node, local_node;
int prev_node, load;
@@ -1725,7 +1725,7 @@ static void __init build_zonelists(pg_da
#else /* CONFIG_NUMA */
-static void __init build_zonelists(pg_data_t *pgdat)
+static void __meminit build_zonelists(pg_data_t *pgdat)
{
int i, j, k, node, local_node;
@@ -2133,7 +2133,7 @@ static __meminit void init_currently_emp
* - mark all memory queues empty
* - clear the memory bitmaps
*/
-static void __init free_area_init_core(struct pglist_data *pgdat,
+static void __meminit free_area_init_core(struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long *zholes_size)
{
unsigned long j;
@@ -2213,7 +2213,7 @@ static void __init alloc_node_mem_map(st
#endif /* CONFIG_FLAT_NODE_MEM_MAP */
}
-void __init free_area_init_node(int nid, struct pglist_data *pgdat,
+void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,
unsigned long *zones_size, unsigned long node_start_pfn,
unsigned long *zholes_size)
{
Index: pgdat10/include/linux/bootmem.h
===================================================================
--- pgdat10.orig/include/linux/bootmem.h 2006-04-10 18:30:42.000000000 +0900
+++ pgdat10/include/linux/bootmem.h 2006-04-11 14:07:27.000000000 +0900
@@ -91,8 +91,8 @@ static inline void *alloc_remap(int nid,
}
#endif
-extern unsigned long __initdata nr_kernel_pages;
-extern unsigned long __initdata nr_all_pages;
+extern unsigned long nr_kernel_pages;
+extern unsigned long nr_all_pages;
extern void *__init alloc_large_system_hash(const char *tablename,
unsigned long bucketsize,
--
Yasunori Goto
--
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>
^ permalink raw reply
* Re: Comment about proc-dont-lock-task_structs-indefinitely.patch
From: Eric W. Biederman @ 2006-04-11 11:28 UTC (permalink / raw)
To: Prasanna Meda; +Cc: akpm, linux-kernel
In-Reply-To: <608a53b0604110348g22445b00u5ef57286eb230d58@mail.google.com>
"Prasanna Meda" <mlp@google.com> writes:
> On 4/11/06, Prasanna Meda <mlp@google.com> wrote:
>
>>
>> The task decrement problem is fixed, but I think we have two more
>> problems in the following patch segment.
>>
>
> I think you agreed with the first problem. And the second problem is,
> show_map_internal is still treating m->private as task_struct instead
> of proc_maps_private.
Sorry my brain has been off thinking about a subtle
bug accidentally introduced in 2.6.17-rc1.
You are absolutely right. Somehow I missed the
fact that show_map_internal was using m->private.
Because get_gate_vma doesn't actually use it's argument
no bad behavior will result but that could change.
As for the seek case you may be right.
I have a cold that is beating on me, and I need to take a nap.
I remember looking at that closely and not seeing a problem,
but I have made mistakes before, and I'm not certain I recall
the seek case.
Eric
^ permalink raw reply
* [Patch:001/005] wait_table and zonelist initializing for memory hotadd (change name of wait_table_size())
From: Yasunori Goto @ 2006-04-11 11:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm
In-Reply-To: <20060411202031.5643.Y-GOTO@jp.fujitsu.com>
This is just to rename from wait_table_size() to wait_table_hash_nr_entries().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
include/linux/mmzone.h | 4 ++--
mm/page_alloc.c | 12 +++++++-----
2 files changed, 9 insertions(+), 7 deletions(-)
Index: pgdat10/mm/page_alloc.c
===================================================================
--- pgdat10.orig/mm/page_alloc.c 2006-04-10 18:30:42.000000000 +0900
+++ pgdat10/mm/page_alloc.c 2006-04-10 20:20:09.000000000 +0900
@@ -1786,7 +1786,7 @@ void __init build_all_zonelists(void)
*/
#define PAGES_PER_WAITQUEUE 256
-static inline unsigned long wait_table_size(unsigned long pages)
+static inline unsigned long wait_table_hash_nr_entries(unsigned long pages)
{
unsigned long size = 1;
@@ -2081,13 +2081,15 @@ void zone_wait_table_init(struct zone *z
* The per-page waitqueue mechanism uses hashed waitqueues
* per zone.
*/
- zone->wait_table_size = wait_table_size(zone_size_pages);
- zone->wait_table_bits = wait_table_bits(zone->wait_table_size);
+ zone->wait_table_hash_nr_entries =
+ wait_table_hash_nr_entries(zone_size_pages);
+ zone->wait_table_bits =
+ wait_table_bits(zone->wait_table_hash_nr_entries);
zone->wait_table = (wait_queue_head_t *)
- alloc_bootmem_node(pgdat, zone->wait_table_size
+ alloc_bootmem_node(pgdat, zone->wait_table_hash_nr_entries
* sizeof(wait_queue_head_t));
- for(i = 0; i < zone->wait_table_size; ++i)
+ for(i = 0; i < zone->wait_table_hash_nr_entries; ++i)
init_waitqueue_head(zone->wait_table + i);
}
Index: pgdat10/include/linux/mmzone.h
===================================================================
--- pgdat10.orig/include/linux/mmzone.h 2006-04-10 18:30:40.000000000 +0900
+++ pgdat10/include/linux/mmzone.h 2006-04-10 20:19:33.000000000 +0900
@@ -196,7 +196,7 @@ struct zone {
/*
* wait_table -- the array holding the hash table
- * wait_table_size -- the size of the hash table array
+ * wait_table_hash_nr_entries -- the size of the hash table array
* wait_table_bits -- wait_table_size == (1 << wait_table_bits)
*
* The purpose of all these is to keep track of the people
@@ -219,7 +219,7 @@ struct zone {
* free_area_init_core() performs the initialization of them.
*/
wait_queue_head_t * wait_table;
- unsigned long wait_table_size;
+ unsigned long wait_table_hash_nr_entries;
unsigned long wait_table_bits;
/*
--
Yasunori Goto
--
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>
^ permalink raw reply
* Re: Linux 2.6.17-rc1: /sbin/iptables does not find kernel netfilter
From: Jan Engelhardt @ 2006-04-11 11:27 UTC (permalink / raw)
To: Andre Tomt; +Cc: Nix, linux-kernel, vherva, Patrick McHardy, netfilter, davem
In-Reply-To: <4439350E.4060306@tomt.net>
>
> Beeing bitten by such issues in the past, I always diff the old and the new
> config and look for anything suspicious going down.
>
My way:
gzip -cd /proc/config.gz >.config
make
The configurator will stop at any new config option, which includes
xtables. :)
Jan Engelhardt
--
^ permalink raw reply
* Re: 40% IDE performance regression going from FC3 to FC5 with same kernel
From: Jan Engelhardt @ 2006-04-11 11:26 UTC (permalink / raw)
To: Alessandro Suardi; +Cc: Arjan van de Ven, Linux Kernel
In-Reply-To: <5a4c581d0604081007t32863bf4n1253ebd8352dbf35@mail.gmail.com>
>> try killing that one next; it may or may not help but it's sure worth a
>> try (esp given the success of the first kill :)
>
>killing udevd doesn't bring any improvement - still at 20MB/s.
>
>Do you want me to file a FC5 bugzilla entry with the current info
> or do you think there is something else that can be discussed
> on lkml ?
>
Compile a non-initrd kernel and run it with the -b parameter (it's passed
to /sbin/init). From that shell, run your speed test. What does it show?
Jan Engelhardt
--
^ permalink raw reply
* [Patch:000/005] wait_table and zonelist initializing for memory hotadd
From: Yasunori Goto @ 2006-04-11 11:25 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm, Yasunori Goto
Hi.
These are patches for initialization of wait_table and updating of zonelists
for memory hot-add.
These patches can be used when a new node/zone becomes available.
When empty zone becomes not empty by memory hot-add,
wait_table must be initialized, and zonelists must be updated.
ex) x86-64 is good example of new zone addition.
- System boot up with memory under 4G address.
All of memory will be ZONE_DMA32.
- Then hot-add over 4G memory. It becomes ZONE_NORMAL. But,
wait table of zone normal is not initialized at this time.
This patch is for 2.6.17-rc1-mm2.
Please apply.
----------------------------
Change log from v1 of wait_table init and build_zonelist.
- update for 2.6.17-rc1-mm2.
- add comment for wait_table hash entries.
- change name wait_table_size() -> wait_table_hash_nr_entries()
Change log from v4 of node hot-add.
- wait_table and build_zonelists updating are picked up.
- update for 2.6.17-rc1-mm1.
- change allocation for wait_table from kmalloc() to vmalloc().
vmalloc() is enough for it.
V4 of post is here.
<description>
http://marc.theaimsgroup.com/?l=linux-mm&w=2&r=1&s=memory+hotplug+node+v.4&q=b
<patches>
http://marc.theaimsgroup.com/?l=linux-mm&w=2&r=1&s=memory+hotplug+node+v.4.&q=b
--
Yasunori Goto
^ permalink raw reply
* [U-Boot-Users] loadb problem
From: Hurricane555 @ 2006-04-11 11:25 UTC (permalink / raw)
To: u-boot
In-Reply-To: <20060411110304.8731F35260B@atlas.denx.de>
I found the problem! I switched the byteorder in FIFO for my BIG_ENDIAN
System!
--
View this message in context: http://www.nabble.com/loadb-problem-t1429882.html#a3859687
Sent from the Uboot - Users forum at Nabble.com.
^ permalink raw reply
* [Patch:000/005] wait_table and zonelist initializing for memory hotadd
From: Yasunori Goto @ 2006-04-11 11:25 UTC (permalink / raw)
To: Andrew Morton; +Cc: Linux Kernel ML, linux-mm, Yasunori Goto
Hi.
These are patches for initialization of wait_table and updating of zonelists
for memory hot-add.
These patches can be used when a new node/zone becomes available.
When empty zone becomes not empty by memory hot-add,
wait_table must be initialized, and zonelists must be updated.
ex) x86-64 is good example of new zone addition.
- System boot up with memory under 4G address.
All of memory will be ZONE_DMA32.
- Then hot-add over 4G memory. It becomes ZONE_NORMAL. But,
wait table of zone normal is not initialized at this time.
This patch is for 2.6.17-rc1-mm2.
Please apply.
----------------------------
Change log from v1 of wait_table init and build_zonelist.
- update for 2.6.17-rc1-mm2.
- add comment for wait_table hash entries.
- change name wait_table_size() -> wait_table_hash_nr_entries()
Change log from v4 of node hot-add.
- wait_table and build_zonelists updating are picked up.
- update for 2.6.17-rc1-mm1.
- change allocation for wait_table from kmalloc() to vmalloc().
vmalloc() is enough for it.
V4 of post is here.
<description>
http://marc.theaimsgroup.com/?l=linux-mm&w=2&r=1&s=memory+hotplug+node+v.4&q=b
<patches>
http://marc.theaimsgroup.com/?l=linux-mm&w=2&r=1&s=memory+hotplug+node+v.4.&q=b
--
Yasunori Goto
--
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>
^ permalink raw reply
* [PATCH] Rename --with-raw to --patch-with-raw and document it
From: Petr Baudis @ 2006-04-11 11:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vr7456jb4.fsf@assigned-by-dhcp.cox.net>
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Documentation/diff-options.txt | 3 +++
diff.c | 2 +-
diff.h | 2 ++
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index ec6811c..338014c 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -4,6 +4,9 @@
-u::
Synonym for "-p".
+--patch-with-raw::
+ Generate patch but keep also the default raw diff output.
+
-z::
\0 line termination on output
diff --git a/diff.c b/diff.c
index 12924f2..00c79aa 100644
--- a/diff.c
+++ b/diff.c
@@ -862,7 +862,7 @@ int diff_opt_parse(struct diff_options *
const char *arg = av[0];
if (!strcmp(arg, "-p") || !strcmp(arg, "-u"))
options->output_format = DIFF_FORMAT_PATCH;
- else if (!strcmp(arg, "--with-raw")) {
+ else if (!strcmp(arg, "--patch-with-raw")) {
options->output_format = DIFF_FORMAT_PATCH;
options->with_raw = 1;
}
diff --git a/diff.h b/diff.h
index 07b153b..c5372b9 100644
--- a/diff.h
+++ b/diff.h
@@ -113,6 +113,8 @@ #define COMMON_DIFF_OPTIONS_HELP \
" -z output diff-raw with lines terminated with NUL.\n" \
" -p output patch format.\n" \
" -u synonym for -p.\n" \
+" --patch-with-raw\n" \
+" output both a patch and the diff-raw format.\n" \
" --name-only show only names of changed files.\n" \
" --name-status show names and status of changed files.\n" \
" --full-index show full object name on index lines.\n" \
^ permalink raw reply related
* Re: Bug report: reiserfsck --rebuild-tree not progressing
From: Konstantin Münning @ 2006-04-11 11:22 UTC (permalink / raw)
To: Tyler Phelps; +Cc: reiserfs-list, sysadmin
In-Reply-To: <B3A1FB37-26AC-49F0-8CDB-A14FC93BF021@pandora.com>
Hi!
I had the same problem about a year ago with a 0.8TB drive, you may
check some list archives for the details.
The solution was a patch to the reiserfsprogs which was then
incorporated in version 3.6.19. I am not familiar with the details as I
only supplied the information and Vladimir did the work but I can only
repeat what was said - abort current fsck and retry with latest tools
(3.6.19 should be sufficent, I can't tell about 3.6.20).
As for your concerns, it's correct that when you abort the current fsck
it will result in an unmountable FS but you can repair it with another
run. I doubt there is any way to make the current fsck to contnue except
maybe some weird magic hack into the running program ;-). If there are
chances to loose data in this process - I'm not the expert but I think
an abort is not that critical - at least at that stage where reiserfsck
is in an endless loop. With my problem I had some minor data corruption
issues afterwards but I think that was because of the primary fault -
the RAID controller had RAM errors and the RAID consistency was broken
which resulted in the corrupted FS. Then after several fsck tries,
superblock reconstruction etc. I was surprised how much was still intact
(far less than 1% of data was corrupted) but I think this doesn't apply
to you as it's not any guarantee.
Have a nice day,
Konstantin
Tyler Phelps wrote:
> My questions (and all of the diagnostic information provided) revolve
> around a specific process of reiserfsck, using the version that I
> specified, which is still running. The only way that I can try a new
> version is to abort the current fsck operation... doing that
> essentially invalidates all of the questions that I've asked.
>
> I'm reluctant to abort the current process. My primary reason for this
> is that I have no way of knowing if aborting the current fsck will
> cause further damage. After all, the man page states, "Once reiserfsck
> --rebuild-tree is started it must finish its work (and you should not
> interrupt it), otherwise the filesystem will be left in the unmountable
> state to avoid subsequent data corruptions." Second, I don't know if
> anything is even wrong with the way that things are "progressing" with
> the current process... hence the reason for my original questions.
>
> -Tyler
>
> On Apr 11, 2006, at 12:21 AM, Sander wrote:
>
>> Tyler Phelps wrote (ao):
>>
>>> Package: reiserfsprogs
>>> Version: 1:3.6.17-2
>>
>>
>> Can you try a newer version?
>> ftp://ftp.namesys.com/pub/reiserfsprogs/reiserfsprogs-3.6.19.tar.gz
>>
>> According to http://marc.theaimsgroup.com/?t=114235160800008&r=1&w=2
>> 3.6.20 also exist, but I cant find it.
>>
>> Good luck, Sander
>>
>> --
>> Humilis IT Services and Solutions
>> http://www.humilis.net
^ permalink raw reply
* Re: Black box flight recorder for Linux
From: Jan Engelhardt @ 2006-04-11 11:21 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: James Courtier-Dutton, linux list
In-Reply-To: <m3psjqeeor.fsf@defiant.localdomain>
>> Now, the question I have is, if I write values to RAM, do any of those
>> values survive a reset? If any did survive, one could use them to
>> store oops output in. [...]
>
>Interesting idea.
>
>I think the most trivial and reliable way would be to solder some
>I^2 or similar EEPROM chip to, for example, parallel port connector.
>
My turn. If the NVRAM was not so small on x86, you could easily put an Oops
in there. Somewhat portable, I guess.
Jan Engelhardt
--
^ permalink raw reply
* Re: menuconfig search (Re: [rfc] fix Kconfig, hotplug_cpu is needed for swsusp)
From: Jan Engelhardt @ 2006-04-11 11:18 UTC (permalink / raw)
To: Randy.Dunlap; +Cc: akpm, linux-kernel
In-Reply-To: <20060408192959.1fa9f401.rdunlap@xenotime.net>
>> I.e. strip the Defined and Depends lines and crunch the Location lines inasfar
>> as that the full width of the window is used (break at col 70).
>
>I don't see any need to limit it to 70 columns wide. It knows how to
>scroll left/right (using arrow keys).
>
Not because it does not know how to horizontally scroll, but because it
takes quite some time for the user to scroll left/right. There's no Home or
End key for the horizontal direction.
>I don't know if we are converging any, but I made a new patch:
> http://www.xenotime.net/linux/patches/menuconfig-search2b.patch
Yes, this one looks good and satisfies me.
Acked-by: Jan Engelhardt <jengelh@gmx.de>
Jan Engelhardt
--
^ permalink raw reply
* Re: [PATCH] vfs: add splice_write and splice_read to documentation
From: Jens Axboe @ 2006-04-11 11:15 UTC (permalink / raw)
To: Pekka J Enberg; +Cc: akpm, linux-kernel
In-Reply-To: <Pine.LNX.4.58.0604111402550.15286@sbz-30.cs.Helsinki.FI>
On Tue, Apr 11 2006, Pekka J Enberg wrote:
> From: Pekka Enberg <penberg@cs.helsinki.fi>
>
> This patch adds the new splice_write and splice_read file operations to
> Documentation/filesystems/vfs.txt.
>
> Cc: Jens Axboe <axboe@suse.de>
> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Thanks, I'll add that to the splice branch since it wants updating for
the modified interface anyways.
--
Jens Axboe
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
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.