The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [linux-usb-devel] compile error when building multiple EHCI host controllers as modules
From: Kumar Gala @ 2006-03-24 20:32 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-usb-devel, Greg KH, LKML mailing list
In-Reply-To: <97434D6A-A556-4288-8F13-7048E416E611@kernel.crashing.org>

> The issue I have this is that it makes two (or more) things that were  
> independent now dependent.  What about just moving the module_init/ 
> exit() functions into files that are built separately.  For the ehci- 
> fsl case it was trivial, need to look at ehci-pci case.

Ok, my idea required exporting things I didn't really want to export, so 
what about something like this or where you thinking of some more 
sophisticated?

If this is good, I'll do the same for ohci.

diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c
index 63eadee..036a1c0 100644
--- a/drivers/usb/host/ehci-au1xxx.c
+++ b/drivers/usb/host/ehci-au1xxx.c
@@ -280,18 +280,3 @@ static struct device_driver ehci_hcd_au1
 	/*.suspend      = ehci_hcd_au1xxx_drv_suspend, */
 	/*.resume       = ehci_hcd_au1xxx_drv_resume, */
 };
-
-static int __init ehci_hcd_au1xxx_init(void)
-{
-	pr_debug(DRIVER_INFO " (Au1xxx)\n");
-
-	return driver_register(&ehci_hcd_au1xxx_driver);
-}
-
-static void __exit ehci_hcd_au1xxx_cleanup(void)
-{
-	driver_unregister(&ehci_hcd_au1xxx_driver);
-}
-
-module_init(ehci_hcd_au1xxx_init);
-module_exit(ehci_hcd_au1xxx_cleanup);
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index f985f12..30410c2 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -339,28 +339,3 @@ static struct platform_driver ehci_fsl_m
 		   .name = "fsl-usb2-mph",
 		   },
 };
-
-static int __init ehci_fsl_init(void)
-{
-	int retval;
-
-	pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
-		 hcd_name,
-		 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
-		 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
-
-	retval = platform_driver_register(&ehci_fsl_dr_driver);
-	if (retval)
-		return retval;
-
-	return platform_driver_register(&ehci_fsl_mph_driver);
-}
-
-static void __exit ehci_fsl_cleanup(void)
-{
-	platform_driver_unregister(&ehci_fsl_mph_driver);
-	platform_driver_unregister(&ehci_fsl_dr_driver);
-}
-
-module_init(ehci_fsl_init);
-module_exit(ehci_fsl_cleanup);
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 79f2d8b..549ce59 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -905,3 +905,57 @@ MODULE_LICENSE ("GPL");
 #ifndef	EHCI_BUS_GLUED
 #error "missing bus glue for ehci-hcd"
 #endif
+
+static int __init ehci_hcd_init(void)
+{
+	int retval = 0;
+
+	pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
+		 hcd_name,
+		 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
+		 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
+
+#ifdef CONFIG_PPC_83xx
+	retval = platform_driver_register(&ehci_fsl_dr_driver);
+	if (retval < 0)
+		return retval;
+
+	retval = platform_driver_register(&ehci_fsl_dr_driver);
+	if (retval < 0)
+		return retval;
+#endif
+
+#ifdef CONFIG_SOC_AU1X00
+	pr_debug(DRIVER_INFO " (Au1xxx)\n");
+
+	retval = driver_register(&ehci_hcd_au1xxx_driver);
+	if (retval < 0)
+		return retval;
+#endif
+
+#ifdef CONFIG_PCI
+	retval = pci_register_driver(&ehci_pci_driver);
+	if (retval < 0)
+		return retval;
+#endif
+
+	return retval;
+}
+
+static void __exit ehci_hcd_cleanup(void)
+{
+#ifdef CONFIG_PPC_83xx
+	platform_driver_unregister(&ehci_fsl_mph_driver);
+	platform_driver_unregister(&ehci_fsl_dr_driver);
+#endif
+#ifdef CONFIG_SOC_AU1X00
+	driver_unregister(&ehci_hcd_au1xxx_driver);
+#endif
+#ifdef CONFIG_PCI
+	pci_unregister_driver(&ehci_pci_driver);
+#endif
+}
+
+module_init(ehci_hcd_init);
+module_exit(ehci_hcd_cleanup);
+
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 1e03f1a..e0641bc 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -370,23 +370,3 @@ static struct pci_driver ehci_pci_driver
 	.resume =	usb_hcd_pci_resume,
 #endif
 };
-
-static int __init ehci_hcd_pci_init(void)
-{
-	if (usb_disabled())
-		return -ENODEV;
-
-	pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
-		hcd_name,
-		sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
-		sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
-
-	return pci_register_driver(&ehci_pci_driver);
-}
-module_init(ehci_hcd_pci_init);
-
-static void __exit ehci_hcd_pci_cleanup(void)
-{
-	pci_unregister_driver(&ehci_pci_driver);
-}
-module_exit(ehci_hcd_pci_cleanup);


^ permalink raw reply related

* Re: [RFC] [PATCH 0/7] Some basic vserver infrastructure
From: Eric W. Biederman @ 2006-03-24 20:28 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: Dave Hansen, Sam Vilain, linux-kernel, Herbert Poetzl,
	OpenVZ developers list, Serge E.Hallyn, Andrew Morton
In-Reply-To: <44241224.9000200@sw.ru>

Kirill Korotaev <dev@sw.ru> writes:


>> I certainly have not.  I do feel that developing this just from the
>> top down is the wrong way to do this.  In some of the preliminary
>> patches we have found several pieces of code that we will have to
>> touch that is currently in need of a cleanup.  That is why I have
>> been cleaning up /proc.  sysctl is in need of similar treatment
>> but is in less bad shape.
> Eric, though I suggest to postpone proc and sysctl a bit, can you share
> me your vision of /proc and /sysctl virtualization a bit?
> A good way to handle them IMHO is to make fully virtual, i.e. each
> namespace should have an own set of sysctl or proc tree.

Roughly I agree.  Some cases are easier than others.  So let me take
just the sysvipc case as an example.

My thinking is move the calls for printing the sysvipc namespace
from fs/proc/generic.c (with all of it's cool helpers) to 
fs/proc/base.c.

So we wind up with: 
/proc/<pid>/sysvipc/msg
/proc/<pid>/sysvipc/sem
/proc/<pid>/sysvipc/shm
/proc/sysvipc -> /proc/self/sysvipc

For sysctl we add a method to fetch the address of
the variable and perhaps a few other attributes,
that method is passed a task structure.

Then we can have per process instances of:
/proc/<pid>/sys/sem
/proc/<pid>/sys/shmall
/proc/<pid>/sys/shmmax
/proc/<pid>/sys/msgmax
/proc/<pid>/sys/msgmni
/proc/<pid>/sys/shmmni
And a symlink at:
/proc/sys that points to /proc/<pid>/sys

Getting sysvipc to show up in a per process fashion is pretty
easy.  Getting the entire sys hierarchy to show up per process
is a little harder simply because I think to do it cleanly requires
help functions that I don't have yet.  I have removed all of
the internal dependence on magic inode numbers completely removing
the hard coded inode numbers and putting sys looks doable.

Does that sound like a reasonable model?

>> Part of it is that I have stopped to look more closely at what
>> other people are doing and to look at alternative implementations.
> If you need any help with it in OpenVZ, feel free to ask. We have
> broken-out patches for recent 2.6.16 kernel.


>> One interesting thing I have manged to do is by using ptrace I
>> have implemented enter for the existing filesystem namespaces without having
>> to modify the kernel.  This at least says
>> that enter and debugging are two faces of the same coin.
> Hmmm, strange claim/conclusion... /dev/kmem allows to change namespaces
> also :) and even to obtain root priviliges if needed... :)

True.  However this is much less ugly then using /dev/kmem, and it is
much closer to what applications like user mode linux do.  The primary
question in my mind was what should the permissions checks be when
performing this kind of action.  Using ptrace satisfied that.

So I now have a bounding box for what enter should be able to do
and what permissions it should take.

> Eric, let's not compare approaches with inches :)
> As you remember your PID namespaces doesn't suite us well... :(

More discussion when the time is right.  But I believe I have solved
the fundamental incompatibility that we had.  I asked you a question
to confirm that a while ago, but I have not heard anything back.

Eric

^ permalink raw reply

* Re: [RFC][PATCH 1/2] Virtualization of UTS
From: James Morris @ 2006-03-24 20:28 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: Linus Torvalds, Andrew Morton, xemul, ebiederm, haveblue,
	linux-kernel, herbert, devel, serue, sam
In-Reply-To: <44242CE7.3030905@sw.ru>

On Fri, 24 Mar 2006, Kirill Korotaev wrote:

> This patch introduces utsname namespace in system, which allows to have
> different utsnames on the host.
> Introduces config option CONFIG_UTS_NS and uts_namespace structure for this.
> 

Please include patches inline, so they can be quoted inline.

+#define system_utsname	(current->uts_ns->name)

This should be a static inline.

+struct uts_namespace *create_uts_ns(void)
+{
+	struct uts_namespace *ns;
+
+	ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
+	if (ns == NULL)
+		return NULL;
+
+	memset(&ns->name, 0, sizeof(ns->name));
+	atomic_set(&ns->cnt, 1);
+	return ns;
+}

IMHO, it's better to do something like:

{
	foo = kmalloc();
	if (foo) {
		stuff;
		etc;
	}
	return foo;
}

I suggest you use kzalloc(), too.

Also, I think the API approach needs to be determined before the patches 
go into -mm, in case it impacts on the code.



^ permalink raw reply

* [PATCH] kill __init_timer_base in favor of boot_tvec_bases
From: Oleg Nesterov @ 2006-03-24 20:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, linux-kernel, Jan Beulich

This patch
	[PATCH] tvec_bases too large for per-cpu data
	http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a4a6198b80cf82eb8160603c98da218d1bd5e104

introduced "struct tvec_t_base_s boot_tvec_bases" which is visible
at compile time. This means we can kill __init_timer_base and move
timer_base_s's content into tvec_t_base_s.

 include/linux/timer.h |    8 ++--
 kernel/timer.c        |   84 ++++++++++++++++++++------------------------------
 2 files changed, 39 insertions(+), 53 deletions(-)

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- MM/include/linux/timer.h~TIMER	2006-03-23 22:48:10.000000000 +0300
+++ MM/include/linux/timer.h	2006-03-25 01:23:14.000000000 +0300
@@ -6,7 +6,7 @@
 #include <linux/spinlock.h>
 #include <linux/stddef.h>
 
-struct timer_base_s;
+struct tvec_t_base_s;
 
 struct timer_list {
 	struct list_head entry;
@@ -15,16 +15,16 @@ struct timer_list {
 	void (*function)(unsigned long);
 	unsigned long data;
 
-	struct timer_base_s *base;
+	struct tvec_t_base_s *base;
 };
 
-extern struct timer_base_s __init_timer_base;
+extern struct tvec_t_base_s boot_tvec_bases;
 
 #define TIMER_INITIALIZER(_function, _expires, _data) {		\
 		.function = (_function),			\
 		.expires = (_expires),				\
 		.data = (_data),				\
-		.base = &__init_timer_base,			\
+		.base = &boot_tvec_bases,			\
 	}
 
 #define DEFINE_TIMER(_name, _function, _expires, _data)		\
