Re: why is only kernel preemption disabled

2010-08-19 Thread Michael Blizek
Hi! On 20:53 Wed 18 Aug , Daniel Baluta wrote: Hello, On Wed, Aug 18, 2010 at 8:07 PM, Parmenides mobile.parmeni...@gmail.com wrote: Hi, For a critical section protected by a spin lock, kernel preemption is disabled explicitly, probably to make the critical section atomic

Re: why is only kernel preemption disabled

2010-08-19 Thread Michael Blizek
Hi! On 01:07 Thu 19 Aug , Parmenides wrote: Hi, For a critical section protected by a spin lock, kernel preemption is disabled explicitly, probably to make the critical section atomic. But, suppose that an interrupt occures in this critical section, allowing interrupts can wreck

why is only kernel preemption disabled

2010-08-18 Thread Parmenides
Hi, For a critical section protected by a spin lock, kernel preemption is disabled explicitly, probably to make the critical section atomic. But, suppose that an interrupt occures in this critical section, allowing interrupts can wreck the atomicity. So, why don't we disable interrupts

Re: why is only kernel preemption disabled

2010-08-18 Thread Daniel Baluta
Hello, On Wed, Aug 18, 2010 at 8:07 PM, Parmenides mobile.parmeni...@gmail.com wrote: Hi, For a critical section protected by a spin lock, kernel preemption is disabled explicitly, probably to make the critical section atomic. But, suppose that an interrupt occures in this critical section

preemption disable in spin_lock

2010-01-17 Thread Joel Fernandes
Why is preemption disabled before a lock is acquired in _spin_lock function? As the critical region of code which is to be protected by the spin lock executes only after the lock is acquired, why is disabling of preemption required before the lock is acquired? Wouldn't it better if the kernel

Re: preemption disable in spin_lock

2010-01-17 Thread Joel Fernandes
...@gmail.com wrote: Why is preemption disabled before a lock is acquired in _spin_lock function? As the critical region of code which is to be protected by the spin lock executes only after the lock is acquired, why is disabling of preemption required before the lock is acquired? Wouldn't

Re: preemption disable in spin_lock

2010-01-17 Thread Mulyadi Santosa
Hi Joel... On Sun, Jan 17, 2010 at 9:34 PM, Joel Fernandes agnel.j...@gmail.com wrote: Why is preemption disabled before a lock is acquired in _spin_lock function? As the critical region of code which is to be protected by the spin lock executes only after the lock is acquired, why

Re: preemption disable in spin_lock

2010-01-17 Thread Peter Teoh
On Sun, Jan 17, 2010 at 10:34 PM, Joel Fernandes agnel.j...@gmail.com wrote: Why is preemption disabled before a lock is acquired in _spin_lock function? theoretically, if your interrupt handling codes is sharing some data with your kernel codes, then assuming u have one CPU, it is possible

Re: Question about kernel preemption

2009-08-14 Thread Mulyadi Santosa
and where kernel preemption is *triggered*. Please correct me if I did misunderstand anything. It is triggered by the timer interrupt. This is an interrupt which fires periodically on configureable intervals. It does not only preempt the kernel, but user space processes as well. If it fires

Re: Question about kernel preemption

2009-08-14 Thread Mohammed Gamal
and when the kernel *can* get preempted, however what I really want to know is when and where kernel preemption is *triggered*. Please correct me if I did misunderstand anything. It is triggered by the timer interrupt. This is an interrupt which fires periodically on configureable intervals

Re: Question about kernel preemption

2009-08-14 Thread Greg Freemyer
Gamal wrote: ... As far as I understood, Michi's answer explains why and when the kernel *can* get preempted, however what I really want to know is when and where kernel preemption is *triggered*. Please correct me if I did misunderstand anything. It is triggered by the timer interrupt

Re: Question about kernel preemption

2009-08-14 Thread Mohammed Gamal
...@michaelblizek.twilightparadox.com wrote: Hi! On 00:08 Fri 14 Aug     , Mohammed Gamal wrote: ... As far as I understood, Michi's answer explains why and when the kernel *can* get preempted, however what I really want to know is when and where kernel preemption is *triggered*. Please correct me

Question about kernel preemption

2009-08-13 Thread Mohammed Gamal
Hi All, I know that kernel preemption exists in order to allow high-priority processes to interrupt the kernel if the kernel executes on relatively long code paths in order to improve latency times and process responsiveness. However, I am curious to know when and where the kernel gets preempted

Re: Question about kernel preemption

2009-08-13 Thread Michael Blizek
Hi! On 15:59 Thu 13 Aug , Mohammed Gamal wrote: Hi All, I know that kernel preemption exists in order to allow high-priority processes to interrupt the kernel if the kernel executes on relatively long code paths in order to improve latency times and process responsiveness. Not only high

Re: Question about kernel preemption

2009-08-13 Thread Microbit_Ubuntu
Hi Mohammed, On Thu, 2009-08-13 at 15:59 +0300, Mohammed Gamal wrote: Hi All, I know that kernel preemption exists in order to allow high-priority processes to interrupt the kernel if the kernel executes on relatively long code paths in order to improve latency times and process

Re: Question about kernel preemption

2009-08-13 Thread Mohammed Gamal
On Thu, Aug 13, 2009 at 11:02 PM, Microbit_Ubuntumicro...@virginbroadband.com.au wrote: Hi Mohammed, On Thu, 2009-08-13 at 15:59 +0300, Mohammed Gamal wrote: Hi All, I know that kernel preemption exists in order to allow high-priority processes to interrupt the kernel if the kernel executes

Re: Question about kernel preemption

2009-08-13 Thread Michael Blizek
Hi! On 00:08 Fri 14 Aug , Mohammed Gamal wrote: ... As far as I understood, Michi's answer explains why and when the kernel *can* get preempted, however what I really want to know is when and where kernel preemption is *triggered*. Please correct me if I did misunderstand anything

Re: preemption

2009-07-31 Thread er krishna
:32 *To:* kernelnewbies@nl.linux.org *Subject:* preemption Dear All, I have some confusion about preemption. Can anybody please clear my query : 1) If there are two process running in kernel space one of them has a lock its preempt_count value is +ve , can the other process preempt

Re: preemption

2009-07-31 Thread Chetan Nanda
a process of lower priority. If pre-empt_count is +ve means that i can be pre-empted then you are right. If a lower process has taken a lock its preempt_count value is +ve , can it be preempted by higher priority process ? positive value of preempt_count means that kernel preemption

Re: preemption

2009-07-31 Thread SandeepKsinha
priority process ? positive value of preempt_count means that kernel preemption is disabled, in that case even high priority process will not be able to preempt low priority process, people please CMIIW This is correct. A positive value disables preemption. From: kernelnewbies-bou

preemption

2009-07-30 Thread er krishna
Dear All, I have some confusion about preemption. Can anybody please clear my query : 1) If there are two process running in kernel space one of them has a lock its preempt_count value is +ve , can the other process preempt it ? If it preempt the first process ( which is in running state

Re: preemption

2009-07-30 Thread debian developer
On Thu, Jul 30, 2009 at 2:31 PM, er krishnaerkris...@gmail.com wrote: Dear All, I have some confusion about preemption. Can anybody please clear my query : 1) If there are two process running in kernel space one of them has a lock its preempt_count value is +ve , can the other process

Re: preemption

2009-07-30 Thread er krishna
that process; even if any process higher than that comes. On Thu, Jul 30, 2009 at 2:31 PM, er krishna erkris...@gmail.com wrote: Dear All, I have some confusion about preemption. Can anybody please clear my query : 1) If there are two process running in kernel space one of them has a lock its

Re: preemption

2009-07-30 Thread debian developer
On Thu, Jul 30, 2009 at 2:31 PM, er krishnaerkris...@gmail.com wrote: Dear All, I have some confusion about preemption. Can anybody please clear my query : 1) If there are two process running in kernel space one of them has a lock its preempt_count value is +ve , can the other process

RE: preemption

2009-06-25 Thread Kostya B
Mulyadi, thank you for the detailed explanation. Thus (a) is a source for interrupt latency and (b) actually fixes it. -- Kostya Date: Thu, 25 Jun 2009 02:26:25 +0700 Subject: Re: preemption From: mulyadi.sant...@gmail.com To: bkos...@hotmail.com

Re: preemption

2009-06-25 Thread Mulyadi Santosa
Subject: Re: preemption From: mulyadi.sant...@gmail.com To: bkos...@hotmail.com CC: kernelnewbies@nl.linux.org Hi... 2009/6/24 Kostya B :  Dear list,  Please help me to analyze the following scenario:  By having a userspace process 'A' executing a system call.  Hardware interrupt

preemption

2009-06-24 Thread Kostya B
Dear list, Please help me to analyze the following scenario: By having a userspace process 'A' executing a system call. Hardware interrupt happens. Do you think on exit from interrupt (irq_exit) the context switch could take place? Let's assume no softirq work is pending. (a) kernel

Re: preemption

2009-06-24 Thread Mulyadi Santosa
it could, depending on the preemption model you pick...see below Let's assume no softirq work is pending.  (a) kernel is not preemptive then it would stay in the current kernel code path, which is executing the syscall on behalf of running task.  (b) kernel is preemptive What I am quite

RE: About Kernel preemption and kernel mode stack

2009-03-07 Thread Microbit_P43000
PM To: micro...@virginbroadband.com.au Cc: Kernelnewbies Subject: Re: About Kernel preemption and kernel mode stack Hi! On 12:15 Fri 06 Mar , micro...@virginbroadband.com.au wrote: ... In this case it's common to use co-operative scheduling. This means that when a task does not need further

Re: About Kernel preemption and kernel mode stack

2009-03-05 Thread Michael Blizek
Hi! On 13:00 Thu 05 Mar , Pranav Peshwe wrote: On Thu, Mar 5, 2009 at 11:48 AM, Michael Blizek mic...@michaelblizek.twilightparadox.com wrote: Hi! On 23:47 Wed 04 Mar , sahlot arvind wrote: Hi All, ... 2. If kernel is not preemptible then do we really need a separate

Re: About Kernel preemption and kernel mode stack

2009-03-05 Thread Shinu
2009/3/6 micro...@virginbroadband.com.au Anyway in any case how does shell get the 'd' or anything from the keyboard? What are the exact steps? I'm a Linux kernel newbie, (although I have heavy embedded MCU coding background) but I can help with the general approach of this scenario.

Re: About Kernel preemption and kernel mode stack

2009-03-05 Thread Michael Blizek
Hi! On 12:15 Fri 06 Mar , micro...@virginbroadband.com.au wrote: ... In this case it's common to use co-operative scheduling. This means that when a task does not need further execution, it must relinquish control back to the scheduler. I personally find this a real pig to program like

Re: About Kernel preemption and kernel mode stack

2009-03-04 Thread Pranav Peshwe
On Thu, Mar 5, 2009 at 11:48 AM, Michael Blizek mic...@michaelblizek.twilightparadox.com wrote: Hi! On 23:47 Wed 04 Mar , sahlot arvind wrote: Hi All, Just had couple of questions: 1. kernel is preemptible if we are running in kernel mode and not holding any lock. What if we

Re: kernel preemption does not work

2008-04-11 Thread Peter Teoh
On Thu, Apr 10, 2008 at 3:32 PM, bhanu nani [EMAIL PROTECTED] wrote: Hi all, I am trying to test kernel preemption in my driver. When I first compiled the Linux kernel and tested it, I found it to be non-preemptible. Later I realised that my kernel was build with premption disabled. I

Re: kernel preemption does not work

2008-04-11 Thread bhanu nani
not preempt the kernel process and give back the control to terminal prompt. The kernel only gives control back after the delay is complete. I was thinking CTRL+C should generate a preemption signal to kernel. If not, I would like to know what are those signals that can trigger a preemption in kernel mode

Re: kernel preemption does not work

2008-04-11 Thread Patrick McManus
a preemption signal to kernel. If not, I would like to know what are those signals that can trigger a preemption in kernel mode. preemption means that process a running kernel code can be interrupted at more or less any time for some higher priority process b. when process a eventually runs

Re: kernel preemption does not work

2008-04-11 Thread Mulyadi Santosa
was thinking CTRL+C should generate a preemption signal to kernel. If not, I would like to know what are those signals that can trigger a preemption in kernel mode. OK, I think I know. mdelay() is busy looping, thus your code path force you to stay in kernel space for that period. Combined

kernel preemption does not work

2008-04-10 Thread bhanu nani
Hi all, I am trying to test kernel preemption in my driver. When I first compiled the Linux kernel and tested it, I found it to be non-preemptible. Later I realised that my kernel was build with premption disabled. I enabled kernel premption in processort section i.e. CONFIG_PREEMPT and rebuild

RE: kernel preemption does not work

2008-04-10 Thread Rajat Jain
Hi, Test code: -- read() { if(down_interruptible()) return error; mdelay(1); up(); } With this code in place, I try to do a 'CTRL+C' when it hangs at that delay. It does not respond to my 'CTRL + C'. Where am I missing the preemption thing

Re: kernel preemption does not work

2008-04-10 Thread Mulyadi Santosa
Hi... On Thu, Apr 10, 2008 at 2:32 PM, bhanu nani [EMAIL PROTECTED] wrote: Hi all, I am trying to test kernel preemption in my driver. When I first compiled the Linux kernel and tested it, I found it to be non-preemptible. Later I realised that my kernel was build with premption

preempt_disable() - disables preemption on all processors?

2007-09-28 Thread Rajat Jain
Hi list, Does the preempt_disable() disable preemption on all the processors or just the current processor? Thanks, Rajat -- To unsubscribe from this list: send an email with unsubscribe kernelnewbies to [EMAIL PROTECTED] Please read the FAQ at http://kernelnewbies.org/FAQ

Re: preempt_disable() - disables preemption on all processors?

2007-09-28 Thread Ricardo Maraschini
And the get_cpu() ? Its not supposed to disable preemption in all cpus? from include/linux/smp.h: #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) rjm; On 9/28/07, Mulyadi Santosa [EMAIL PROTECTED] wrote: HI... Does the preempt_disable() disable preemption on all