f



Synchronizing user space threads with kernel space in linux

I want to synchronize a user space thread to an external event that
generates an interrupt. I thought of using the following approach: the
ISR that treats the interrupt does a quick processing (such as data
capture and buffering) and then sends data to the user space thread
through a message queue or signals to the thread waiting on a
semaphore and it gets the buffered data from shared memory or some
similar mechanism. So far I haven't succeded in finding a way to do
it. I've tryed to write a module which uses semaphores (<linux/sem.h>)
but aparently there is no way to use SysV IPC primitives in kernel
modules.

I would appreciate having hints on how to do it or pointers to
documentation and example code if available.

Thank you very much in advance for your help.

Elder.
0
ih8sp4m (52)
4/29/2004 11:54:39 AM
comp.arch.embedded 20047 articles. 1 followers. Post Follow

17 Replies
691 Views

Similar Articles

[PageSpeed] 16

Mad@Spammers wrote:
> I want to synchronize a user space thread to an external event that
> generates an interrupt. I thought of using the following approach: the
> ISR that treats the interrupt does a quick processing (such as data
> capture and buffering) and then sends data to the user space thread
> through a message queue or signals to the thread waiting on a
> semaphore and it gets the buffered data from shared memory or some
> similar mechanism. So far I haven't succeded in finding a way to do
> it. I've tryed to write a module which uses semaphores (<linux/sem.h>)
> but aparently there is no way to use SysV IPC primitives in kernel
> modules.
> 
> I would appreciate having hints on how to do it or pointers to
> documentation and example code if available.
> 
> Thank you very much in advance for your help.
> 
> Elder.

A user-space signal is the equivalent of an interrupt.
When user-space drivers are involved, I like to use
"send_sig_info()" to send a signal to the user-space
task to indicate changes in the state of the driver.

I like to model the user/kernel space interface to
look like a hardware device in terms of interrupt/signal
handling, with ioctl's to acknowledge/enable/disable
signals/interrupts from the driver. However, I'm an
embedded type that is used to that kind of thing ;-)

Getting the data to/from kernel space is another
issue, typically done by the read/write driver
interface, or by using mmap().

-- 
Michael N. Moran           (h) 770 516 7918
5009 Old Field Ct.         (c) 678 521 5460
Kennesaw, GA, USA 30144    http://mnmoran.org

"... abstractions save us time working, but they don't
  save us time learning."
Joel Spolsky, The Law of Leaky Abstractions

The Beatles were wrong: 1 & 1 & 1 is 1

0
mike91 (133)
4/29/2004 12:41:55 PM
On 29 Apr 2004, Mad@Spammers wrote:

> I want to synchronize a user space thread to an external event that
> generates an interrupt. 

Maybe the ongoing work about D-Bus can give you inspiration:
  <http://freedesktop.org/Software/dbus>
One of its motivations was/is exactly to be able to do more driver stuff in
user space, and I got the impression that that was what you are looking
for...

Herman
-- 
  K.U.Leuven, Mechanical Eng.,  Mechatronics & Robotics Research Group
    <http://people.mech.kuleuven.ac.be/~bruyninc> Tel: +32 16 322480

0
4/29/2004 1:45:56 PM
Michael N. Moran wrote:
>> I want to synchronize a user space thread to an external event that
>> generates an interrupt. I thought of using the following approach: the
>> ISR that treats the interrupt does a quick processing (such as data
>> capture and buffering) and then sends data to the user space thread
>> through a message queue or signals to the thread waiting on a
>> semaphore and it gets the buffered data from shared memory or some
>> similar mechanism. So far I haven't succeded in finding a way to do
>> it. I've tryed to write a module which uses semaphores (<linux/sem.h>)
>> but aparently there is no way to use SysV IPC primitives in kernel
>> modules.
> 
> A user-space signal is the equivalent of an interrupt.
> When user-space drivers are involved, I like to use
> "send_sig_info()" to send a signal to the user-space
> task to indicate changes in the state of the driver. ...
> 
> Getting the data to/from kernel space is another
> issue, typically done by the read/write driver
> interface, or by using mmap().

What kind of time resolution do you need?

One other option is to use netlink sockets.  They're
pretty easy.  One drawback is netlink socket addresses
are somewhat precious, a little like signal numbers.

- Dan
0
dank-news (24)
4/29/2004 4:11:10 PM
Hello Elder,

> I want to synchronize a user space thread to an external event that
> generates an interrupt. I thought of using the following approach: the
> ISR that treats the interrupt does a quick processing (such as data
> capture and buffering) and then sends data to the user space thread

- Let your driver register a character interface
- from your user space thread, do a synchronous read.
- in your interrupt routine, copy the data and wakeup the
  waiting thread.

Very common situation. Works without any problem for me.

best regards

Wolfgang M�es





0
4/29/2004 5:32:08 PM
Wolfgang M�es wrote:

> Hello Elder,
> 
>> I want to synchronize a user space thread to an external event that
>> generates an interrupt. I thought of using the following approach: the
>> ISR that treats the interrupt does a quick processing (such as data
>> capture and buffering) and then sends data to the user space thread
> 
> - Let your driver register a character interface
> - from your user space thread, do a synchronous read.
> - in your interrupt routine, copy the data and wakeup the
>   waiting thread.
> 
> Very common situation. Works without any problem for me.
> 
> best regards
> 
> Wolfgang M�es

Look twice at this approach! This is the UNIX way - everything is a file.

Read about the (now) old OSS audio drivers for block devices - same
data size on every read or write.
Or serial ports for character devices.

/RogerL

-- 
Roger Larsson
Skellefte�
Sweden
0
4/30/2004 12:22:32 AM
Roger Larsson <roger.larsson@skelleftea.mail.telia.com> wrote in message 

> Look twice at this approach! This is the UNIX way - everything is a file.

Is it a good or a bad thing?

Cheers.

Elder.
0
ih8sp4m (52)
4/30/2004 11:48:23 AM
Dan Kegel <dank-news@kegel.com> wrote in message 

> What kind of time resolution do you need?
> 
I presume this question was asked to me.

I am just evaluating how well would Linux (either 2.4 with preemption
and low latency patches or 2.6 with preemption enabled) perform for my
application. Worst case interrupt latency of 400us and thread
activation latency of 4ms are more than acceptable in my application.

Regards.

Elder.
0
ih8sp4m (52)
4/30/2004 12:22:18 PM
Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be> wrote in message news:<Pine.LNX.4.44.0404291542290.9591-100000@srv04.mech.kuleuven.ac.be>...
> On 29 Apr 2004, Mad@Spammers wrote:
> 
> > I want to synchronize a user space thread to an external event that
> > generates an interrupt. 
> 
> Maybe the ongoing work about D-Bus can give you inspiration:
>   <http://freedesktop.org/Software/dbus>
> One of its motivations was/is exactly to be able to do more driver stuff in
> user space, and I got the impression that that was what you are looking
> for...
> 
> Herman

I had a quick look at it. My requirements are much more modest and I'd
rather use native linux resources instead. Still I will look at its
code for some tips.

Elder.
0
ih8sp4m (52)
4/30/2004 12:27:17 PM
Wolfgang M�es wrote:

> - Let your driver register a character interface
> - from your user space thread, do a synchronous read.
> - in your interrupt routine, copy the data and wakeup the
>   waiting thread.

This method would get my vote.  The "send a signal" approach is 
workable, but it can be difficult to get right.  This is especially true 
if your application is already using a number of signals for other things.

YMMV...

John
-- 
John W. Linville
linville@tuxdriver.com

0
linville (5)
4/30/2004 12:40:49 PM
X-No-Archive:yes

A certain Mad@Spammers, of comp.arch.embedded "fame", writes :

>I would appreciate having hints on how to do it or pointers to
>documentation and example code if available.

What you'll need to do is create a device driver with an entry in /dev, 
and then set up a poll()/select() call within it. These can be used to 
inform a user space application that some data has arrived to be 
processed.

Your user space code can open the device and use the above functions 
which among other things provide the ability to block a thread until an 
interrupt is received, etc. Much more elegant than signal processing.

The free book "Linux Device Drivers" covers this subject in detail.

-- 

"Jokes mentioning ducks were considered particularly funny." - cnn.com

0
4/30/2004 9:09:27 PM
X-No-Archive:yes

A certain Mad@Spammers, of comp.arch.embedded "fame", writes :

>> What kind of time resolution do you need?
>>
>I presume this question was asked to me.
>
>I am just evaluating how well would Linux (either 2.4 with preemption
>and low latency patches or 2.6 with preemption enabled) perform for my
>application. Worst case interrupt latency of 400us and thread
>activation latency of 4ms are more than acceptable in my application.

Supposedly the low-latency patch can give worst-case latency of around 
150us, but you'd need to check out how this fits on your architecture.

-- 

"Jokes mentioning ducks were considered particularly funny." - cnn.com

0
4/30/2004 9:11:01 PM
X-No-Archive:yes

A certain Mad@Spammers, of comp.arch.embedded "fame", writes :
>Roger Larsson <roger.larsson@skelleftea.mail.telia.com> wrote in message
>
>> Look twice at this approach! This is the UNIX way - everything is a file.
>
>Is it a good or a bad thing?

Keeps everything nice and simple. There is a consistent way of dealing 
with hardware.

-- 

"Jokes mentioning ducks were considered particularly funny." - cnn.com

0
4/30/2004 9:12:02 PM
"Mad@Spammers" schrieb:
> 
> I want to synchronize a user space thread to an external event that
> generates an interrupt. 

Look at rtc.c in the Kernel source. They provide a blocking read to the
application to have it wait for an event. Her some data is provided to
the application, too.

-Michael
0
5/3/2004 10:34:00 AM
> Supposedly the low-latency patch can give worst-case latency of around
> 150us, but you'd need to check out how this fits on your architecture.
> 


Nope. Linux can't guarantee any worst-case latency at all (I did find
more than 100 msek with the low-latency patch in very rare instances).

-Michael
0
5/3/2004 10:35:35 AM
X-No-Archive:yes

A certain Michael Schnell, of comp.arch.embedded "fame", writes :
>> Supposedly the low-latency patch can give worst-case latency of around
>> 150us, but you'd need to check out how this fits on your architecture.
>
>Nope. Linux can't guarantee any worst-case latency at all (I did find
>more than 100 msek with the low-latency patch in very rare instances).

That's why I was quite careful not to use the word "guarantee".

Clearly if you need hard real time performance, you need to look at 
another OS.

-- 

"Jokes mentioning ducks were considered particularly funny." - cnn.com

0
5/3/2004 1:05:14 PM
Chesney Christ <thegreatsuprendo@hotmail.com> says...
>
>A certain Michael Schnell, of comp.arch.embedded "fame", writes :
>
>>> Supposedly the low-latency patch can give worst-case latency of around
>>> 150us, but you'd need to check out how this fits on your architecture.
>>
>>Nope. Linux can't guarantee any worst-case latency at all (I did find
>>more than 100 msek with the low-latency patch in very rare instances).
>
>That's why I was quite careful not to use the word "guarantee".
>
>Clearly if you need hard real time performance, you need to look at 
>another OS.

"Hard real-time means no surprises or silent failures as system
 configuration changes or load increases. Deadlines will still
 be met. For example, the worst case delay on a 1 millisecond
 thread on the HP Pavilion Notebook (AMD K7) is 12 microseconds. 
                     -http://www.fsmlabs.com/products/rtlinuxpro/


"RTAI's microkernel approach guarantees that the data-acquisition
task will take place on schedule, even while the previously acquired
 and calculated result is written to disk."
  -http://www.elecdesign.com/Articles/Index.cfm?ArticleID=3816&pg=2


"Lineo Solutions, Inc. (Lineo) demonstrated ... hard real-time 
support with Linux .... Deterministic time metrics of the systems
demonstrated ... is as follows.

Interrupt Response Time 5 microseconds 

Task Latency Time 4 microseconds 

Periodic Task Latency Time 20 microseconds 

Timer Clock Accuracy 1 microsecond, Jitter 1 microsecond)"

- http://www.lineo.co.jp/eng/news-events/press-release/20040109.html


"RTAI - the Realtime Linux Application Interface for Linux ... lets
you write applications with strict timing constraints for your
favourite operating system."
                                    -http://www.aero.polimi.it/~rtai/

"KURT-Linux: Kansas University Real-Time Linux: Microsecond timing
resolution and event-driven real-time scheduling..."
           -http://www.ittc.ukans.edu/kurt/documents-noframes.html



-- 
Guy Macon, Electronics Engineer & Project Manager for hire. 
Remember Doc Brown from the _Back to the Future_ movies? Do you 
have an "impossible" engineering project that only someone like 
Doc Brown can solve?  My resume is at http://www.guymacon.com/ 

0
Guy
5/3/2004 3:57:20 PM
X-No-Archive:yes

A certain Guy Macon, of comp.arch.embedded "fame", writes :

>"RTAI's microkernel approach guarantees that the data-acquisition
>task will take place on schedule, even while the previously acquired
> and calculated result is written to disk."
>  -http://www.elecdesign.com/Articles/Index.cfm?ArticleID=3816&pg=2

http://www.aero.polimi.it/~rtai/documentation/articles/guide.html

"What is RTAI?

RTAI means Real Time Application Interface. Strictly speaking, it is not 
a real time operating system, such as VXworks or QNX. It is based on the 
Linux kernel, providing the ability to make it fully pre-emptable. "

Your serve.

[BTW, isn't RTAI a kernel - a microkernel - all by itself ? You could 
say that this isn't actually Linux. Linux runs essentially as a process 
above RTAI. This isn't necessary in an OS such as, for example, 
Greenhills Integrity, which provides guaranteed latency and other 
goodies.]

-- 

"Jokes mentioning ducks were considered particularly funny." - cnn.com

0
5/3/2004 7:12:47 PM
Reply:

Similar Artilces:

Does pthreads in Linux create user or kernel space threads?
Does pthreads in Linux create user or kernel space threads? There seems to be many pthreads implementations. How do I know which is the one installed on my linux box? Thanks Diwa On Oct 14, 5:45=A0am, Diwa <shettydiwa...@gmail.com> wrote: > Does pthreads in Linux create user or kernel space threads? As that term is normally understood, on typical modern UNIX systems, pthreads are kernel threads. That may or may not mean what you think it means. > There seems to be many pthreads implementations. > How do I know which is the one installed on my linux box? You could read the documentation that came with it or ask your vendor. On Linux, you may find getconf(_CS_GNU_LIBPTHREAD_VERSION) to be useful inside a program. From a shell prompt, try "getconf GNU_LIBPTHREAD_VERSION". DS On Oct 14, 8:52=A0am, David Schwartz <dav...@webmaster.com> wrote: > On Oct 14, 5:45=A0am, Diwa <shettydiwa...@gmail.com> wrote: > > > There seems to be many pthreads implementations. > > How do I know which is the one installed on my linux box? > > You could read the documentation that came with it or ask your vendor. > On Linux, you may find getconf(_CS_GNU_LIBPTHREAD_VERSION) to be > useful inside a program. From a shell prompt, try "getconf > GNU_LIBPTHREAD_VERSION". > Thanks David. On my 32 bit box, using getconf in shell gave me NPTL 0.60 On my 64 bit box, I got NPTL 2.4 ...

