Re: how to use cpu affinity from user space

2013-01-22 Thread Peter Hessler
On 2013 Jan 22 (Tue) at 09:25:04 +0500 (+0500), Илья Шипицин wrote:
:Hello!
:
:I'm investigating how program should set cpu affinity, is there any
:examples ? (I didn't find any except the commit that adds cpu affinity
:thing, but there's no user space documentation, no utility, no man page).
:
:cheers,
:Ilya Shipitsin
:

No, this is not possible, and there is no intention to make it possible.

The scheduler will know what CPUs are busy and which ones are not and
will make apprpriate decisions.


-- 
It seems like the less a statesman amounts to, the more he loves the
flag.



Re: how to use cpu affinity from user space

2013-01-22 Thread David Diggles
Then if the scheduler always knows what's best, the backup process will be
completely uninhibited, on a system maxed out on all cores.

On Tue, Jan 22, 2013 at 09:29:43AM +0100, Peter Hessler wrote:
 On 2013 Jan 22 (Tue) at 09:25:04 +0500 (+0500),  ?? wrote:
 :Hello!
 :
 :I'm investigating how program should set cpu affinity, is there any
 :examples ? (I didn't find any except the commit that adds cpu affinity
 :thing, but there's no user space documentation, no utility, no man page).
 :
 :cheers,
 :Ilya Shipitsin
 :
 
 No, this is not possible, and there is no intention to make it possible.
 
 The scheduler will know what CPUs are busy and which ones are not and
 will make apprpriate decisions.
 
 
 -- 
 It seems like the less a statesman amounts to, the more he loves the
 flag.



Re: how to use cpu affinity from user space

2013-01-22 Thread Gregor Best
On Tue, Jan 22, 2013 at 07:56:22PM +1000, David Diggles wrote:
 Then if the scheduler always knows what's best, the backup process will be
 completely uninhibited, on a system maxed out on all cores.
 [...]

What backup process? And why will it be uninhibited? If the system's
maxed out, all processes will neccessarily suffer.

-- 
Gregor Best



Re: how to use cpu affinity from user space

2013-01-22 Thread Gregory Edigarov

On 01/22/2013 12:55 PM, Gregor Best wrote:

On Tue, Jan 22, 2013 at 07:56:22PM +1000, David Diggles wrote:

Then if the scheduler always knows what's best, the backup process will be
completely uninhibited, on a system maxed out on all cores.
[...]


What backup process? And why will it be uninhibited? If the system's
maxed out, all processes will neccessarily suffer.


I think he mean background processes.

--
With best regards,
 Gregory Edigarov



Re: how to use cpu affinity from user space

2013-01-22 Thread David Diggles
I've seen situations where it has been useful to dedicate a core to a backup
process so the nightly backup would complete, on a busy linux
machine, with a cpuset.

If this isn't a planned feature in the near future it's not bothering me.
I'm very happy with what OpenBSD does for me.

On Tue, Jan 22, 2013 at 11:55:51AM +0100, Gregor Best wrote:
 On Tue, Jan 22, 2013 at 07:56:22PM +1000, David Diggles wrote:
  Then if the scheduler always knows what's best, the backup process will be
  completely uninhibited, on a system maxed out on all cores.
  [...]
 
 What backup process? And why will it be uninhibited? If the system's
 maxed out, all processes will neccessarily suffer.
 
 -- 
 Gregor Best



Re: how to use cpu affinity from user space

2013-01-22 Thread Илья Шипицин
I meant OpenBSD feature to use only CPU00 for network things.
and I am afraid it could cause network issues when some process works on
CPU00 as well.


2013/1/22 Gregory Edigarov ediga...@qarea.com

 On 01/22/2013 12:55 PM, Gregor Best wrote:

 On Tue, Jan 22, 2013 at 07:56:22PM +1000, David Diggles wrote:

 Then if the scheduler always knows what's best, the backup process will
 be
 completely uninhibited, on a system maxed out on all cores.
 [...]


 What backup process? And why will it be uninhibited? If the system's
 maxed out, all processes will neccessarily suffer.

  I think he mean background processes.

 --
 With best regards,
  Gregory Edigarov



Re: how to use cpu affinity from user space

2013-01-22 Thread Marc Espie
On Tue, Jan 22, 2013 at 05:37:42PM +0500,  ??? wrote:
 I meant OpenBSD feature to use only CPU00 for network things.
 and I am afraid it could cause network issues when some process works on
 CPU00 as well.

OpenBSD is not a real-time OS.

As far as I know there's no intention to make it so.

However, I will challenge your methodology.

You're afraid does not sound like any kind of serious methodology. Do you
also believe in astrology or homeopathy ?

Did you actually try out what you want to do ? do you have any real reason
to think that tying it to CPU00 will make things better ? do you have any
actual idea what network handling entails ? cpu, network card, disk/io, there
are lots of potential issues there. The best thing to do is to try things out
first.

Then come back with actual numbers if you feel it does not work like you want.


On the other hand, if you're contracting for some work where you need real-time
guarantees, well OpenBSD is probably not the OS for you. And your hardware 
might not be up to it either...



Re: how to use cpu affinity from user space

2013-01-22 Thread Илья Шипицин
I appreciate your attention for homeopathy and astrology, however I see no
relation of those to CPU00.
Maybe modern processors will handle that stuff, I don't know.

I'm running https web reverse proxy.
at 200-500mbit scale, I see 3500 interrupts per second at em0, em1, also 12
cpus are running at 70-80%,
CPU00 is running at interrupt level, also there're user processes at
user and system levels.


under such load server is experience somewhat to general network delays,
network conections become slow (both incoming and outgoing), sometimes even
5 sec on 1G network.


so, I'm looking into optimal em tuning and cpu affinity things.

disk io is not affected.


2013/1/22 Marc Espie es...@nerim.net

 On Tue, Jan 22, 2013 at 05:37:42PM +0500,  ??? wrote:
  I meant OpenBSD feature to use only CPU00 for network things.
  and I am afraid it could cause network issues when some process works on
  CPU00 as well.

 OpenBSD is not a real-time OS.

 As far as I know there's no intention to make it so.

 However, I will challenge your methodology.

 You're afraid does not sound like any kind of serious methodology. Do you
 also believe in astrology or homeopathy ?

 Did you actually try out what you want to do ? do you have any real reason
 to think that tying it to CPU00 will make things better ? do you have any
 actual idea what network handling entails ? cpu, network card, disk/io,
 there
 are lots of potential issues there. The best thing to do is to try things
 out
 first.

 Then come back with actual numbers if you feel it does not work like you
 want.


 On the other hand, if you're contracting for some work where you need
 real-time
 guarantees, well OpenBSD is probably not the OS for you. And your hardware
 might not be up to it either...



Re: how to use cpu affinity from user space

2013-01-22 Thread Rudolf Leitgeb
 under such load server is experience somewhat to general network
 delays, network conections become slow (both incoming and outgoing),
 sometimes even 5 sec on 1G network.

It sounds unlikely that CPU congestion is responsible for 5 s network
delays unless your hardware is significantly underrated. Are you 100%
sure that manually reserving CPUs for specific tasks is going to solve
this dilemma? Note that most of the time when you seemingly run out of
CPU horse power you actually clog your memory bus, and assigning one CPU
to one task won't solve this.



Re: how to use cpu affinity from user space

2013-01-22 Thread Stuart Henderson
On 2013-01-22, Илья Шипицин chipits...@gmail.com wrote:
 I'm running https web reverse proxy.
 at 200-500mbit scale, I see 3500 interrupts per second at em0, em1, also 12
 cpus are running at 70-80%,
 CPU00 is running at interrupt level, also there're user processes at
 user and system levels.


 under such load server is experience somewhat to general network delays,
 network conections become slow (both incoming and outgoing), sometimes even
 5 sec on 1G network.

There are various other possibilities to look at before you go messing
with the scheduler.

Slow network connections - could you be running out of free TCP ports
(including connections in TIME_WAIT if not SO_REUSEADDR) and so the
system has to wait for old connections to close down? 



how to use cpu affinity from user space

2013-01-21 Thread Илья Шипицин
Hello!

I'm investigating how program should set cpu affinity, is there any
examples ? (I didn't find any except the commit that adds cpu affinity
thing, but there's no user space documentation, no utility, no man page).

cheers,
Ilya Shipitsin



Re: how to use cpu affinity from user space

2013-01-21 Thread Brad Smith
On Tue, Jan 22, 2013 at 09:25:04AM +0500,  ??? wrote:
 Hello!
 
 I'm investigating how program should set cpu affinity, is there any
 examples ? (I didn't find any except the commit that adds cpu affinity
 thing, but there's no user space documentation, no utility, no man page).

As far as I know of it isn't possible to do so.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: how to use cpu affinity from user space

2013-01-21 Thread Илья Шипицин
I'm trying to keep CPU00 for network things, and avoid using it for user
applications (there're lots of CPUs).
is it possible to achive it without CPU affinity ?


2013/1/22 Brad Smith b...@comstyle.com

 On Tue, Jan 22, 2013 at 09:25:04AM +0500,  ??? wrote:
  Hello!
 
  I'm investigating how program should set cpu affinity, is there any
  examples ? (I didn't find any except the commit that adds cpu affinity
  thing, but there's no user space documentation, no utility, no man
 page).

 As far as I know of it isn't possible to do so.

 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.