--- MM/kernel/timer.c~TIMER	2006-03-23 22:48:10.000000000 +0300
+++ MM/kernel/timer.c	2006-03-25 01:37:29.000000000 +0300
@@ -54,7 +54,6 @@ EXPORT_SYMBOL(jiffies_64);
 /*
  * per-CPU timer vector definitions:
  */
-
 #define TVN_BITS (CONFIG_BASE_SMALL ? 4 : 6)
 #define TVR_BITS (CONFIG_BASE_SMALL ? 6 : 8)
 #define TVN_SIZE (1 << TVN_BITS)
@@ -62,11 +61,6 @@ EXPORT_SYMBOL(jiffies_64);
 #define TVN_MASK (TVN_SIZE - 1)
 #define TVR_MASK (TVR_SIZE - 1)
 
-struct timer_base_s {
-	spinlock_t lock;
-	struct timer_list *running_timer;
-};
-
 typedef struct tvec_s {
 	struct list_head vec[TVN_SIZE];
 } tvec_t;
@@ -76,7 +70,8 @@ typedef struct tvec_root_s {
 } tvec_root_t;
 
 struct tvec_t_base_s {
-	struct timer_base_s t_base;
+	spinlock_t lock;
+	struct timer_list *running_timer;
 	unsigned long timer_jiffies;
 	tvec_root_t tv1;
 	tvec_t tv2;
@@ -87,13 +82,14 @@ struct tvec_t_base_s {
 
 typedef struct tvec_t_base_s tvec_base_t;
 static DEFINE_PER_CPU(tvec_base_t *, tvec_bases);
-static tvec_base_t boot_tvec_bases;
+tvec_base_t boot_tvec_bases;
+EXPORT_SYMBOL(boot_tvec_bases);
 
 static inline void set_running_timer(tvec_base_t *base,
 					struct timer_list *timer)
 {
 #ifdef CONFIG_SMP
-	base->t_base.running_timer = timer;
+	base->running_timer = timer;
 #endif
 }
 
@@ -139,15 +135,6 @@ static void internal_add_timer(tvec_base
 	list_add_tail(&timer->entry, vec);
 }
 
-typedef struct timer_base_s timer_base_t;
-/*
- * Used by TIMER_INITIALIZER, we can't use per_cpu(tvec_bases)
- * at compile time, and we need timer->base to lock the timer.
- */
-timer_base_t __init_timer_base
-	____cacheline_aligned_in_smp = { .lock = SPIN_LOCK_UNLOCKED };
-EXPORT_SYMBOL(__init_timer_base);
-
 /***
  * init_timer - initialize a timer.
  * @timer: the timer to be initialized
@@ -158,7 +145,7 @@ EXPORT_SYMBOL(__init_timer_base);
 void fastcall init_timer(struct timer_list *timer)
 {
 	timer->entry.next = NULL;
-	timer->base = &per_cpu(tvec_bases, raw_smp_processor_id())->t_base;
+	timer->base = per_cpu(tvec_bases, raw_smp_processor_id());
 }
 EXPORT_SYMBOL(init_timer);
 
@@ -174,7 +161,7 @@ static inline void detach_timer(struct t
 }
 
 /*
- * We are using hashed locking: holding per_cpu(tvec_bases).t_base.lock
+ * We are using hashed locking: holding per_cpu(tvec_bases).lock
  * means that all timers which are tied to this base via timer->base are
  * locked, and the base itself is locked too.
  *
@@ -185,10 +172,10 @@ static inline void detach_timer(struct t
  * possible to set timer->base = NULL and drop the lock: the timer remains
  * locked.
  */
-static timer_base_t *lock_timer_base(struct timer_list *timer,
+static tvec_base_t *lock_timer_base(struct timer_list *timer,
 					unsigned long *flags)
 {
-	timer_base_t *base;
+	tvec_base_t *base;
 
 	for (;;) {
 		base = timer->base;
@@ -205,8 +192,7 @@ static timer_base_t *lock_timer_base(str
 
 int __mod_timer(struct timer_list *timer, unsigned long expires)
 {
-	timer_base_t *base;
-	tvec_base_t *new_base;
+	tvec_base_t *base, *new_base;
 	unsigned long flags;
 	int ret = 0;
 
@@ -221,7 +207,7 @@ int __mod_timer(struct timer_list *timer
 
 	new_base = __get_cpu_var(tvec_bases);
 
-	if (base != &new_base->t_base) {
+	if (base != new_base) {
 		/*
 		 * We are trying to schedule the timer on the local CPU.
 		 * However we can't change timer's base while it is running,
@@ -231,19 +217,19 @@ int __mod_timer(struct timer_list *timer
 		 */
 		if (unlikely(base->running_timer == timer)) {
 			/* The timer remains on a former base */
-			new_base = container_of(base, tvec_base_t, t_base);
+			new_base = base;
 		} else {
 			/* See the comment in lock_timer_base() */
 			timer->base = NULL;
 			spin_unlock(&base->lock);
-			spin_lock(&new_base->t_base.lock);
-			timer->base = &new_base->t_base;
+			spin_lock(&new_base->lock);
+			timer->base = new_base;
 		}
 	}
 
 	timer->expires = expires;
 	internal_add_timer(new_base, timer);
-	spin_unlock_irqrestore(&new_base->t_base.lock, flags);
+	spin_unlock_irqrestore(&new_base->lock, flags);
 
 	return ret;
 }
@@ -263,10 +249,10 @@ void add_timer_on(struct timer_list *tim
   	unsigned long flags;
 
   	BUG_ON(timer_pending(timer) || !timer->function);
-	spin_lock_irqsave(&base->t_base.lock, flags);
-	timer->base = &base->t_base;
+	spin_lock_irqsave(&base->lock, flags);
+	timer->base = base;
 	internal_add_timer(base, timer);
-	spin_unlock_irqrestore(&base->t_base.lock, flags);
+	spin_unlock_irqrestore(&base->lock, flags);
 }
 
 
@@ -319,7 +305,7 @@ EXPORT_SYMBOL(mod_timer);
  */
 int del_timer(struct timer_list *timer)
 {
-	timer_base_t *base;
+	tvec_base_t *base;
 	unsigned long flags;
 	int ret = 0;
 
@@ -346,7 +332,7 @@ EXPORT_SYMBOL(del_timer);
  */
 int try_to_del_timer_sync(struct timer_list *timer)
 {
-	timer_base_t *base;
+	tvec_base_t *base;
 	unsigned long flags;
 	int ret = -1;
 
@@ -410,7 +396,7 @@ static int cascade(tvec_base_t *base, tv
 		struct timer_list *tmp;
 
 		tmp = list_entry(curr, struct timer_list, entry);
-		BUG_ON(tmp->base != &base->t_base);
+		BUG_ON(tmp->base != base);
 		curr = curr->next;
 		internal_add_timer(base, tmp);
 	}
@@ -432,7 +418,7 @@ static inline void __run_timers(tvec_bas
 {
 	struct timer_list *timer;
 
-	spin_lock_irq(&base->t_base.lock);
+	spin_lock_irq(&base->lock);
 	while (time_after_eq(jiffies, base->timer_jiffies)) {
 		struct list_head work_list = LIST_HEAD_INIT(work_list);
 		struct list_head *head = &work_list;
@@ -458,7 +444,7 @@ static inline void __run_timers(tvec_bas
 
 			set_running_timer(base, timer);
 			detach_timer(timer, 1);
-			spin_unlock_irq(&base->t_base.lock);
+			spin_unlock_irq(&base->lock);
 			{
 				int preempt_count = preempt_count();
 				fn(data);
@@ -471,11 +457,11 @@ static inline void __run_timers(tvec_bas
 					BUG();
 				}
 			}
-			spin_lock_irq(&base->t_base.lock);
+			spin_lock_irq(&base->lock);
 		}
 	}
 	set_running_timer(base, NULL);
-	spin_unlock_irq(&base->t_base.lock);
+	spin_unlock_irq(&base->lock);
 }
 
 #ifdef CONFIG_NO_IDLE_HZ
@@ -506,7 +492,7 @@ unsigned long next_timer_interrupt(void)
 	hr_expires += jiffies;
 
 	base = __get_cpu_var(tvec_bases);
-	spin_lock(&base->t_base.lock);
+	spin_lock(&base->lock);
 	expires = base->timer_jiffies + (LONG_MAX >> 1);
 	list = NULL;
 
@@ -554,7 +540,7 @@ found:
 				expires = nte->expires;
 		}
 	}
-	spin_unlock(&base->t_base.lock);
+	spin_unlock(&base->lock);
 
 	if (time_before(hr_expires, expires))
 		return hr_expires;
@@ -1530,7 +1516,7 @@ static int __devinit init_timers_cpu(int
 		}
 		per_cpu(tvec_bases, cpu) = base;
 	}
-	spin_lock_init(&base->t_base.lock);
+	spin_lock_init(&base->lock);
 	for (j = 0; j < TVN_SIZE; j++) {
 		INIT_LIST_HEAD(base->tv5.vec + j);
 		INIT_LIST_HEAD(base->tv4.vec + j);
@@ -1552,7 +1538,7 @@ static void migrate_timer_list(tvec_base
 	while (!list_empty(head)) {
 		timer = list_entry(head->next, struct timer_list, entry);
 		detach_timer(timer, 0);
-		timer->base = &new_base->t_base;
+		timer->base = new_base;
 		internal_add_timer(new_base, timer);
 	}
 }
@@ -1568,11 +1554,11 @@ static void __devinit migrate_timers(int
 	new_base = get_cpu_var(tvec_bases);
 
 	local_irq_disable();
-	spin_lock(&new_base->t_base.lock);
-	spin_lock(&old_base->t_base.lock);
+	spin_lock(&new_base->lock);
+	spin_lock(&old_base->lock);
+
+	BUG_ON(old_base->running_timer);
 
-	if (old_base->t_base.running_timer)
-		BUG();
 	for (i = 0; i < TVR_SIZE; i++)
 		migrate_timer_list(new_base, old_base->tv1.vec + i);
 	for (i = 0; i < TVN_SIZE; i++) {
@@ -1582,8 +1568,8 @@ static void __devinit migrate_timers(int
 		migrate_timer_list(new_base, old_base->tv5.vec + i);
 	}
 
-	spin_unlock(&old_base->t_base.lock);
-	spin_unlock(&new_base->t_base.lock);
+	spin_unlock(&old_base->lock);
+	spin_unlock(&new_base->lock);
 	local_irq_enable();
 	put_cpu_var(tvec_bases);
 }

^ permalink raw reply

* [PATCH 00/29] V4L/DVB updates
From: mchehab @ 2006-03-24 19:27 UTC (permalink / raw)
  To: linux-kernel, torvalds; +Cc: linux-dvb-maintainer, video4linux-list, akpm

Linus, please pull from v4l-dvb master branch at
        kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git

There are some big patches here, since:

1) All v4l and dvb drivers are moving to a common place;
2) There were some architectural issues with the way V4L were handling
   audio input routing. These series separates user input selection from
   internal board connections;
3) A virtual v4l driver is introduced here to help v4l2 driver and applications
   development. This driver is being used to identify common V4L2 code that will
   be merged into v4l2 core, aiding major code cleanups.

Cheers,
Mauro.

git cherry:

+ f13ce9ccc53dcc82e369a4e9c5ea59ac2aa796c6 V4L/DVB (3516): Make video_buf more generic
+ 4dd1b9231623df6212bbf621aad99a43c9e73569 V4L/DVB (3518): Creates a virtual video device driver
+ a1afe2bf6f859250a1d1f2c85cb13150f1976b2a V4L/DVB (3519): Corrects MODULE_AUTHOR
+ 395ca7c0b4a94c7d4fd142b69be7099d51666b48 V4L/DVB (3539): Move bttv fragments to bt8xx/
+ af393067875bc7b86ee6edcf69f6b5352abddf05 V4L/DVB (3543): Fix Makefile to adapt to bt8xx/ conversion
+ adc36e3d5eae62207e8ca21f136aba1b90423dc3 V4L/DVB (3546): Fix Compilation after moving bttv code
+ 2ed9bd362904e73ed3e0f4a6806c3cc1365b300c V4L/DVB (3547): Tvaudio.h are just i2c addresses. Merged into i2c-addr.h
+ b2c8c613ccf3765598cd85c46c6f56aa04cf31f4 V4L/DVB (3548): Renamed I2C_foo addresses to I2C_ADDR_foo
+ 42581e5fe43224c87593c65ecc7395ff246fb476 V4L/DVB (3549): Make hotplug automatically load the b2c2-flexcop-usb module
+ baa7068cbd28fed794a66f2f156c08f48621ab0f V4L/DVB (3551): Fix saturation bug. Fix NTSC->PAL standard change. Detect NTSC-KR standard.
+ ae34cd1ad29248a63c07b3731cbbc7e81a297db5 V4L/DVB (3557): Kconfig: fix title and description for VIDEO_CX88_ALSA
+ 35132f201cda985497ddeab2761d6e69ad47a1cd V4L/DVB (3569): PATCH: switch cpia2 to mutexes and use ioctl 32 compat lib func
+ 19fa8ae1692d94584ed00c19ff9cb02d6a5031b0 V4L/DVB (3571): Printk warning fixes
+ 3681505e2df142fc0170196ef8b6b92f3e728e82 V4L/DVB (3572): Cxusb: conditionalize gpio write for the medion box
+ 9f76cd829406d0ae11712e472aa4768fdbe675f4 V4L/DVB (3573): Cxusb: remove FIXME: comment in bluebird_patch_dvico_firmware_download
+ 0b6c42f9f1edc7d4b8b1d33ab04d6ecf0a9f1097 V4L/DVB (3574): Cxusb: fix debug messages
+ 0934b4d869717d6bfb1a508b8faf94651276e2f4 V4L/DVB (3575): Cxusb: fix i2c debug messages for bluebird devices
+ 9ea7c07c57a6314da55cfe05e84a354d4ff33959 V4L/DVB (3577): Cleanup audio input handling
+ 9d32667cb31f8d17110af3fa98731b2c221d3d47 V4L/DVB (3578): Make scart definitions easier to handle
+ 118ad4cf90ea85d362399cec6d15867afb3d4c4e V4L/DVB (3579): Move msp_modus to msp3400-kthreads, add JP and KR std detection
+ 268b16ae75243fc2640f71107530d30ae79526f0 V4L/DVB (3580): Last round of msp3400 cleanups before adding routing commands
+ 019b38bd0ba5c497721ec55ae61cc066fa7f1c6d V4L/DVB (3581): Add new media/msp3400.h header containing the routing macros
+ 72d1f1c821f5d279cdf076a53565aeee096b6615 V4L/DVB (3582): Implement correct msp3400 input/output routing
+ 02ad0726e9722a474235ae171b03958e97c30b47 V4L/DVB (3584): Implement V4L2_TUNER_MODE_LANG1_LANG2 audio mode
+ 27a19f759c74adb4ddcbc4a551bc3b3ac4084403 V4L/DVB (3587): Always wake thread after routing change.
+ 588acc93e91c09c35a5bf92573bf76b2e9c84e67 V4L/DVB (3588): Remove VIDIOC_G/S_AUDOUT from msp3400
+ b21c564c94c5a0b6e7af9651bd72c843e89c5e42 V4L/DVB (3597): Vivi: fix warning: implicit declaration of function 'in_interrupt'
+ 78cbf3a4f55eddb5fd8cfab670076488dfb71577 V4L/DVB (3598): Add bit algorithm adapter for the Conexant CX2341X boards.
+ dfb171d4084c0c829eaa339fe042610cdad5710d V4L/DVB (3599): Implement new routing commands for wm8775 and cs53l32a.

V4L/DVB development is hosted at http://linuxtv.org
Development Mercurial trees are available at http://linuxtv.org/hg
---

 drivers/media/common/saa7146_fops.c           |    5 
 drivers/media/common/saa7146_vbi.c            |    8 
 drivers/media/common/saa7146_video.c          |    8 
 drivers/media/dvb/b2c2/flexcop-usb.c          |    1 
 drivers/media/dvb/bt8xx/Makefile              |    2 
 drivers/media/dvb/dvb-usb/cxusb.c             |   28 
 drivers/media/dvb/dvb-usb/cxusb.h             |    2 
 drivers/media/dvb/ttpci/av7110_v4l.c          |    5 
 drivers/media/video/Kconfig                   |   26 
 drivers/media/video/Makefile                  |    7 
 drivers/media/video/bt832.c                   |  266 
 drivers/media/video/bt832.h                   |  305 -
 drivers/media/video/bt848.h                   |  366 -
 drivers/media/video/bt8xx/Kconfig             |   25 
 drivers/media/video/bt8xx/Makefile            |   12 
 drivers/media/video/bt8xx/bt832.c             |  269 
 drivers/media/video/bt8xx/bt832.h             |  305 +
 drivers/media/video/bt8xx/bt848.h             |  366 +
 drivers/media/video/bt8xx/bttv-cards.c        | 5326 +++++++++++++++++-
 drivers/media/video/bt8xx/bttv-driver.c       | 4411 ++++++++++++++
 drivers/media/video/bt8xx/bttv-gpio.c         |  208 
 drivers/media/video/bt8xx/bttv-i2c.c          |  478 +
 drivers/media/video/bt8xx/bttv-if.c           |  159 
 drivers/media/video/bt8xx/bttv-input.c        |  450 +
 drivers/media/video/bt8xx/bttv-risc.c         |  795 ++
 drivers/media/video/bt8xx/bttv-vbi.c          |  221 
 drivers/media/video/bt8xx/bttv.h              |  430 +
 drivers/media/video/bt8xx/bttvp.h             |  415 +
 drivers/media/video/bttv-cards.c              | 5011 ----------------
 drivers/media/video/bttv-driver.c             | 4284 --------------
 drivers/media/video/bttv-gpio.c               |  208 
 drivers/media/video/bttv-i2c.c                |  474 -
 drivers/media/video/bttv-if.c                 |  159 
 drivers/media/video/bttv-input.c              |  450 -
 drivers/media/video/bttv-risc.c               |  799 --
 drivers/media/video/bttv-vbi.c                |  227 
 drivers/media/video/bttv.h                    |  407 -
 drivers/media/video/bttvp.h                   |  414 -
 drivers/media/video/cpia2/cpia2.h             |    2 
 drivers/media/video/cpia2/cpia2_core.c        |   40 
 drivers/media/video/cpia2/cpia2_v4l.c         |   43 
 drivers/media/video/cs53l32a.c                |   20 
 drivers/media/video/cx25840/cx25840-audio.c   |    1 
 drivers/media/video/cx25840/cx25840-core.c    |   51 
 drivers/media/video/cx88/Kconfig              |    5 
 drivers/media/video/cx88/cx88-alsa.c          |    4 
 drivers/media/video/cx88/cx88-blackbird.c     |    5 
 drivers/media/video/cx88/cx88-core.c          |    6 
 drivers/media/video/cx88/cx88-dvb.c           |    5 
 drivers/media/video/cx88/cx88-mpeg.c          |   28 
 drivers/media/video/cx88/cx88-tvaudio.c       |    3 
 drivers/media/video/cx88/cx88-vbi.c           |    7 
 drivers/media/video/cx88/cx88-video.c         |   35 
 drivers/media/video/cx88/cx88.h               |    7 
 drivers/media/video/em28xx/em28xx-cards.c     |    9 
 drivers/media/video/em28xx/em28xx-video.c     |    8 
 drivers/media/video/font.h                    |  407 +
 drivers/media/video/msp3400-driver.c          |  279 
 drivers/media/video/msp3400-driver.h          |  117 
 drivers/media/video/msp3400-kthreads.c        |  345 -
 drivers/media/video/msp3400.h                 |  133 
 drivers/media/video/mxb.c                     |   12 
 drivers/media/video/rds.h                     |   48 
 drivers/media/video/saa6588.c                 |    2 
 drivers/media/video/saa7115.c                 |    1 
 drivers/media/video/saa7134/saa7134-alsa.c    |   10 
 drivers/media/video/saa7134/saa7134-core.c    |    6 
 drivers/media/video/saa7134/saa7134-oss.c     |    6 
 drivers/media/video/saa7134/saa7134-ts.c      |    9 
 drivers/media/video/saa7134/saa7134-tvaudio.c |    2 
 drivers/media/video/saa7134/saa7134-vbi.c     |   10 
 drivers/media/video/saa7134/saa7134-video.c   |    9 
 drivers/media/video/saa7134/saa7134.h         |    3 
 drivers/media/video/tda7432.c                 |    5 
 drivers/media/video/tda9840.c                 |    2 
 drivers/media/video/tda9840.h                 |    2 
 drivers/media/video/tda9875.c                 |    9 
 drivers/media/video/tea6420.c                 |    2 
 drivers/media/video/tea6420.h                 |    4 
 drivers/media/video/tuner-core.c              |    1 
 drivers/media/video/tvaudio.c                 |  154 
 drivers/media/video/tvaudio.h                 |   14 
 drivers/media/video/tveeprom.c                |   30 
 drivers/media/video/v4l2-common.c             |   42 
 drivers/media/video/video-buf.c               |  250 
 drivers/media/video/vivi.c                    | 1456 ++++
 drivers/media/video/wm8775.c                  |   20 
 include/linux/i2c-id.h                        |    1 
 include/linux/videodev2.h                     |    1 
 include/media/audiochip.h                     |   14 
 include/media/cs53l32a.h                      |   34 
 include/media/i2c-addr.h                      |  102 
 include/media/msp3400.h                       |  226 
 include/media/rds.h                           |   44 
 include/media/saa7146_vv.h                    |    3 
 include/media/tvaudio.h                       |   30 
 include/media/v4l2-common.h                   |   19 
 include/media/video-buf.h                     |   56 
 include/media/wm8775.h                        |   35 
 99 files changed, 17015 insertions(+), 14551 deletions(-)


^ permalink raw reply

* [PATCH] USB serial: Converts port semaphore to mutexes.
From: Luiz Fernando Capitulino @ 2006-03-24 20:12 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, linux-usb-devel


 The usbserial's port semaphore used to synchronize serial_open()
and serial_close() are strict mutexes, convert them to the mutex
implementation.

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>

---

 drivers/usb/serial/usb-serial.c |   16 ++++++++--------
 drivers/usb/serial/usb-serial.h |    6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

56a513093e0de2e058d1ddecb4c36ff05c1c4f1a
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 097f4e8..071f86a 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -27,10 +27,10 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/list.h>
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 #include <linux/usb.h>
 #include "usb-serial.h"
 #include "pl2303.h"
@@ -192,7 +192,7 @@ static int serial_open (struct tty_struc
 	if (!port)
 		return -ENODEV;
 
-	if (down_interruptible(&port->sem))
+	if (mutex_lock_interruptible(&port->mutex))
 		return -ERESTARTSYS;
 	 
 	++port->open_count;
@@ -219,7 +219,7 @@ static int serial_open (struct tty_struc
 			goto bailout_module_put;
 	}
 
-	up(&port->sem);
+	mutex_unlock(&port->mutex);
 	return 0;
 
 bailout_module_put:
@@ -227,7 +227,7 @@ bailout_module_put:
 bailout_kref_put:
 	kref_put(&serial->kref, destroy_serial);
 	port->open_count = 0;
-	up(&port->sem);
+	mutex_unlock(&port->mutex);
 	return retval;
 }
 
@@ -240,10 +240,10 @@ static void serial_close(struct tty_stru
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	down(&port->sem);
+	mutex_lock(&port->mutex);
 
 	if (port->open_count == 0) {
-		up(&port->sem);
+		mutex_unlock(&port->mutex);
 		return;
 	}
 
@@ -262,7 +262,7 @@ static void serial_close(struct tty_stru
 		module_put(port->serial->type->driver.owner);
 	}
 
-	up(&port->sem);
+	mutex_unlock(&port->mutex);
 	kref_put(&port->serial->kref, destroy_serial);
 }
 
@@ -783,7 +783,7 @@ int usb_serial_probe(struct usb_interfac
 		port->number = i + serial->minor;
 		port->serial = serial;
 		spin_lock_init(&port->lock);
-		sema_init(&port->sem, 1);
+		mutex_init(&port->mutex);
 		INIT_WORK(&port->work, usb_serial_port_softint, port);
 		serial->port[i] = port;
 	}
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index d7d27c3..dc89d87 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -16,7 +16,7 @@
 
 #include <linux/config.h>
 #include <linux/kref.h>
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
 
 #define SERIAL_TTY_MAJOR	188	/* Nice legal number now */
 #define SERIAL_TTY_MINORS	255	/* loads of devices :) */
@@ -31,7 +31,7 @@
  * @serial: pointer back to the struct usb_serial owner of this port.
  * @tty: pointer to the corresponding tty for this port.
  * @lock: spinlock to grab when updating portions of this structure.
- * @sem: semaphore used to synchronize serial_open() and serial_close()
+ * @mutex: mutex used to synchronize serial_open() and serial_close()
  *	access for this port.
  * @number: the number of the port (the minor number).
  * @interrupt_in_buffer: pointer to the interrupt in buffer for this port.
@@ -63,7 +63,7 @@ struct usb_serial_port {
 	struct usb_serial *	serial;
 	struct tty_struct *	tty;
 	spinlock_t		lock;
-	struct semaphore        sem;
+	struct mutex            mutex;
 	unsigned char		number;
 
 	unsigned char *		interrupt_in_buffer;
-- 
1.2.4



-- 
Luiz Fernando N. Capitulino

^ permalink raw reply related

* [RFC] [PATCH] Move drivers/usb/media to drivers/media/video
From: Mauro Carvalho Chehab @ 2006-03-24 20:11 UTC (permalink / raw)
  To: LKML
  Cc: Greg KH, Linus Torvalds, Andrew Morton, v4l-dvb maintainer list,
	Linux and Kernel Video

Because of historic reasons, there are two separate directories with
V4L stuff. Most drivers are located at driver/media/video. However, some
code for USB Webcams were inserted under drivers/usb/media.

This makes difficult for module authors to know were things should be.
Also, makes Kconfig menu confusing for normal users.

This patch moves all V4L content under drivers/usb/media to
drivers/media/video, and fixes Kconfig/Makefile entries.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

The patch is at: http://www.linuxtv.org/~mchehab/usb/

---

 drivers/media/Kconfig                              |   14 
 drivers/media/video/Kconfig                        |  232 +
 drivers/media/video/Makefile                       |   19 
 drivers/media/video/dabfirmware.h                  | 1408 +++++
 drivers/media/video/dabusb.c                       |  874 +++
 drivers/media/video/dabusb.h                       |   85 
 drivers/media/video/dsbr100.c                      |  429 +
 drivers/media/video/et61x251/Makefile              |    4 
 drivers/media/video/et61x251/et61x251.h            |  234 +
 drivers/media/video/et61x251/et61x251_core.c       | 2630 +++++++++
 drivers/media/video/et61x251/et61x251_sensor.h     |  116 
 drivers/media/video/et61x251/et61x251_tas5130d1b.c |  141 
 drivers/media/video/ov511.c                        | 5932 ++++++++++++++++++++
 drivers/media/video/ov511.h                        |  568 ++
 drivers/media/video/pwc/Makefile                   |   20 
 drivers/media/video/pwc/philips.txt                |  236 +
 drivers/media/video/pwc/pwc-ctrl.c                 | 1541 +++++
 drivers/media/video/pwc/pwc-if.c                   | 2205 +++++++
 drivers/media/video/pwc/pwc-ioctl.h                |  292 +
 drivers/media/video/pwc/pwc-kiara.c                |  318 +
 drivers/media/video/pwc/pwc-kiara.h                |   45 
 drivers/media/video/pwc/pwc-misc.c                 |  140 
 drivers/media/video/pwc/pwc-nala.h                 |   66 
 drivers/media/video/pwc/pwc-timon.c                |  316 +
 drivers/media/video/pwc/pwc-timon.h                |   61 
 drivers/media/video/pwc/pwc-uncompress.c           |  146 
 drivers/media/video/pwc/pwc-uncompress.h           |   41 
 drivers/media/video/pwc/pwc.h                      |  272 +
 drivers/media/video/se401.c                        | 1435 +++++
 drivers/media/video/se401.h                        |  234 +
 drivers/media/video/sn9c102/Makefile               |    7 
 drivers/media/video/sn9c102/sn9c102.h              |  218 +
 drivers/media/video/sn9c102/sn9c102_core.c         | 2919 ++++++++++
 drivers/media/video/sn9c102/sn9c102_hv7131d.c      |  271 +
 drivers/media/video/sn9c102/sn9c102_mi0343.c       |  363 +
 drivers/media/video/sn9c102/sn9c102_ov7630.c       |  401 +
 drivers/media/video/sn9c102/sn9c102_pas106b.c      |  307 +
 drivers/media/video/sn9c102/sn9c102_pas202bca.c    |  238 +
 drivers/media/video/sn9c102/sn9c102_pas202bcb.c    |  293 +
 drivers/media/video/sn9c102/sn9c102_sensor.h       |  389 +
 drivers/media/video/sn9c102/sn9c102_tas5110c1b.c   |  159 +
 drivers/media/video/sn9c102/sn9c102_tas5130d1b.c   |  169 +
 drivers/media/video/stv680.c                       | 1508 +++++
 drivers/media/video/stv680.h                       |  227 +
 drivers/media/video/usbvideo/Makefile              |    4 
 drivers/media/video/usbvideo/ibmcam.c              | 3932 +++++++++++++
 drivers/media/video/usbvideo/konicawc.c            |  978 +++
 drivers/media/video/usbvideo/ultracam.c            |  679 ++
 drivers/media/video/usbvideo/usbvideo.c            | 2190 +++++++
 drivers/media/video/usbvideo/usbvideo.h            |  394 +
 drivers/media/video/usbvideo/vicam.c               | 1411 +++++
 drivers/media/video/w9968cf.c                      | 3691 ++++++++++++
 drivers/media/video/w9968cf.h                      |  330 +
 drivers/media/video/w9968cf_decoder.h              |   86 
 drivers/media/video/w9968cf_vpp.h                  |   40 
 drivers/media/video/zc0301/Makefile                |    3 
 drivers/media/video/zc0301/zc0301.h                |  192 +
 drivers/media/video/zc0301/zc0301_core.c           | 2055 +++++++
 drivers/media/video/zc0301/zc0301_pas202bcb.c      |  361 +
 drivers/media/video/zc0301/zc0301_sensor.h         |  103 
 drivers/usb/Kconfig                                |    2 
 drivers/usb/Makefile                               |   14 
 drivers/usb/media/Kconfig                          |  241 -
 drivers/usb/media/Makefile                         |   24 
 drivers/usb/media/dabfirmware.h                    | 1408 -----
 drivers/usb/media/dabusb.c                         |  874 ---
 drivers/usb/media/dabusb.h                         |   85 
 drivers/usb/media/dsbr100.c                        |  429 -
 drivers/usb/media/et61x251.h                       |  234 -
 drivers/usb/media/et61x251_core.c                  | 2630 ---------
 drivers/usb/media/et61x251_sensor.h                |  116 
 drivers/usb/media/et61x251_tas5130d1b.c            |  141 
 drivers/usb/media/ibmcam.c                         | 3932 -------------
 drivers/usb/media/konicawc.c                       |  978 ---
 drivers/usb/media/ov511.c                          | 5932 --------------------
 drivers/usb/media/ov511.h                          |  568 --
 drivers/usb/media/pwc/Makefile                     |   20 
 drivers/usb/media/pwc/philips.txt                  |  236 -
 drivers/usb/media/pwc/pwc-ctrl.c                   | 1541 -----
 drivers/usb/media/pwc/pwc-if.c                     | 2205 -------
 drivers/usb/media/pwc/pwc-ioctl.h                  |  292 -
 drivers/usb/media/pwc/pwc-kiara.c                  |  318 -
 drivers/usb/media/pwc/pwc-kiara.h                  |   45 
 drivers/usb/media/pwc/pwc-misc.c                   |  140 
 drivers/usb/media/pwc/pwc-nala.h                   |   66 
 drivers/usb/media/pwc/pwc-timon.c                  |  316 -
 drivers/usb/media/pwc/pwc-timon.h                  |   61 
 drivers/usb/media/pwc/pwc-uncompress.c             |  146 
 drivers/usb/media/pwc/pwc-uncompress.h             |   41 
 drivers/usb/media/pwc/pwc.h                        |  272 -
 drivers/usb/media/se401.c                          | 1435 -----
 drivers/usb/media/se401.h                          |  234 -
 drivers/usb/media/sn9c102.h                        |  218 -
 drivers/usb/media/sn9c102_core.c                   | 2919 ----------
 drivers/usb/media/sn9c102_hv7131d.c                |  271 -
 drivers/usb/media/sn9c102_mi0343.c                 |  363 -
 drivers/usb/media/sn9c102_ov7630.c                 |  401 -
 drivers/usb/media/sn9c102_pas106b.c                |  307 -
 drivers/usb/media/sn9c102_pas202bca.c              |  238 -
 drivers/usb/media/sn9c102_pas202bcb.c              |  293 -
 drivers/usb/media/sn9c102_sensor.h                 |  389 -
 drivers/usb/media/sn9c102_tas5110c1b.c             |  159 -
 drivers/usb/media/sn9c102_tas5130d1b.c             |  169 -
 drivers/usb/media/stv680.c                         | 1508 -----
 drivers/usb/media/stv680.h                         |  227 -
 drivers/usb/media/ultracam.c                       |  679 --
 drivers/usb/media/usbvideo.c                       | 2190 -------
 drivers/usb/media/usbvideo.h                       |  394 -
 drivers/usb/media/vicam.c                          | 1411 -----
 drivers/usb/media/w9968cf.c                        | 3691 ------------
 drivers/usb/media/w9968cf.h                        |  330 -
 drivers/usb/media/w9968cf_decoder.h                |   86 
 drivers/usb/media/w9968cf_vpp.h                    |   40 
 drivers/usb/media/zc0301.h                         |  192 -
 drivers/usb/media/zc0301_core.c                    | 2055 -------
 drivers/usb/media/zc0301_pas202bcb.c               |  361 -
 drivers/usb/media/zc0301_sensor.h                  |  103 
 117 files changed, 43970 insertions(+), 43972 deletions(-)



^ permalink raw reply

* Re: [RFC][PATCH 2/2] Virtualization of IPC
From: Eric W. Biederman @ 2006-03-24 20:09 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: Linus Torvalds, Andrew Morton, xemul, ebiederm, haveblue,
	linux-kernel, herbert, devel, serue, sam
In-Reply-To: <44242DFE.3090601@sw.ru>

Kirill Korotaev <dev@sw.ru> writes:

> This patch introduces IPC namespaces, which allow to create isolated IPC users
> or containers.
> Introduces CONFIG_IPC_NS and ipc_namespace structure.
> It also uses current->ipc_ns as a pointer to current namespace, which reduces
> places where additional argument to functions should be added.

I don't see where we are freeing the shared memory segments,
the message queues and the semaphores when the last user of the namespace
goes away.  Am I missing something?

> --- a/include/linux/ipc.h
> +++ b/include/linux/ipc.h
> @@ -70,6 +70,50 @@ struct kern_ipc_perm
>  
>  #endif /* __KERNEL__ */
>  
> +#include <linux/config.h>
> +
> +#ifdef CONFIG_IPC_NS
> +#include <asm/atomic.h>
> +
> +struct ipc_ids;
> +struct ipc_namespace {
> +	atomic_t cnt;
> +
> +	struct ipc_ids *sem_ids;
> +	int sem_ctls[4];
> +	int used_sems;
> +
> +	struct ipc_ids *msg_ids;
> +	int msg_ctlmax;
> +	int msg_ctlmnb;
> +	int msg_ctlmni;
> +
> +	struct ipc_ids *shm_ids;
> +	size_t	shm_ctlmax;
> +	size_t 	shm_ctlall;
> +	int 	shm_ctlmni;
> +	int	shm_total;
> +};

I believe there is a small problem with this implementation.
per namespace counts and limits are fine.  But I think we want
to maintain true global limits as well.   I know
concerns of that nature have been expressed in regards
to Daves patch.

> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1193,6 +1193,7 @@ static task_t *copy_process(unsigned lon
>  	attach_pid(p, PIDTYPE_TGID, p->tgid);
>  	attach_pid(p, PIDTYPE_PID, p->pid);
>  	get_uts_ns(p->uts_ns);
> +	get_ipc_ns(p->ipc_ns);
>  
>  	nr_threads++;
>  	total_forks++;

Again please move the get outside of the tasklist_lock.

Eric

^ permalink raw reply

* Re: [Ext2-devel] [RFC] [PATCH] Reducing average ext2 fsck time through fs-wide dirty bit]
From: Theodore Ts'o @ 2006-03-24 20:01 UTC (permalink / raw)
  To: Valerie Henson, Andrew Morton, pbadari, linux-kernel, Ext2-devel,
	arjan, zach.brown
In-Reply-To: <20060324192802.GK14852@schatzie.adilger.int>

On Fri, Mar 24, 2006 at 12:28:02PM -0700, Andreas Dilger wrote:
> The good news, is that fixing the "ext3 clearing indirect blocks" problem
> not only allows undelete to work again, but also improves truncate
> performance because (a) we only modify 1/32 of the blocks we would in the
> old case (we don't need to modify any {d,t,}indirect blocks), (b) we do
> indirect block walking in forward direction, and could submit {d,}indirect
> block requests in a batch instead of one-at-a-time.
> 
> Fix for this problem (inode is locked already):
> - create a modified ext3_free_branches() to do tree walking and call a
>   method instead of always calling ext3_free_data->ext3_clear_blocks
> - walk inode {d,t,}indirect blocks in forward direction, count bitmaps and
>   groups that will be modified (essentially NULL ext3_free_branches method)
> - try to start a journal handle for this many blocks + 1 (inode) +
>   1 (super) + quota + EXT3_RESERVE_TRANS_BLOCKS
>   - if journal handle is too large (journal_start() returns -ENOSPC) fall
>     back to old zero-in-steps method (vast majority of cases will be OK
>     because number of modified blocks is much fewer)
> - walk inode {d,t,}indirect blocks again deleting blocks via
>   ext3_free_blocks_sb() (updates group descriptor, bitmaps, quota), but
>   not journaling or modifying the indirect blocks
> - update i_size/i_disksize/i_blocks to new value, like ext2
> - close transaction

I would love to see something like this as well (the fact that we zero
out the indirect blocks on truncate/unlink has always bothered me).
However, the thing that scares me about this is that this means we now
have to maintain *two* horribly complicated pieces of code for which
it will be very easy for bugs to creep in.  

This would be a prime candidate for trying to add the same sort of
userspace test framework which Rusty and company did for netfilter, so
we can try to test for race conditions, corner cases, etc.

						- Ted

^ permalink raw reply

* Re: 2.6.16-mm1
From: Russell King @ 2006-03-24 19:59 UTC (permalink / raw)
  To: Roman Zippel; +Cc: Michal Piotrowski, Andrew Morton, linux-kernel, linux-serial
In-Reply-To: <Pine.LNX.4.64.0603241140350.16802@scrub.home>

On Fri, Mar 24, 2006 at 12:28:27PM +0100, Roman Zippel wrote:
> Hi,
> 
> On Thu, 23 Mar 2006, Russell King wrote:
> 
> > Okay, so the default is now 'm', but the legal values are still only 'n'
> > and 'm'.  I can only select 'm' or 'n', and this is what I end up with in
> > the config file.  Now, if I remove the prompt text:
> > 
> > config SYM_D
> >         tristate
> >         depends on SYM_M && SYM_Y
> >         default y
> > 
> > and hey presto, suddenly 'y' becomes a legal value.
> > 
> > CONFIG_SYM_Y=y
> > CONFIG_SYM_M=m
> > CONFIG_SYM_D=y
> > 
> > So it would seem to be a Kconfig bug.
> 
> No, it's not a bug, that's really the correct behaviour. It has its roots 
> in the cml1 converter, where statements like this:
> 
> if [ "$CONFIG_FOO" = "y" ]; then
>   define_tristate CONFIG_BAR y
> fi
> 
> would become:
> 
> config BAR
> 	default y
> 	depends on FOO=y

Okay, so going to the exact problem case, the behaviour we require is:

SERIAL_8250	PCI	EMBEDDED	gives SERIAL_8250_PCI
	n	X	X		n
	X	n	X		n
	m	y	n		m
	y	y	n		y
	m	y	y		user selects 'm' or 'n'
	y	y	y		user selects 'y', 'm' or 'n'

the correct way to tell Kconfig to give us that is:

+config SERIAL_8250_PCI
+       tristate "8250/16550 PCI device support" if EMBEDDED
+       depends on SERIAL_8250 && PCI
+       default SERIAL_8250
+       help
+         This builds standard PCI serial support. You may be able to
+         disable this feature if you only need legacy serial support.
+         Saves about 9K.

?

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply

* Re: [RFC] Virtualization steps
From: Eric W. Biederman @ 2006-03-24 19:53 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Nick Piggin, Kirill Korotaev, linux-kernel, herbert, devel, serue,
	akpm, sam, Alexey Kuznetsov, Pavel Emelianov, Stanislav Protassov
In-Reply-To: <1143228339.19152.91.camel@localhost.localdomain>

Dave Hansen <haveblue@us.ibm.com> writes:

> On Sat, 2006-03-25 at 04:33 +1100, Nick Piggin wrote:
>> Oh, after you come to an agreement and start posting patches, can you
>> also outline why we want this in the kernel (what it does that low
>> level virtualization doesn't, etc, etc) 
>
> Can you wait for an OLS paper? ;)
>
> I'll summarize it this way: low-level virtualization uses resource
> inefficiently.
>
> With this higher-level stuff, you get to share all of the Linux caching,
> and can do things like sharing libraries pretty naturally.

Also it is a major enabler for things such as process migration,
between kernels.

> They are also much lighter-weight to create and destroy than full
> virtual machines.  We were planning on doing some performance
> comparisons versus some hypervisors like Xen and the ppc64 one to show
> scaling with the number of virtualized instances.  Creating 100 of these
> Linux containers is as easy as a couple of shell scripts, but we still
> can't find anybody crazy enough to go create 100 Xen VMs.

One of my favorite test cases is to kill about 100 of them
simultaneously :)

I think on a reasonably beefy dual processor machine I should be able
to get about 1000 of them running all at once.

> Anyway, those are the things that came to my mind first.  I'm sure the
> others involved have their own motivations.

The practical aspect is that several groups have found the arguments
compelling enough that they have already done complete
implementations.  At which point getting us all to agree on a common
implementation is important. :)

Eric

^ permalink raw reply

* Re: [RFC][PATCH 1/2] Virtualization of UTS
From: Eric W. Biederman @ 2006-03-24 19:50 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: Linus Torvalds, Andrew Morton, xemul, haveblue, linux-kernel,
	herbert, devel, serue, sam
In-Reply-To: <442449F8.4050808@sw.ru>

Kirill Korotaev <dev@sw.ru> writes:

>>> This patch introduces utsname namespace in system, which allows to have
>>> different utsnames on the host.
>>> Introduces config option CONFIG_UTS_NS and uts_namespace structure for this.
>> Ok.  It looks like we need to resolve the sysctl issues before we merge
>> either patch, into the stable kernel.
> I disagree with you. Right now we can have sysctl and proc for init namespaces
> only.
> And when sysctl and proc are virtualized somehow, we can fix all these.
> I simply don't expect /proc and sysctl to be done quickly. As we have very
> different approaches. And there is no any consensus. Why not to commit
> working/agreed parts then?

So getting this code into Andrews development tree (as long as he is willing
to accept it) looks very reasonable.  We can't change the interface
once we get into the stable kernel because that becomes part of the
ABI.

So all I am saying is that this code is clearly not yet ready for
the stable branch, because we plan to change the sysctl interface.

>> We also need to discuss the system call interface, as without one
>> the functionality is unusable :)
> I also don't see why it can be separated. There is an API in namespaces, and how
> it is mapped into syscalls is another question. At least it doesn't prevent us
> from commiting virtualization itself, agree?

Separating the patches makes a lot of sense.  Putting something into
the kernel without any in tree users is a problem.

Eric

^ permalink raw reply

* Papouch USB thermometer support
From: Folkert van Heusden @ 2006-03-24 19:46 UTC (permalink / raw)
  To: info, linux-kernel, bryder

Hi,

The following patch against 2.6.15 adds support for the www.Papouch.com
USB thermometer by adding the appropriate vendor and product id.


Signed off: Folkert van Heusden <folkert@vanheusden.com

diff -uNrbBd old/ftdi_sio.c new/ftdi_sio.c
--- old/ftdi_sio.c      2006-03-24 20:36:19.000000000 +0100
+++ new/ftdi_sio.c      2006-03-24 20:33:20.000000000 +0100
@@ -307,6 +307,7 @@


 static struct usb_device_id id_table_combined [] = {
+       { USB_DEVICE(PAPOUCHE_VENDOR, PAPOUCHE_THEM_PROD) },
        { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
diff -uNrbBd old/ftdi_sio.h new/ftdi_sio.h
--- old/ftdi_sio.h      2006-03-24 20:36:19.000000000 +0100
+++ new/ftdi_sio.h      2006-03-24 20:37:35.000000000 +0100
@@ -20,8 +20,13 @@
  * Philipp Gühring - pg@futureware.at - added the Device ID of the USB relais
  * from Rudolf Gugler
  *
+ * Folkert van Heusden - folkert@vanheusden.com - added the device id of the
+ * temperature sensor from www.papouch.com
  */

+#define PAPOUCHE_VENDOR 0x5050
+#define PAPOUCHE_THEM_PROD 0x0400
+
 #define FTDI_VID       0x0403  /* Vendor Id */
 #define FTDI_SIO_PID   0x8372  /* Product Id SIO application of 8U100AX  */
 #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */


Folkert van Heusden

-- 
www.vanheusden.com/multitail - multitail is tail on steroids. multiple
               windows, filtering, coloring, anything you can think of
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

^ permalink raw reply

* Re: [BLOCK] delay all uevents until partition table is scanned
From: Kay Sievers @ 2006-03-24 19:45 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel, greg, viro
In-Reply-To: <20060324113502.e6583da6.rdunlap@xenotime.net>

On Fri, Mar 24, 2006 at 11:35:02AM -0800, Randy.Dunlap wrote:
> On Fri, 24 Mar 2006 20:17:48 +0100 Kay Sievers wrote:
> 
> > +	/* scan partition table, but supress uevents */
> > +	disk->part_uevent_supress = 1;
> > +	err = blkdev_get(bdev, FMODE_READ, 0);
> > +	disk->part_uevent_supress = 0;
> 
> s/supress/suppress/ please.

Oh!

Thanks,
Kay


From: Kay Sievers <kay.sievers@suse.de>

[BLOCK] delay all uevents until partition table is scanned

Here we delay the annoucement of all block device events until the
disk's partition table is scanned and all partition devices are already
created and sysfs is populated.

We have a bunch of old bugs for removable storage handling where we
probe successfully for a filesystem on the raw disk, but at the
same time the kernel recognizes a partition table and creates partition
devices.
Currently there is no sane way to tell if partitions will show up or not
at the time the disk device is announced to userspace. With the delayed
events we can simply skip any probe for a filesystem on the raw disk when
we find already present partitions.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
---

 fs/partitions/check.c |   40 +++++++++++++++++++++++++++++++---------
 include/linux/genhd.h |    1 +
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index f924f45..64e65bd 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -310,7 +310,9 @@ void delete_partition(struct gendisk *di
 	p->ios[0] = p->ios[1] = 0;
 	p->sectors[0] = p->sectors[1] = 0;
 	devfs_remove("%s/part%d", disk->devfs_name, part);
-	kobject_unregister(&p->kobj);
+	kobject_uevent(&p->kobj, KOBJ_REMOVE);
+	kobject_del(&p->kobj);
+	kobject_put(&p->kobj);
 }
 
 void add_partition(struct gendisk *disk, int part, sector_t start, sector_t len)
@@ -336,7 +338,10 @@ void add_partition(struct gendisk *disk,
 		snprintf(p->kobj.name,KOBJ_NAME_LEN,"%s%d",disk->kobj.name,part);
 	p->kobj.parent = &disk->kobj;
 	p->kobj.ktype = &ktype_part;
-	kobject_register(&p->kobj);
+	kobject_init(&p->kobj);
+	kobject_add(&p->kobj);
+	if (!disk->part_uevent_suppress)
+		kobject_uevent(&p->kobj, KOBJ_ADD);
 	disk->part[part-1] = p;
 }
 
@@ -373,6 +378,8 @@ void register_disk(struct gendisk *disk)
 {
 	struct block_device *bdev;
 	char *s;
+	int i;
+	struct hd_struct *p;
 	int err;
 
 	strlcpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN);
@@ -382,14 +389,13 @@ void register_disk(struct gendisk *disk)
 		*s = '!';
 	if ((err = kobject_add(&disk->kobj)))
 		return;
-	disk_sysfs_symlinks(disk);
-	kobject_uevent(&disk->kobj, KOBJ_ADD);
 
+	disk_sysfs_symlinks(disk);
 	/* No minors to use for partitions */
 	if (disk->minors == 1) {
 		if (disk->devfs_name[0] != '\0')
 			devfs_add_disk(disk);
-		return;
+		goto exit;
 	}
 
 	/* always add handle for the whole disk */
@@ -397,16 +403,32 @@ void register_disk(struct gendisk *disk)
 
 	/* No such device (e.g., media were just removed) */
 	if (!get_capacity(disk))
-		return;
+		goto exit;
 
 	bdev = bdget_disk(disk, 0);
 	if (!bdev)
-		return;
+		goto exit;
 
+	/* scan partition table, but suppress uevents */
 	bdev->bd_invalidated = 1;
-	if (blkdev_get(bdev, FMODE_READ, 0) < 0)
-		return;
+	disk->part_uevent_suppress = 1;
+	err = blkdev_get(bdev, FMODE_READ, 0);
+	disk->part_uevent_suppress = 0;
+	if (err < 0)
+		goto exit;
 	blkdev_put(bdev);
+
+exit:
+	/* announce disk after possible partitions are already created */
+	kobject_uevent(&disk->kobj, KOBJ_ADD);
+
+	/* announce possible partitions */
+	for (i = 1; i < disk->minors; i++) {
+		p = disk->part[i-1];
+		if (!p || !p->nr_sects)
+			continue;
+		kobject_uevent(&p->kobj, KOBJ_ADD);
+	}
 }
 
 int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index eef5ccd..7e60142 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -104,6 +104,7 @@ struct gendisk {
                                          * disks that can't be partitioned. */
 	char disk_name[32];		/* name of major driver */
 	struct hd_struct **part;	/* [indexed by minor] */
+	int part_uevent_suppress;
 	struct block_device_operations *fops;
 	struct request_queue *queue;
 	void *private_data;


^ permalink raw reply related

* Re: [RFC][PATCH 1/2] Virtualization of UTS
From: Kirill Korotaev @ 2006-03-24 19:35 UTC (permalink / raw)
  To: Eric W. Biederman
  Cc: Linus Torvalds, Andrew Morton, xemul, haveblue, linux-kernel,
	herbert, devel, serue, sam
In-Reply-To: <m18xqzk6cy.fsf@ebiederm.dsl.xmission.com>

>> This patch introduces utsname namespace in system, which allows to have
>> different utsnames on the host.
>> Introduces config option CONFIG_UTS_NS and uts_namespace structure for this.
> 
> Ok.  It looks like we need to resolve the sysctl issues before we merge
> either patch, into the stable kernel.
I disagree with you. Right now we can have sysctl and proc for init 
namespaces only.
And when sysctl and proc are virtualized somehow, we can fix all these.
I simply don't expect /proc and sysctl to be done quickly. As we have 
very different approaches. And there is no any consensus. Why not to 
commit working/agreed parts then?

> We also need to discuss the system call interface, as without one
> the functionality is unusable :)
I also don't see why it can be separated. There is an API in namespaces, 
and how it is mapped into syscalls is another question. At least it 
doesn't prevent us from commiting virtualization itself, agree?

Thanks,
Kirill

^ permalink raw reply

* Re: [RFC][PATCH 1/2] Virtualization of UTS
From: Eric W. Biederman @ 2006-03-24 19:09 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: Linus Torvalds, Andrew Morton, xemul, ebiederm, haveblue,
	linux-kernel, herbert, devel, serue, sam
In-Reply-To: <44242CE7.3030905@sw.ru>

Kirill Korotaev <dev@sw.ru> writes:

> This patch introduces utsname namespace in system, which allows to have
> different utsnames on the host.
> Introduces config option CONFIG_UTS_NS and uts_namespace structure for this.

Ok.  It looks like we need to resolve the sysctl issues before we merge
either patch, into the stable kernel.

We also need to discuss the system call interface, as without one
the functionality is unusable :)

> http://git.openvz.org/?p=linux-2.6-openvz-ms;a=commitdiff;h=216bb5e42c7eef7f1ed361244a60b1496e8bdf63
>
> Signed-Off-By: Pavel Emelianov <xemul@openvz.org>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>
>
> Kirill
> --- a/include/linux/init_task.h
> +++ b/include/linux/init_task.h
> @@ -3,6 +3,7 @@
>  
>  #include <linux/file.h>
>  #include <linux/rcupdate.h>
> +#include <linux/utsname.h>
>  
>  #define INIT_FDTABLE \
>  {							\
> @@ -72,6 +73,12 @@
>  
>  extern struct group_info init_groups;
>  
> +#ifdef CONFIG_UTS_NS
> +#define INIT_UTS_NS	.uts_ns = &init_uts_ns,
> +#else
> +#define INIT_UTS_NS
> +#endif
> +
>  /*
>   *  INIT_TASK is used to set up the first task table, touch at
>   * your own risk!. Base=0, limit=0x1fffff (=2MB)
> @@ -121,6 +128,7 @@ extern struct group_info init_groups;
>  	.journal_info	= NULL,						\
>  	.cpu_timers	= INIT_CPU_TIMERS(tsk.cpu_timers),		\
>  	.fs_excl	= ATOMIC_INIT(0),				\
> +	INIT_UTS_NS							\
>  }
>  
>  
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -688,6 +688,7 @@ static inline void prefetch_stack(struct
>  
>  struct audit_context;		/* See audit.c */
>  struct mempolicy;
> +struct uts_namespace;
>  
>  struct task_struct {
>  	volatile long state;	/* -1 unrunnable, 0 runnable, >0 stopped */
> @@ -802,6 +803,9 @@ struct task_struct {
>  	struct files_struct *files;
>  /* namespace */
>  	struct namespace *namespace;
> +#ifdef CONFIG_UTS_NS
> +	struct uts_namespace *uts_ns;
> +#endif
>  /* signal handlers */
>  	struct signal_struct *signal;
>  	struct sighand_struct *sighand;
> --- a/include/linux/utsname.h
> +++ b/include/linux/utsname.h
> @@ -30,7 +30,36 @@ struct new_utsname {
>  	char domainname[65];
>  };
>  
> +#ifdef CONFIG_UTS_NS
> +#include <asm/atomic.h>
> +
> +struct uts_namespace {
> +	atomic_t cnt;
> +	struct new_utsname name;
> +};
> +
> +extern struct uts_namespace *create_uts_ns(void);
> +extern struct uts_namespace *clone_uts_ns(void);
> +extern void free_uts_ns(struct uts_namespace *ns);
> +
> +static inline void get_uts_ns(struct uts_namespace *ns)
> +{
> +	atomic_inc(&ns->cnt);
> +}
> +
> +static inline void put_uts_ns(struct uts_namespace *ns)
> +{
> +	if (atomic_dec_and_test(&ns->cnt))
> +		free_uts_ns(ns);
> +}
> +
> +#define system_utsname	(current->uts_ns->name)
> +extern struct uts_namespace init_uts_ns;
> +#else
> +#define get_uts_ns(ns)	do { } while (0)
> +#define put_uts_ns(ns)	do { } while (0)
>  extern struct new_utsname system_utsname;
> +#endif
>  
>  extern struct rw_semaphore uts_sem;
>  #endif
> --- a/init/version.c
> +++ b/init/version.c
> @@ -17,6 +17,51 @@
>  
>  int version_string(LINUX_VERSION_CODE);
>  
> +#ifdef CONFIG_UTS_NS
> +struct uts_namespace init_uts_ns = {
> +	.cnt = ATOMIC_INIT(1),
> +	.name = {
> +		.sysname	= UTS_SYSNAME,
> +		.nodename	= UTS_NODENAME,
> +		.release	= UTS_RELEASE,
> +		.version	= UTS_VERSION,
> +		.machine	= UTS_MACHINE,
> +		.domainname	= UTS_DOMAINNAME,
> +	},
> +};

> +struct uts_namespace *create_uts_ns(void)
> +{
> +	struct uts_namespace *ns;
> +
> +	ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
> +	if (ns == NULL)
> +		return NULL;
> +
> +	memset(&ns->name, 0, sizeof(ns->name));
> +	atomic_set(&ns->cnt, 1);
> +	return ns;
> +}

Setting name to 0.  Seems very wrong.

> +struct uts_namespace *clone_uts_ns(void)
> +{
> +	struct uts_namespace *ns, *cur;
> +
> +	ns = kmalloc(sizeof(struct uts_namespace), GFP_KERNEL);
> +	if (ns == NULL)
> +		return NULL;
> +
> +	cur = current->uts_ns;
> +	memcpy(&ns->name, &cur->name, sizeof(cur->name));
> +	atomic_set(&ns->cnt, 1);
> +	return ns;
> +}

Having both create_uts_ns and clone_uts_ns is redundant.

There is a reasonable argument for copying resetting
nodename and domainname to UTS_NODENAME, and UTS_DOMAINNAME,
when we create a new instance.  As we almost certainly do not
want to continue to use the old ones and we need some value
in there.  Plus some user space tools special case the default
UTS_NODENAME for setting the name from DHCP.

We can also do this from user space so it is not a huge deal
either way.  We certainly need to copy the other fields
and not initialize them from the defaults because there is
kernel initialization code that modifies the defaults.

> +void free_uts_ns(struct uts_namespace *ns)
> +{
> +	kfree(ns);
> +}
> +#else
>  struct new_utsname system_utsname = {
>  	.sysname	= UTS_SYSNAME,
>  	.nodename	= UTS_NODENAME,
> @@ -27,6 +72,7 @@ struct new_utsname system_utsname = {
>  };
>  
>  EXPORT_SYMBOL(system_utsname);
> +#endif

I am a little concerned about the maintenance issues with
placing having two identical initializers from system_utsname.

>  const char linux_banner[] =
>  	"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -107,6 +107,7 @@ repeat: 
>  	spin_unlock(&p->proc_lock);
>  	proc_pid_flush(proc_dentry);
>  	release_thread(p);
> +	put_uts_ns(p->uts_ns);
>  	put_task_struct(p);
>  
>  	p = leader;
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1192,6 +1192,7 @@ static task_t *copy_process(unsigned lon
>  	}
>  	attach_pid(p, PIDTYPE_TGID, p->tgid);
>  	attach_pid(p, PIDTYPE_PID, p->pid);
> +	get_uts_ns(p->uts_ns);
>  
>  	nr_threads++;
>  	total_forks++;

We don't need the tasklist_lock around get_uts_ns.
Please move it earlier.

> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -229,12 +229,18 @@ static ctl_table root_table[] = {
>  	{ .ctl_name = 0 }
>  };

Since we can disable CONFIG_SYSCTL we probably want to leave
this part for another patch.  Although incremental progress
is probably ok.
  
> +#ifdef CONFIG_UTS_NS
> +#define sysctl_system_utsname	(init_uts_ns.name)
> +#else
> +#define sysctl_system_utsname	(system_utsname)
> +#endif
> +
>  static ctl_table kern_table[] = {
>  	{
>  		.ctl_name	= KERN_OSTYPE,
>  		.procname	= "ostype",
> -		.data		= system_utsname.sysname,
> -		.maxlen		= sizeof(system_utsname.sysname),
> +		.data		= sysctl_system_utsname.sysname,
> +		.maxlen		= sizeof(sysctl_system_utsname.sysname),
>  		.mode		= 0444,
>  		.proc_handler	= &proc_doutsstring,
>  		.strategy	= &sysctl_string,
> @@ -242,8 +248,8 @@ static ctl_table kern_table[] = {
>  	{
>  		.ctl_name	= KERN_OSRELEASE,
>  		.procname	= "osrelease",
> -		.data		= system_utsname.release,
> -		.maxlen		= sizeof(system_utsname.release),
> +		.data		= sysctl_system_utsname.release,
> +		.maxlen		= sizeof(sysctl_system_utsname.release),
>  		.mode		= 0444,
>  		.proc_handler	= &proc_doutsstring,
>  		.strategy	= &sysctl_string,
> @@ -251,8 +257,8 @@ static ctl_table kern_table[] = {
>  	{
>  		.ctl_name	= KERN_VERSION,
>  		.procname	= "version",
> -		.data		= system_utsname.version,
> -		.maxlen		= sizeof(system_utsname.version),
> +		.data		= sysctl_system_utsname.version,
> +		.maxlen		= sizeof(sysctl_system_utsname.version),
>  		.mode		= 0444,
>  		.proc_handler	= &proc_doutsstring,
>  		.strategy	= &sysctl_string,
> @@ -260,8 +266,8 @@ static ctl_table kern_table[] = {
>  	{
>  		.ctl_name	= KERN_NODENAME,
>  		.procname	= "hostname",
> -		.data		= system_utsname.nodename,
> -		.maxlen		= sizeof(system_utsname.nodename),
> +		.data		= sysctl_system_utsname.nodename,
> +		.maxlen		= sizeof(sysctl_system_utsname.nodename),
>  		.mode		= 0644,
>  		.proc_handler	= &proc_doutsstring,
>  		.strategy	= &sysctl_string,
> @@ -269,8 +275,8 @@ static ctl_table kern_table[] = {
>  	{
>  		.ctl_name	= KERN_DOMAINNAME,
>  		.procname	= "domainname",
> -		.data		= system_utsname.domainname,
> -		.maxlen		= sizeof(system_utsname.domainname),
> +		.data		= sysctl_system_utsname.domainname,
> +		.maxlen		= sizeof(sysctl_system_utsname.domainname),
>  		.mode		= 0644,
>  		.proc_handler	= &proc_doutsstring,
>  		.strategy	= &sysctl_string,

^ permalink raw reply

* Re: [BLOCK] delay all uevents until partition table is scanned
From: Randy.Dunlap @ 2006-03-24 19:35 UTC (permalink / raw)
  To: Kay Sievers; +Cc: linux-kernel, greg, viro
In-Reply-To: <20060324191748.GA13654@vrfy.org>

On Fri, 24 Mar 2006 20:17:48 +0100 Kay Sievers wrote:

> From: Kay Sievers <kay.sievers@suse.de>
> 
> [BLOCK] delay all uevents until partition table is scanned
> 
> +	/* scan partition table, but supress uevents */
> +	disk->part_uevent_supress = 1;
> +	err = blkdev_get(bdev, FMODE_READ, 0);
> +	disk->part_uevent_supress = 0;

s/supress/suppress/ please.

> diff --git a/include/linux/genhd.h b/include/linux/genhd.h
> index eef5ccd..089bb01 100644
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -104,6 +104,7 @@ struct gendisk {
>                                           * disks that can't be partitioned. */
>  	char disk_name[32];		/* name of major driver */
>  	struct hd_struct **part;	/* [indexed by minor] */
> +	int part_uevent_supress;


---
~Randy

^ permalink raw reply

* Re: [PATCH][5/8] proc: export mlocked pages info through "/proc/meminfo: Wired"
From: Nick Piggin @ 2006-03-24 18:25 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Stone Wang, akpm, linux-kernel, linux-mm
In-Reply-To: <Pine.LNX.4.63.0603241319130.30426@cuia.boston.redhat.com>

Rik van Riel wrote:
> On Sat, 25 Mar 2006, Nick Piggin wrote:
> 
>>Rik van Riel wrote:
>>
>>>On Wed, 22 Mar 2006, Nick Piggin wrote:
>>>
>>>
>>>>Why would you want to ever do something like that though? I don't think
>>>>you should use this name "just in case", unless you have some really good
>>>>potential usage in mind.
>>>
>>>ramfs
>>
>>Why would ramfs want its pages in this wired list? (I'm not so
>>familiar with it but I can't think of a reason).
> 
> 
> Because ramfs pages cannot be paged out, which makes them locked
> into memory the same way mlocked pages are.
> 

I don't understand why they need to be on any list though,
that isn't an internal ramfs specific structure (ie. not
the just-in-case wired list).

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

^ permalink raw reply

* Re: [Ext2-devel] [RFC] [PATCH] Reducing average ext2 fsck time through fs-wide dirty bit]
From: Andreas Dilger @ 2006-03-24 19:31 UTC (permalink / raw)
  To: Mingming Cao
  Cc: Andrew Morton, Valerie Henson, pbadari, linux-kernel, Ext2-devel,
	arjan, tytso, zach.brown
In-Reply-To: <1143227599.4561.139.camel@localhost.localdomain>

On Mar 24, 2006  11:13 -0800, Mingming Cao wrote:
> There are reasons for zeroing indirect blocks on truncate: 
> 
>       * There are limits to the size of a single journal transaction
>         (1/4 of the journal size). When truncating a large fragmented
>         file, it may require modifying so many block bitmaps and group
>         descriptors that it forces a journal transaction to close out,
>         stalling the unlink operation.
>       * Because of this per-transaction limit, truncate needs to zero
>         the [dt]indirect blocks starting from the end of the file, in
>         case it needs to start a new transaction in the middle of the
>         truncate (ext3 guarantees that a partially-completed truncate
>         will be consistent/completed after a crash).
>       * The read/write of the file's [dt]indirect blocks from the end of
>         the file to the beginning can take a lot of time, as it does
>         this in single-block chunks and the blocks are not contiguous.

See my recent post on how this performance problem could be fixed.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


^ permalink raw reply

* Re: [PATCH] Clean up magic numbers in i2c_parport.h
From: Jean Delvare @ 2006-03-24 19:31 UTC (permalink / raw)
  To: Greg KH, Christopher Hoover
  Cc: Andrew Morton, kernel-janitors, linux-kernel, lm-sensors
In-Reply-To: <20060324174901.GA27881@kroah.com>

Hi Greg, Christpher,

> > I don't think C99 initializers are needed here, the structure is pretty
> > simple and is also defined in the same file, a few lines above all its
> > instance declarations. So I am indeed asking for a patch w/o macros and
> > w/o C99 structure initializers, unless someone objects.
> 
> You should use structure initializers whereever possible, as it makes
> future changes much easier and safer (reorder the fields and things
> don't break in odd ways.)  So I would encourage this kind of change.

Oh well, if Greg says so...

Christopher, can you please respin a patch with C99 initializers, which
would look a bit better than your original one? I'd suggest a single,
straightforward macro (no needless underscores please):

#define LINEOP(val, port, inverted) \
    { .val = (val), .port = (port), .inverted = (inverted) }

Hopefully this will keep all lines within a reasonable length and won't
hurt the readability too much.

Also, I just noticed in your original patch: please preserve the comma
at the end of the last line of struct declarations. It's not needed,
sure, but it makes later changes easier.

Thanks,
-- 
Jean Delvare

^ permalink raw reply

* For hire, C programming with Linux and kernel experience
From: Jonathan @ 2006-03-24 19:29 UTC (permalink / raw)
  To: linux-kernel

Title: Senior Linux Developer
Location: Home
Pay: Negotiable
Placement: Full-time
 
Developed a network based server threaded/fork content
handling service daemon?

Good vision in writing structured code?

Follow professional coding standards and formality?

Have a sharp mind in pointing out software bugs and
design errors in your OWN code?
 
Project entails working on ARM922T CPU embedded linux
machine.
 
e-mail pandaboy10@yahoo.com you're resume along with 3
code samples and salary offer.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply

* Re: [Ext2-devel] [RFC] [PATCH] Reducing average ext2 fsck time through fs-wide dirty bit]
From: Andreas Dilger @ 2006-03-24 19:28 UTC (permalink / raw)
  To: Valerie Henson
  Cc: Andrew Morton, pbadari, linux-kernel, Ext2-devel, arjan, tytso,
	zach.brown
In-Reply-To: <20060324143239.GB14508@goober>

On Mar 24, 2006  06:32 -0800, Valerie Henson wrote:
> However, half the reason
> I'm working on ext2 is the simplicity of the code - stubbing it out
> would solve the performance problem but not the complexity problem.

But by the same token, adding the ext3 reservation code to ext2 isn't
doing anything to improve the simplicity of the ext2 code.  That is
one reason why we've frowned upon adding any features to ext2, except
critical disk-format compatibility ones.

> Note that ext3's habit of clearing indirect blocks on truncate would
> break some things I want to do in the future. (Insert secret plans
> here.)

Ah, this is a long-standing ext3 wart that I've wanted to fix.  In the
vast majority of cases (especially when there is a large journal in use)
it is possible to do the truncate in a single transaction.  The only issue
is figuring out how big the transaction should be.

The good news, is that fixing the "ext3 clearing indirect blocks" problem
not only allows undelete to work again, but also improves truncate
performance because (a) we only modify 1/32 of the blocks we would in the
old case (we don't need to modify any {d,t,}indirect blocks), (b) we do
indirect block walking in forward direction, and could submit {d,}indirect
block requests in a batch instead of one-at-a-time.

Fix for this problem (inode is locked already):
- create a modified ext3_free_branches() to do tree walking and call a
  method instead of always calling ext3_free_data->ext3_clear_blocks
- walk inode {d,t,}indirect blocks in forward direction, count bitmaps and
  groups that will be modified (essentially NULL ext3_free_branches method)
- try to start a journal handle for this many blocks + 1 (inode) +
  1 (super) + quota + EXT3_RESERVE_TRANS_BLOCKS
  - if journal handle is too large (journal_start() returns -ENOSPC) fall
    back to old zero-in-steps method (vast majority of cases will be OK
    because number of modified blocks is much fewer)
- walk inode {d,t,}indirect blocks again deleting blocks via
  ext3_free_blocks_sb() (updates group descriptor, bitmaps, quota), but
  not journaling or modifying the indirect blocks
- update i_size/i_disksize/i_blocks to new value, like ext2
- close transaction

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


^ permalink raw reply

* Re: [RFC] Virtualization steps
From: Dave Hansen @ 2006-03-24 19:25 UTC (permalink / raw)
  To: Nick Piggin
  Cc: Kirill Korotaev, Eric W. Biederman, linux-kernel, herbert, devel,
	serue, akpm, sam, Alexey Kuznetsov, Pavel Emelianov,
	Stanislav Protassov
In-Reply-To: <44242D4D.40702@yahoo.com.au>

On Sat, 2006-03-25 at 04:33 +1100, Nick Piggin wrote:
> Oh, after you come to an agreement and start posting patches, can you
> also outline why we want this in the kernel (what it does that low
> level virtualization doesn't, etc, etc) 

Can you wait for an OLS paper? ;)

I'll summarize it this way: low-level virtualization uses resource
inefficiently.

With this higher-level stuff, you get to share all of the Linux caching,
and can do things like sharing libraries pretty naturally.

They are also much lighter-weight to create and destroy than full
virtual machines.  We were planning on doing some performance
comparisons versus some hypervisors like Xen and the ppc64 one to show
scaling with the number of virtualized instances.  Creating 100 of these
Linux containers is as easy as a couple of shell scripts, but we still
can't find anybody crazy enough to go create 100 Xen VMs.

Anyway, those are the things that came to my mind first.  I'm sure the
others involved have their own motivations.

-- Dave


^ permalink raw reply

* Re: [RFC] Virtualization steps
From: Eric W. Biederman @ 2006-03-24 18:36 UTC (permalink / raw)
  To: Kirill Korotaev
  Cc: haveblue, linux-kernel, herbert, devel, serue, akpm, sam,
	Alexey Kuznetsov, Pavel Emelianov, Stanislav Protassov
In-Reply-To: <44242A3F.1010307@sw.ru>

Kirill Korotaev <dev@sw.ru> writes:

> Eric, Herbert,
>
> I think it is quite clear, that without some agreement on all these
> virtualization issues, we won't be able to commit anything good to
> mainstream. My idea is to gather our efforts to get consensus on most clean
> parts of code first and commit them one by one.
>
> The proposal is quite simple. We have 4 parties in this conversation (maybe
> more?): IBM guys, OpenVZ, VServer and Eric Biederman. We discuss the areas which
> should be considered step by step. Send patches for each area, discuss, come to
> some agreement and all 4 parties Sign-Off the patch. After that it goes to
> Andrew/Linus. Worth trying?

Yes, this sounds like a path forward that has a reasonable chance of
making progress.

> So far, (correct me if I'm wrong) we concluded that some people don't want
> containers as a whole, but want some subsystem namespaces. I suppose for people
> who care about containers only it doesn't matter, so we can proceed with
> namespaces, yeah?

Yes, I think at one point I have seen all of the major parties receptive
to the concept.

> So the most easy namespaces to discuss I see:
> - utsname
> - sys IPC
> - network virtualization
> - netfilter virtualization

The networking is hard simply because the is so very much of it, and it
is being active developed :)

> all these were discussed already somehow and looks like there is no fundamental
> differencies in our approaches (at least OpenVZ and Eric, for sure).

Yes.  I think we agree on what the semantics should be for these parts.
Which should avoid the problem with have with the pid namespace.

> Right now, I suggest to concentrate on first 2 namespaces - utsname and
> sysvipc. They are small enough and easy. Lets consider them without sysctl/proc
> issues, as those can be resolved later. I sent the patches for these 2
> namespaces to all of you. I really hope for some _good_ critics, so we could
> work it out quickly.

Sounds like a plan.

Eric

^ permalink raw reply

* Re: [RFC PATCH 35/35] Add Xen virtual block device driver.
From: Dave C Boutcher @ 2006-03-24 19:19 UTC (permalink / raw)
  To: Mike Christie
  Cc: Dave C Boutcher, Jeff Garzik, Arjan van de Ven, Alan Cox,
	Ian Pratt, Anthony Liguori, Chris Wright, virtualization,
	xen-devel, linux-kernel, Ian Pratt, ian.pratt, SCSI Mailing List
In-Reply-To: <442442CB.4090603@cs.wisc.edu>


Mike Christie wrote:
> Does the IBM vscsi code/SPEC follow the SRP SPEC or is it slightly 
> modified? We also have a SRP initiator in kernel now too. It is just not 
> in the drivers/scsi dir.

The goal was to follow the SRP spec 100%.  We added one other optional
command set (different protocol identifier than SRP) to exchange some
information like "who is at the other end", but the intent was that
the SRP part was right from the spec.

I think, since we implemented this in three operating systems (Linux,
AIX, and OS/400) using the T10 spec as the reference that we are probably
pretty close.

And yeah, I'm aware that there is another SRP implementation in the
kernel...Merging would be good...

Dave B

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox