Sponsored Content
Top Forums UNIX for Advanced & Expert Users Process on CPU inside syscall Post 302696893 by jim mcnamara on Wednesday 5th of September 2012 03:43:58 PM
Old 09-05-2012
When you switch to kernel mode it is usually a hardware operation, which is simply a single op. There is no delay, the process is either in kernel or user, there is no in between. Correct?

Stuff happens on the way through to a syscall. But running the actual syscall itself
involves (usually): enter kernel mode, vector to function call, leave kernel mode.


We may be talking past each other here. Or I don't get the idea of blocked the OP refers to. Are we talking about the interrupt stack? paging?


From vmstat man page on Solaris 10 - this is the only mention of "block"

Quote:
b the number of blocked kernel
threads that are waiting for
resources I/O, paging, and so forth
This has nothing that is special to a syscall entering kernel mode. Lots of other kernel mode code can encounter this condition, too. For a lot of reasons, like a context switch, image loading during an exec call, etc.

On solaris a lot of "blocking" as defined in the man page, does in fact come from starting a child process and executing the image. But that is peculiar to loading an image file into memory with the attendant zero-paging and so on. The libc time call does almost nothing with its syscall in kernel mode, it reads one place in memory. So I am missing something here.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

process -> 1 cpu

Is there a way I can assign processes to different processors? I know in windows xp you can set process affinity, and wondered if there is a *nix equivelant. (2 Replies)
Discussion started by: Solitare
2 Replies

2. UNIX for Dummies Questions & Answers

process not using enough cpu

I am running solaris 9 on a SUn 480r. It is running SAS statistical software, these processes in full flow normally run at about 50-60% cpu (theres nothing else really running on the box) this is fine, and the SAS jobs get run nice and quick. However over the last few weeks everytime a SAS job is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Solaris

How to find which process is using up too much CPU

Hi, I need to find which processes are hogging the cpu up. please advise. Thanks (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

4. AIX

CPU usage of a process

I'm trying to monitor the CPU usage of a process and output that value to a file or variable. I know topas or nmon can tell me this in interactive mode but what I need is topas-looking output that allows me to write to a file after a discrete interval. Unlike nmon data collection to a file on top... (5 Replies)
Discussion started by: robot23
5 Replies

5. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

6. UNIX for Dummies Questions & Answers

100% cpu process

hi guys you know we got an issue and my support line is linux I need to make sure my linux is OK...now the issue I have this process db2sysc reaching 10% CPU utilization yeah that's a DB2 process my DB guys wants to make sure linux is not the culprit but I have no idea the situation is... (3 Replies)
Discussion started by: karlochacon
3 Replies

7. Red Hat

Process by CPU

Hello All, I am preparing a script to capture the processes consuming more CPU. So is there any way that i can sort & redirect to file only those processes consuming more than 5.0 % using ps command itself. Regards Ankit (3 Replies)
Discussion started by: ajaincv
3 Replies

8. Emergency UNIX and Linux Support

CPU and memory utilization of a process, by process name

Can someone please help me with a script that will help in identifying the CPU & memory usage by a process name, rather than a process id.This is to primarily analyze the consumption of resources, for performance tweaking. G (4 Replies)
Discussion started by: ggayathri
4 Replies

9. Shell Programming and Scripting

If a process cpu % is higer than

Is this possible as part of a bigger script to do? eg: elif myprocess.bin cpu% > 12 exit 1 elif is there a command for this? thanks (9 Replies)
Discussion started by: bilboNIX
9 Replies
SYSCALL_MODULE(9)					   BSD Kernel Developer's Manual					 SYSCALL_MODULE(9)

NAME
SYSCALL_MODULE -- syscall kernel module declaration macro SYNOPSIS
#include <sys/param.h> #include <sys/kernel.h> #include <sys/proc.h> #include <sys/module.h> #include <sys/sysent.h> SYSCALL_MODULE(name, int *offset, struct sysent *new_sysent, modeventhand_t evh, void *arg); DESCRIPTION
The SYSCALL_MODULE() macro declares a new syscall. SYSCALL_MODULE() expands into a kernel module declaration named as name. The rest of the arguments expected by this macro are: offset A pointer to an int which saves the offset in struct sysent where the syscall is allocated. new_sysent is a pointer to a structure that specifies the function implementing the syscall and the number of arguments this function needs (see <sys/sysent.h>). evh A pointer to the kernel module event handler function with the argument arg. Please refer to module(9) for more information. arg The argument passed to the callback functions of the evh event handler when it is called. EXAMPLES
A minimal example for a syscall module can be found in /usr/share/examples/kld/syscall/module/syscall.c. SEE ALSO
module(9) /usr/share/examples/kld/syscall/module/syscall.c AUTHORS
This manual page was written by Alexander Langer <alex@FreeBSD.org>. BSD
January 7, 2005 BSD
All times are GMT -4. The time now is 08:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy