Assign a process to a core on start


 
Thread Tools Search this Thread
Operating Systems Solaris Assign a process to a core on start
# 1  
Old 07-26-2014
Assign a process to a core on start

Hi,

In Ubuntu it is possible to start a process in a specified core using taskset command (taskset 0 myproc it will execute myproc in core 0).

I know it is possible a process(pid) can bind to a core using pbind. But my requirement is to start a process in a specified core.

How it is possible in Solaris?

Thank you.
# 2  
Old 07-27-2014
man psrset
# 3  
Old 07-27-2014
Quote:
Originally Posted by sreejesh
In Ubuntu it is possible to start a process in a specified core using taskset command (taskset 0 myproc it will execute myproc in core 0).
It won't. You should actually run
Code:
taskset 1 myproc

to bind your process to core #0.
Quote:
I know it is possible a process(pid) can bind to a core using pbind. But my requirement is to start a process in a specified core.

How it is possible in Solaris?
You can still use pbind. Just wrap your command with a script that bind itself to the required core then execute the command. As a processor binding is inherited, that would fulfill the requirement. eg:

Code:
#!/bin/ksh
pbind -b 0 $$
exec myproc "$@"

Beware that achenle's processor set suggestion (psrset) is about exclusive processor binding while both Linux taskset and Solaris pbind create non-exclusive binding, i.e. the processor can still be used by other processes. This might not be what you expect.
This User Gave Thanks to jlliagre For This Post:
# 4  
Old 07-27-2014
I do wonder what problem is being solved here. Binding to processors is almost never worthwhile. It might get you somewhat better performance for a memory-latency-bound application on a NUMA machine where you can guarantee your application uses memory with better locality to the processor(s) you bind to, but that's about it.

If you're grasping that hard for every last processor cycle, how much time have you spent profiling your application and improving its performance directly based on profiled performance data?
# 5  
Old 07-28-2014
Processor binding is indeed almost never a proper way to enhance to performance of the bounded process. It might however help improving the performance of other processes by limiting the CPU resources the bounded process can use.

Another usage is to approximate the process performance that would be observed on a single core server while you "only" have a multi-core one to test it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Core Dump of a process in Red Hat Linux 5.9

Hello All, I am new joiner of this forum.I am new to Linux shell scripting. At present I have identified 1 application which stalls very frequently (PID is say xyz) and I am not having much information in its application log to identify the root cause of stalling. I need to take the core dump... (19 Replies)
Discussion started by: Anjan Ganguly
19 Replies

2. Shell Programming and Scripting

Get the process/thread running on which core

I use top -H -p 1256 to show process 1256, and then press "f" then press "j" to display it is running on which core, is there a better mothed, I want to be automated to get this (1 Reply)
Discussion started by: yanglei_fage
1 Replies

3. Red Hat

Process does not dump any core files when crashed even if coredumpsize is unlimited

Hello Im using redhat and try to debug my application , its crashes and in strace I also see it has problems , but I can't see any core dump I configured all the limit ( im using .cshrc ) and it looks like this : cputime unlimited filesize unlimited datasize unlimited... (8 Replies)
Discussion started by: umen
8 Replies

4. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

5. Programming

how to monitor the child process on which cpu core

Hi all. Sorry to express my questions wrongly in my early post,I repost my question again here. My pc has dual core, I wirte an application with two process, parents process and child process. My quetion is how to realize :if the child process is on core 0,it will tell me I'm on core 0,if it... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

6. Shell Programming and Scripting

Script - How to automatically start another process when the previous process ends?

Hi all, I'm doing automation task for my team and I just started to learn unix scripting so please shed some light on how to do this: 1) I have 2 sets of datafiles - datafile A and B. These datafiles must be loaded subsequently and cannot be loaded concurrently. 2) So I loaded datafile A... (10 Replies)
Discussion started by: luna_soleil
10 Replies

7. UNIX for Dummies Questions & Answers

How to force core dump of a process

We have an application that terminates with segmentation violation errors in the logs. No source code is available since this is a third party software that is way past its maintenance life cycle. Under these circumstances is there a way to force a core dump of the process for further analysis?? ... (3 Replies)
Discussion started by: Un1xNewb1e
3 Replies

8. Solaris

coreadm diasble a process from core dumping

Hello All Is it possible to disable a specific process from core dumping ? In my environment I have 2 bespoke application processes which needs to be stopped from core dumping but any other process should be allowed to core dump. If I do : coreadm -d process it will stop all per processes... (3 Replies)
Discussion started by: baner_n
3 Replies

9. UNIX for Dummies Questions & Answers

Getting core id, physical id of running process

Hi All, I need a help. I need to know: 1. the individual core id, physical id of a running process on multicore inside a program. The system file /proc/cpuinfo shows all the ids of all the processes. But I need to know runtime, what exact core id and physical id , the running process has.... (0 Replies)
Discussion started by: debrajde
0 Replies

10. Shell Programming and Scripting

how to start a process and make it sleep for 5 mins and then kill that process

how to start a process and make it sleep for 5 mins and then kill that process (6 Replies)
Discussion started by: shrao
6 Replies
Login or Register to Ask a Question