Re: CPU Affinity
Thanks for the reply Peter. May I ask why is not available to userland? Is just a developers decision or is because no one is interested in that functionality? Elias. 2018-04-30 3:32 GMT-03:00 Peter Hessler : > On 2018 Apr 29 (Sun) at 22:07:18 -0300 (-0300), Elias M. Mariani wrote: > :Hi, > :I was trying to port mprime to OpenBSD. > :The main issue is not finding any way to set affinity on cores. > :Searching for how to do this on OpenBSD bring this result in undeadly: > :http://undeadly.org/cgi?action=article&sid=20090324210236 > : > :Is CPU Affinity dropped out of OpenBSD for some reason? > : > :Elias. > : > > CPU Affinity is available inside the kernel only, and is not exposed to > userland. > > There are no plans to make it available to userland. > > > -- > Pardon this fortune. Database under reconstruction. >
Re: CPU Affinity
On Mon, Apr 30, 2018 at 01:02:56AM -0300, Elias M. Mariani wrote: > Hi Anton, > The why is: > An increase in performance. > In this case I want to use some cores to do a very large operation and > it will be faster if the same core continues the same operation. > Maybe there's a library for doing so, or a way that I dont know in OpenBSD. > Now, this cases come not very often, and is debatible (probably > already debated in this proyect) that if that's the case you should > run a variation of the scheduler or use other OS. > And is true... > Now, in this moment I see a lot of activity around vmd/vmm, I have > been using it myself, is great, I love it, but my guess is that you > can get more performance on the guests OS if you set the affinity of > the process. vmd(8) CPU affinity should bethe absolute least of your concerns WRT vmm/vmd performance. There has been basically zero effort to optimize this area yet. -ml > Maybe this is already done, or may will be... If that's the case > either you added functionality to the OS for supporting affinity or > you made vmm part of the OS, and there is the back question. > If you add vmm as part of the OS you are "extending" the system duty > to be a host, if you add affinity support you are doing the same... > Anyways, the proyect clearly knows itself and if there is no affinity > support is OK. Still loving OpenBSD. > The low punch would be discuss about "nice" support, but lets leave > that aside, I dont want a fight like in other post about philosophy > and low punches. > > Now in MY PARTICULAR CASE, I usually do large math calculations, I've > been using other OSes but I love OpenBSD, so I ported my most used > tool, spyder (for writing python). > I love to test algorithms and things for a large time and things like > that. That is my taste, and is not an obligation for OpenBSD to > support affinity just because I want (Its obvious), but I see lots of > applications for "user level programs", for example vmm, pf, and > others components, I dont know if PF and VMM are "user level > programs", if they are you are already doing things that might be seen > as "not OS duty", if they are not, they would benefit probably of > affinity. > > Just my opinion, again, dont do of this remarks something that it is not... > I just kindly ask about a funcionality, because I want to use my > favorite OS, made right, and test algorithms and look for big prime > numbers on it. If there is no funcionality, then, Its my problem... > Elias. > > 2018-04-29 23:15 GMT-03:00 : > > Sun, 29 Apr 2018 22:07:18 -0300 "Elias M. Mariani" > > > >> Hi, > >> I was trying to port mprime to OpenBSD. > >> The main issue is not finding any way to set affinity on cores. > >> Searching for how to do this on OpenBSD bring this result in undeadly: > >> http://undeadly.org/cgi?action=article&sid=20090324210236 > >> > >> Is CPU Affinity dropped out of OpenBSD for some reason? > >> > >> Elias. > >> > > > > Hi Elias, > > > > Why do you want to do the operating system duty in user level programs? > > > > Kind regards, > > Anton Lazarov >
Re: CPU Affinity
On 2018 Apr 29 (Sun) at 22:07:18 -0300 (-0300), Elias M. Mariani wrote: :Hi, :I was trying to port mprime to OpenBSD. :The main issue is not finding any way to set affinity on cores. :Searching for how to do this on OpenBSD bring this result in undeadly: :http://undeadly.org/cgi?action=article&sid=20090324210236 : :Is CPU Affinity dropped out of OpenBSD for some reason? : :Elias. : CPU Affinity is available inside the kernel only, and is not exposed to userland. There are no plans to make it available to userland. -- Pardon this fortune. Database under reconstruction.
Re: CPU Affinity
Hi Anton, The why is: An increase in performance. In this case I want to use some cores to do a very large operation and it will be faster if the same core continues the same operation. Maybe there's a library for doing so, or a way that I dont know in OpenBSD. Now, this cases come not very often, and is debatible (probably already debated in this proyect) that if that's the case you should run a variation of the scheduler or use other OS. And is true... Now, in this moment I see a lot of activity around vmd/vmm, I have been using it myself, is great, I love it, but my guess is that you can get more performance on the guests OS if you set the affinity of the process. Maybe this is already done, or may will be... If that's the case either you added functionality to the OS for supporting affinity or you made vmm part of the OS, and there is the back question. If you add vmm as part of the OS you are "extending" the system duty to be a host, if you add affinity support you are doing the same... Anyways, the proyect clearly knows itself and if there is no affinity support is OK. Still loving OpenBSD. The low punch would be discuss about "nice" support, but lets leave that aside, I dont want a fight like in other post about philosophy and low punches. Now in MY PARTICULAR CASE, I usually do large math calculations, I've been using other OSes but I love OpenBSD, so I ported my most used tool, spyder (for writing python). I love to test algorithms and things for a large time and things like that. That is my taste, and is not an obligation for OpenBSD to support affinity just because I want (Its obvious), but I see lots of applications for "user level programs", for example vmm, pf, and others components, I dont know if PF and VMM are "user level programs", if they are you are already doing things that might be seen as "not OS duty", if they are not, they would benefit probably of affinity. Just my opinion, again, dont do of this remarks something that it is not... I just kindly ask about a funcionality, because I want to use my favorite OS, made right, and test algorithms and look for big prime numbers on it. If there is no funcionality, then, Its my problem... Elias. 2018-04-29 23:15 GMT-03:00 : > Sun, 29 Apr 2018 22:07:18 -0300 "Elias M. Mariani" > >> Hi, >> I was trying to port mprime to OpenBSD. >> The main issue is not finding any way to set affinity on cores. >> Searching for how to do this on OpenBSD bring this result in undeadly: >> http://undeadly.org/cgi?action=article&sid=20090324210236 >> >> Is CPU Affinity dropped out of OpenBSD for some reason? >> >> Elias. >> > > Hi Elias, > > Why do you want to do the operating system duty in user level programs? > > Kind regards, > Anton Lazarov
Re: CPU Affinity
Sun, 29 Apr 2018 22:07:18 -0300 "Elias M. Mariani" > Hi, > I was trying to port mprime to OpenBSD. > The main issue is not finding any way to set affinity on cores. > Searching for how to do this on OpenBSD bring this result in undeadly: > http://undeadly.org/cgi?action=article&sid=20090324210236 > > Is CPU Affinity dropped out of OpenBSD for some reason? > > Elias. > Hi Elias, Why do you want to do the operating system duty in user level programs? Kind regards, Anton Lazarov
CPU Affinity
Hi, I was trying to port mprime to OpenBSD. The main issue is not finding any way to set affinity on cores. Searching for how to do this on OpenBSD bring this result in undeadly: http://undeadly.org/cgi?action=article&sid=20090324210236 Is CPU Affinity dropped out of OpenBSD for some reason? Elias.
Re: how to use cpu affinity from user space
On 2013-01-22, Илья Шипицин 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?
Re: how to use cpu affinity from user space
> 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
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 > 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
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
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 > 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
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
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
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
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
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
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 > 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
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.
how to use cpu affinity from user space
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