sending user defined signals from kernel space to user space
Hi all The linux version we are using is 2.4.We have requirement of running a state machine in kernel space .There are four states in the state machine namely. STATE_1,STATE_2, STATE_3 and STATE_4. We have requirement of sending four asynchronous notifications from kernel space to user space for each state change in the state machine. I am able to send two signals namely SIGUSR1 and SIGUSR2 from kernel space to user space for states STATE_1 and STATE_2 respectively. Can any one help me how can I send two more user defined signals from kernel space to user space for STATE_3 and STA...

user space vs Kernel space
when user program is running its in user space when it does system call its in kernel space. so user program in kernel space means kernel is running on behalf of user process. does user space means user mode and kernel space means kernel mode does these spaces have anything to do with virtual address space of process Milind Dumbare wrote: > > when user program is running its in user space when it does system > call its in kernel space. so user program in kernel space means kernel > is running on behalf of user process. > > does user space means user mod...

Writing to kernel space from user space ?
hi all, found a way to write to kernel space by using the call copy_from_user () but need to know the pointer to the kernel space add i need to write to . I need to write to the task_struct , is there someway to get the pointer to the task_struct in user space ? vivekian "vivekian" <viveklinux@gmail.com> writes: > hi all, > > found a way to write to kernel space by using the call copy_from_user > () but need to know the pointer to the kernel space add i need to write copy_from_user and friends are for use in kernel code only. > to . I ne...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the o...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other kernel) will be virtual. This seems rather asinine, so I hardly believe this is how it works. It was also proposed to me that the system only considers how much it - will- give to either user or kernel space. Meaning that at boot up, if a system only uses 2 MBs of Kernel space, only 2 MBs gets mapped from the the total available memory for Kernel space (as there's a cap). Also meaning that those first 2 MBs would be allocated to physical memory. Then as more would be requested more would be allocated for either user or kernel space, straight from physical memory, till it ran out. This sounds like a more solid schema, but at the same time it seems silly to do things on a first come, first serve basis. It seems more reasonable that it would partition each application such that each has some physical memory to work in, and then to use a memory map for anything additional to di...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other ker...

program execution in user space and in kernel space.
HI All, I want to know, what do mean by program execution in user space and program execution in kernel space. What I know is, when program invokes calls any system call, it starts executing in kernel space. But what about in user space? What makes these execution differ? Thanks Gururaja BO On Sep 16, 5:30=A0pm, guru <guru.nav...@gmail.com> wrote: > HI All, > > I want to know, what do mean by program execution in user space and > program execution in kernel space. > > What I know is, when program invokes calls any system call, it starts > executing in kernel space. But what about in user space? What makes > these execution differ? > > Thanks > Gururaja BO Every user process has their address space. It can only access those memory adresses which are their in their address space. If you want access to kernel address space u must go through system call. System calls are the one which has access to kernel address space. zix guru <guru.naveen@gmail.com> writes: > HI All, > > I want to know, what do mean by program execution in user space and > program execution in kernel space. > > What I know is, when program invokes calls any system call, it starts > executing in kernel space. But what about in user space? What makes > these execution differ? The important difference is between the CPU's kernel mode and user mode. To a first approximation, in kernel mode...

reading a file which is in user space from kernel space
HI, Can we read a file which is in user space from kernel space. Idea is : This file is a configuration file which contains info which is needed by the file system. so while mounting i want to read this file and keep it in memory. Regards Gururaja On May 7, 9:31=A0am, guru <guru.nav...@gmail.com> wrote: > HI, > > Can we read a file which is in user space from kernel space. > Idea is : This file is a configuration file which contains info which > is needed by the file system. so while mounting i want to read this > file and keep it in memory. > >...

Communicating Data from User Space to Kernel Space
struct rule{ int proto; char source[15]; }instance; I have written this structure into a file in user space ,say rule.txt . Say this file contains 10 records , i. e 10 instances of the above structure.Now I would like to read the same file in kernel space by a kernel module by reading 1 record at a time. How can i do this ? Is there any other way to do this without using files ? My objective is to read the 10 records from kernel space one record at a time and not the individual bytes. amit wrote: > > Is there any other way to do this without...

Virtual memory
Hi, I m having some questions in Linux memory management. I m considering about 32 bit machine only. If you have a 512 MB of memory, how it is divided between kernel space and user space? What is the link between this division and 3GB userspace and 1 GB kernel space division. Is the 3G/1G division is for virtual memory? Is the total Virtual memory can be 4G only? I mean is it the maximum? Thanks in advance. regards SaranJothy SaranJothy wrote: > Hi, > I m having some questions in Linux memory management. > I m considering about 32 bit machine only. > If you...

user space space slower performer than malloc space
code that writes blanks to the bytes of a user space appears to run 60% slower than the same code that writes blanks to an malloc allocated space. Any ideas why?? here are my timing results: clear user space. 16 meg 100 times. Begin 21.09.25 End 21.09.33 Elapsed 7294 milliseconds clear malloc space. 16 meg 100 times. Begin 21.09.33 End 21.09.37 Elapsed 4755 milliseconds here is my code that writes blanks to a user space: char* pSpace ; memset( &usrspc, ' ', sizeof(usrspc)) ; memcpy( usrspc.name, "TEST17C", 7 ) ; memcpy( usrspc.lib, "QTEMP", 5 ) ; memcpy( replace, "*YES", 4 ) ; sx = 16000000 ; pSpace = api_Quscrtus( conNull, usrspc, &sx, replace ) ; for( Ix = 0 ; Ix < 100 ; ++Ix ) { memset( pSpace, ' ', 16000000 ) ; } similar code that writes blanks to malloc allocated space: sx = 16000000 ; pSpace = malloc( sx ) ; for( nIx = 0 ; nIx < 100 ; ++nIx ) { memset( pSpace, ' ', 16000000 ) ; } Steve Richter wrote: > code that writes blanks to the bytes of a user space appears to run 60% > slower than the same code that writes blanks to an malloc allocated > space. Any ideas why?? > > here are my timing results: > clear user space. 16 meg 100 times. Begin 21.09.25 End 21.09.33 > Elapsed 7294 milliseconds > clear malloc space. 16 meg 100 times. Begin 21.09.33 End 21.09.37 > Elapsed 4755 milliseconds > > here is my...

Kernel Space to User Space Communication in 2.6
To pass data from kernel space to user space we can use netlink sockets. Is there a better or efficient mechanism than netlink in 2.6?? Please advice. Thanks /R -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ramesh wrote: > To pass data from kernel space to user space we can use netlink > sockets. Is there a better or efficient mechanism than netlink in > 2.6?? Please advice. As far as I'm concerned, the best way to pass data from kernelspace to userspace is through the use of the userspace read(2) syscall. - -- Lew Pitcher Master Codewright & JOAT-in-...

accessing user-space addresses from kernel space and vice versa
Hi, my driver needs to share a memory buffer with a user process. This feature isn't really supported by the HP-UX. I tried several approaches: 1.User allocate shared memory segment via the shmat syscall. According to the documents, addresses from the shared memory segment are accessible from all processes and have space ID 0 which I thought would enable me to access this memory from the kernel. Unfortunately, this access caused a kernel crash. 2.The user-process sends a read request with the buffer, the driver using physio locks and maps it and pend the request until the sharing isn...

user space process vs kernel thread
Hi, Is there any way to figure out of a process is a user space process or a kernel thread, using the /proc file system? On Fri, 01 Oct 2010 14:57:30 -0400, Ethan <sam_cit@yahoo.co.in> wrote: > Is there any way to figure out of a process is a user space process > or a kernel thread, using the /proc file system? I'm not sure if this works everywhere, but on my system, all of the kernel threads have a ppid of 2 (pid 2 is kthreadd), so /proc/${ThreadProcessId}/status will have "PPid: 2". Regards, Dave Hodgins -- Change nomail.afraid.org to od...

Need help in understanding the mapping of user-space send, sendto, sendmsg to kernel-space sendmsg
Hello, I am trying to implement my own transport layer protocol in Linux for an experiment. I am going to use socket interface and add my protocol using sock_register. For the proto_ops i can see that the parameters for the sendmsg and recvmsg are (struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags). But there are three types of user api's send, sendto, sendmsg. Of these three only sendmsg contains a parameter for msghdr. I find that the other two api's are incompatible with the parameters supplied by the kernel to my kernel- space sendmsg function. So what happens when we use send and sendto user-space api's? Hope i am clear.. Thanks, Bala ...

High volume event generation in kernel space to be sent to kernel space
Hello! We are implenting a publisher suscriber model communication between drivers in kernel space to user space. we need to add this communication infratructure to the current drivers to notify user space of updates. The communication is async and the volume of events can potentially be high. What are the possible methods to achive this ? Thank you.. High humber of tiny events? Ring buffer will suite. You must have ring buffer + pending IRP queue. If the event occurs - it is either put to the last pending IRP if it exists and there is a room in it. The pending IRP is...

Stack space, global space, heap space
Greetings: I know that variables declared on a stack definitely does not reside in heap space so there is only a very limited amount of stuff that you can store in the stack of a function. But what about the global space? Is that the same as the heap space or is that still a form of special stack? Because once I've seen someone declare a 1 megabyte char array in global space like this: char s[1000000]; and it worked. Regards, Shuo Xiang Shuo Xiang wrote: > > Greetings: > > I know that variables declared on a stack definitely does not reside in heap > space so ther...

are user space app clusters the future of computing? start with say freebsd then load haskell then app from user space establishes cluster membership and prvides user environemnt like plan9 from b
are user space app clusters the future of computing? start with say freebsd then load haskell then app from user space establishes cluster membership and prvides user environemnt like plan9 from bell labs? ...

restore user space containing space pointers
I create a user space and in that space is stored a space pointer to bytes within that space. Basically, a header struct in the space contains a pointer to another location in the same space. When I use RSTOBJ to restore the usrspc from tape the pointers in the space are invalidated. How can I recover the restored pointers? The pointers themselves are intact. In debug I can see that the offset value of the pointer is intact. Even the segment part of the pointer is as it was when the space was saved. I am at security level 40 and assume this has to do with the security level. If that is the case I would like to know how IBM objects recover their pointers when they are restored? -Steve Steve Richter wrote: ... snip ... > When I use RSTOBJ to restore the usrspc from tape the pointers in the > space are invalidated. How can I recover the restored pointers? .... snip ... The user space isn't going to be restored to the same address it was saved from, so your pointers aren't much help. Why not store relative offsets (in bytes)? Chris --- www.brilligware.com Chris Pando wrote: > Steve Richter wrote: > > ... snip ... > > > When I use RSTOBJ to restore the usrspc from tape the pointers in the > > space are invalidated. How can I recover the restored pointers? > > ... snip ... > > The user space isn't going to be restored to the same address it was > saved been testing this. when the space being restored exi...

[News] Linux Kernel Space Analysis: Kernel Mode-Setting (AMD/ATI)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Cost Of ATI Kernel Mode-Setting On Fedora 12 ,----[ Quote ] | One of the articles on Phoronix last week | was entitled Intel Linux Graphics Shine | With Fedora 12, which showed off the nice | state of Intel graphics on this latest Red | Hat release when it came to kernel mode- | setting and its 3D stack with it working | well "out of the box" and offering some | nice performance gains over the earlier | Fedora 10 and Fedora 11 releases. While | the Intel stack may be improved in | Constantine, the ATI support has taken a | hit, as users were quick to point out in | response to last week's article. In | particular, when using the ATI kernel | mode-setting driver in Fedora 12 (which is | the default for pre-R600 hardware), there | is a large performance discrepancy | compared to using the traditional user- | space mode-setting for ATI Radeon | hardware. Today we are looking at what | exactly the performance cost is for using | ATI KMS in this new release. `---- http://www.phoronix.com/scan.php?page=article&item=fedora_12_ati&num=1 Matthew Tippet, ex-AMD Linux guru joins Palm ,----[ Quote ] | Linux community knows Matthew Tippet for | years, since he was one of big pushers for | ATI Linux drivers and put a lot of | personal and professional effort in | improving functionality of ATI hardware on | Linux operating system. Also, Matthew was | one of co-founders of Phoronix Test Sui...

Kernel to user space communication
Hi, Is anyone aware of any performance measurements for kernel to user space data access? The techniques i can think of are netlink sockets, mmap to a dev and ioctl. But i could not find any pointers on which one to use. Regards. victor <ramkumar2579@gmail.com> writes: > Is anyone aware of any performance measurements for kernel to user > space data access? The techniques i can think of are netlink > sockets, mmap to a dev and ioctl. But i could not find any pointers > on which one to use. System call arguments and socket options would be two additiona...

User space access in kernel
Just a quick question, can the kernel access the user memory pointed to by the pointers passed in a system call? I mean does the data sent in a system call need to be copied first to the kernel memory before it can be processed by the kernel? Thanks, Asra Asra wrote: > > Just a quick question, can the kernel access the user memory pointed > to by the pointers passed in a system call? Usually yes, but that depends on the architecture and configuration. > I mean does the data sent > in a system call need to be copied first to the kernel memory before > it can...

Timer in Linux at User Space
hi, i want to a timer in linux.... i am facing lot of problems in that... the case is illustrated below:- i am sending some bytes to some client.. and i want to send at the most 200Kb in one second.. so if within 1 second, no of bytes sent shud not be more than 200kb . if within in timer 200 kb are sent successfully then i just want to sleep for 1 sec and then again send bytes following above condition that tramision should be at the most 200Kb/sec.... so will anybody please tell me how to implement this... i am sending maximum of 1400 bytes per packet ,so for the 200 kB/sec....

Web resources about - Synchronizing user space threads with kernel space in linux - comp.arch.embedded

Synchronizing - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Android App OStream Speeds Up Facebook Experience By Synchronizing Content In Background
Facebook’s newly revamped Android application was rebuilt with a focus on speed, and startup oStream wants to help users of devices on that operating ...

Twitter for iOS and Mac refreshed, gain support for synchronizing DM statuses
Twitter has updated both its iOS and Mac apps with the release of Twitter 5.8 for iPhone and iPad, and Twitter 2.3 for Mac. Both apps now correctly ...

Synchronizing their watches.
A sure sign of the Trump-Cruz conspiracy. Carson's in on it too. AND: If you don't know what I mean by the conspiracy, watch Joe Scarborough ...

Synchronizing The Speed Of Your Brand
How fast do you want your brand to grow? Even the question is loaded. At a time when rapid seems to be the only desirable speed for everything, ...

Joe Sumner: Synchronizing Crowdsourced Movies
Sting's son has a startup that stitches together crowdsourced video to make movies

Gamasutra - Features - Synchronizing Threads in Java-Based Games
The next version of Quake won't be written in Java, but some games do lend themselves to the language. With that in mind, here are some ways ...

Patent US7127509 - System and method for synchronizing objects between two devices - Google Patents
A synchronization system synchronizes objects between a portable computer and a desktop computer. The portable computer is capable of communicating ...

CheerLights: Synchronizing Christmas lights around the globe
They say that the holidays are a time to gather with others, which usually translates into spending time with friends and family. The folks at ...

BitTorrent Brings File Synchronizing Service Sync to NAS Devices
BitTorrent today announced its Sync file synchronization tool has gained support for network-attached storage (NAS) devices. The company has ...

Resources last updated: 3/25/2016 10:06:19 PM