2.4.10pre7aa1
Hi Christoph,
Quoted 2 lines · In article <[email protected]> you wrote:
Hmm, I don't see why latency is important for rcu - we only want to free datastructures.. (mm load?).
While it is not important for RCU to do the updates quickly, it is still necessary that updates are not completely starved out by high-priority tasks. So, the idea behind using high-priority krcuds is to ensure that they don't get starved thereby delaying updates for unreasonably long periods of time which could lead to memory pressure or other performance problems depending on how RCU is being used.
Quoted 11 lines
On the other hands they are the experts on RCU, not I so I'll believe them.
Quoted 3 lines
So in short if you really are in pain for 8k per cpu to get the best runtime behaviour and cleaner code I'd at least suggest to use the ksoftirqd way that should be the next best step.
My problem with this appropech is just that we use kernel threads for more and more stuff - always creating new ones. I think at some point they will sum up badly.
Christoph
I agree that it is not always a good idea to use kernel threads for everything, but in this case this seems to be the safest and most reasonable option.
FYI, there are a couple of other implementations, but they all affect code in fast paths even if there is no RCU going on in the system. One of them is from Rusty that keeps track of CPUs going through quiescent state from the scheduler context and also executes the callbacks from the scheduler context. The other patch is based on our old DYNIX/ptx implementation - it uses one per-cpu context switch counter to detect quiescent state and checks for completion of RCU in local timer interrupt handler. Once all the CPUs go through a quiescent state, the callbacks are processed using a tasklet.
Thanks
Dipankar
Signature · 2 lines
Dipankar Sarma <[email protected]> Project: http://lse.sourceforge.net Linux Technology Center, IBM Software Lab, Bangalore, India.
Quoted 7 lines · Dipankar Sarma
Hi Christoph,
Quoted 2 lines · In article <[email protected]> you wrote:
Hmm, I don't see why latency is important for rcu - we only want to free datastructures.. (mm load?).
Quoted 7 lines
While it is not important for RCU to do the updates quickly, it is still necessary that updates are not completely starved out by high-priority tasks. So, the idea behind using high-priority krcuds is to ensure that they don't get starved thereby delaying updates for unreasonably long periods of time which could lead to memory pressure or other performance problems depending on how RCU is being used.
good point.
Quoted 3 lines
I agree that it is not always a good idea to use kernel threads for everything, but in this case this seems to be the safest and most reasonable option.
pretty much agreed.
BTW, I fixed a few more issues in the rcu patch (grep for down_interruptible for instance), here an updated patch (will be included in 2.4.10pre8aa1 [or later -aa]) with the name of rcu-2.
include/linux/rcupdate.h +48 -0
@@ -0,0 +1,48 @@ +/* +* Read-Copy Update mechanism for Linux +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +* For detailed explanation of Read-Copy Update mechanism see - +* http://lse.sourceforge.net/locking/rcupdate.html +* +*/ + +#ifndef _LINUX_RCUPDATE_H +#define _LINUX_RCUPDATE_H + +#include <linux/malloc.h> +#include <linux/vmalloc.h> +#include <linux/cache.h> +#include <asm/semaphore.h> + +struct rcu_data { +struct task_struct *krcud_task; +struct semaphore krcud_sema; +}____cacheline_aligned_in_smp ; + +#define krcud_task (cpu) rcu_data[(cpu)].krcud_task +#define krcud_sema (cpu) rcu_data[(cpu)].krcud_sema + +struct rcu_head +{ +struct list_head list; +void (*func)(void * arg); +void * arg; +}; + +extern void call_rcu (struct rcu_head * head,void (*func)(void * arg),void * arg); + +#endif
kernel/Makefile +2 -2
@@ -9,12 +9,12 @@ O_TARGET := kernel.o -export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o +export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o rcupdate.o obj-y = sched.o dma.o fork.o exec_domain.o panic.o printk.o \ module.o exit.o itimer.o info.o time.o softirq.o resource.o \ sysctl.o acct.o capability.o ptrace.o timer.o user.o \ - signal.o sys.o kmod.o context.o + signal.o sys.o kmod.o context.o rcupdate.o obj-$(CONFIG_UID16) += uid16.o obj-$(CONFIG_MODULES) += ksyms.o
kernel/rcupdate.c +165 -0
165 lines not on this page · raw message
Andrea
Quoted 3 lines
BTW, I fixed a few more issues in the rcu patch (grep for
down_interruptiblefor instance), here an updated patch (will be included in 2.4.10pre8aa1 [or later -aa]) with the name of rcu-2.
I've been made aware of one other isue with the RCU patch US Patent #05442758
In the absence of an actual real signed header paper patent use grant for GPL usage from the Sequent folks that seems to be rather hard to fix.
Alan
Quoted 9 lines · Alan Cox
Quoted 3 lines
BTW, I fixed a few more issues in the rcu patch (grep for
down_interruptiblefor instance), here an updated patch (will be included in 2.4.10pre8aa1 [or later -aa]) with the name of rcu-2.I've been made aware of one other isue with the RCU patch US Patent #05442758
In the absence of an actual real signed header paper patent use grant for GPL usage from the Sequent folks that seems to be rather hard to fix.
many thanks for the info. Since I live in Italy I should be safe to use it and to contribute the developement until Sequent/IBM fixes the legal problem. As far I can tell it's quite obviously just a theorical problem but it was very worth noticing.
Andrea