Re: [PATCH 2/4] swait: add the missing killable swaits

2017-07-12 Thread Luis R. Rodriguez
On Fri, Jun 30, 2017 at 12:50:03AM +0200, Luis R. Rodriguez wrote: > ie, I expect the combination of both to fix your issues, not just the last > series I just posted [0]. If you want this in git form you can find all of > the patches bundled on the 20170629-fw-fixes-wait-v4 branch [1]. I just > wr

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-07-07 Thread Linus Torvalds
On Fri, Jul 7, 2017 at 3:27 PM, Davidlohr Bueso wrote: > > Ok sorry, fwiw those were 80-line fixlets I thought were trivial enough > to just fly by. I find them annoying, because it makes it so much harder to see what the patch actually does. In this case, I think that more than 50% of the patch

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-07-07 Thread Davidlohr Bueso
On Fri, 07 Jul 2017, Linus Torvalds wrote: On Tue, Jul 4, 2017 at 7:06 PM, Davidlohr Bueso wrote: So here's something that boots and builds a kernel. Any thoughts? This patch ios just nasty crap. Sorry. It has random whitespace changfes that look entirely unrelated to trhe actual real meat

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-07-07 Thread Linus Torvalds
On Tue, Jul 4, 2017 at 7:06 PM, Davidlohr Bueso wrote: > > So here's something that boots and builds a kernel. Any thoughts? This patch ios just nasty crap. Sorry. It has random whitespace changfes that look entirely unrelated to trhe actual real meat of the patch, and that actually make whitesp

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-07-04 Thread Davidlohr Bueso
On Thu, 29 Jun 2017, Davidlohr Bueso wrote: I'll actually take a look at wake_q for wake_up_all() and co. to see if we can reduce the spinlock hold times. Of course it would only make sense for more than a one wakeup. So here's something that boots and builds a kernel. Any thoughts? Thanks, D

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-30 Thread Krister Johansen
On Thu, Jun 29, 2017 at 09:03:42PM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has odd semantics that are not at all > >> the same as the default

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-30 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:03:42PM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has odd semantics that are not at all > >> the same as the defaul

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-30 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:03:42PM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > >> > >> swait uses special locking and has odd semantics that are not at all > >> the same as the default

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Linus Torvalds
On Thu, Jun 29, 2017 at 12:15 PM, Marcelo Tosatti wrote: > On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: >> >> swait uses special locking and has odd semantics that are not at all >> the same as the default wait queue ones. It should not be used without >> very strong reasons (an

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Marcelo Tosatti
On Thu, Jun 29, 2017 at 09:13:29AM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 6:46 AM, Thomas Gleixner wrote: > > On Thu, 29 Jun 2017, Greg KH wrote: > >> On Thu, Jun 29, 2017 at 03:05:26PM +0200, Thomas Gleixner wrote: > >> > > >> > And who defined that it should not be used in real c

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Jakub Kicinski
On Thu, 29 Jun 2017 16:00:32 -0700, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 3:53 PM, Jakub Kicinski > wrote: > > On Fri, 30 Jun 2017 00:50:03 +0200, Luis R. Rodriguez wrote: > >> On Thu, Jun 29, 2017 at 01:58:22PM -0700, Jakub Kicinski wrote: > >> > On Thu, 29 Jun 2017 21:44:55 +020

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Luis R. Rodriguez
On Thu, Jun 29, 2017 at 3:53 PM, Jakub Kicinski wrote: > On Fri, 30 Jun 2017 00:50:03 +0200, Luis R. Rodriguez wrote: >> On Thu, Jun 29, 2017 at 01:58:22PM -0700, Jakub Kicinski wrote: >> > On Thu, 29 Jun 2017 21:44:55 +0200, Luis R. Rodriguez wrote: >> > > > Since this swake_up() --> swake_up_all

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Jakub Kicinski
On Fri, 30 Jun 2017 00:50:03 +0200, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 01:58:22PM -0700, Jakub Kicinski wrote: > > On Thu, 29 Jun 2017 21:44:55 +0200, Luis R. Rodriguez wrote: > > > > Since this swake_up() --> swake_up_all() reportedly *fixed* the one > > > > wake up > > > > issu

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Luis R. Rodriguez
On Thu, Jun 29, 2017 at 01:58:22PM -0700, Jakub Kicinski wrote: > On Thu, 29 Jun 2017 21:44:55 +0200, Luis R. Rodriguez wrote: > > > Since this swake_up() --> swake_up_all() reportedly *fixed* the one wake > > > up > > > issue it would seem this does queue [0]. That said, I don't see any > > > si

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Linus Torvalds
On Thu, Jun 29, 2017 at 12:40 PM, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 11:59:29AM -0700, Linus Torvalds wrote: >> > at a time... I'm probably missing your point here. >> >> The *reason* they wake up only one seems to be that there really is >> just one. It's some per-cpu idle thread

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Jakub Kicinski
On Thu, 29 Jun 2017 21:44:55 +0200, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 09:40:15PM +0200, Luis R. Rodriguez wrote: > > On Thu, Jun 29, 2017 at 11:59:29AM -0700, Linus Torvalds wrote: > > > On Thu, Jun 29, 2017 at 11:33 AM, Davidlohr Bueso > > > wrote: > > > > On Thu, 29 Jun 201

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Luis R. Rodriguez
On Thu, Jun 29, 2017 at 09:40:15PM +0200, Luis R. Rodriguez wrote: > On Thu, Jun 29, 2017 at 11:59:29AM -0700, Linus Torvalds wrote: > > On Thu, Jun 29, 2017 at 11:33 AM, Davidlohr Bueso wrote: > > > On Thu, 29 Jun 2017, Linus Torvalds wrote: > > > > > >> I actually think swait is pure garbage. Mo

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Luis R. Rodriguez
On Thu, Jun 29, 2017 at 11:59:29AM -0700, Linus Torvalds wrote: > On Thu, Jun 29, 2017 at 11:33 AM, Davidlohr Bueso wrote: > > On Thu, 29 Jun 2017, Linus Torvalds wrote: > > > >> I actually think swait is pure garbage. Most users only wake up one > >> process anyway, and using swait for that is st

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Linus Torvalds
On Thu, Jun 29, 2017 at 11:33 AM, Davidlohr Bueso wrote: > On Thu, 29 Jun 2017, Linus Torvalds wrote: > >> I actually think swait is pure garbage. Most users only wake up one >> process anyway, and using swait for that is stupid. If you only wake >> up one, you might as well just have a single pro

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Davidlohr Bueso
On Thu, 29 Jun 2017, Linus Torvalds wrote: So without some very compelling reason, I'd not want to add yet another wait-queue. Yes, I was expecting this and very much agree. I'll actually take a look at wake_q for wake_up_all() and co. to see if we can reduce the spinlock hold times. Of cours

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Linus Torvalds
On Thu, Jun 29, 2017 at 10:40 AM, Davidlohr Bueso wrote: > > For all the above, what do you think of my 'sswait' proposal? I see no actual users of such a specialty interface. I don't think we've *ever* had any actual problems with our current wait-queues, apart from the RT issues, which were no

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Davidlohr Bueso
On Thu, 29 Jun 2017, Linus Torvalds wrote: Well, I'd actually say it the other way around: swait should not be used in general, only in _very_ particular pieces of code that actually explicitly need the odd swait semantics. swait uses special locking and has odd semantics that are not at all th

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Luis R. Rodriguez
On Thu, Jun 29, 2017 at 04:31:08PM +, Matthew Wilcox wrote: > Linus Torvalds wrote: > > The thing is simply a collection of small hacks and should NOT be used > > in general. > > > > I never want to see a driver use that code, for example. It was > > designed for RCU and RT, and it should damn

RE: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Matthew Wilcox
Linus Torvalds wrote: > The thing is simply a collection of small hacks and should NOT be used > in general. > > I never want to see a driver use that code, for example. It was > designed for RCU and RT, and it should damn well be limited to that. Maybe put #ifndef MODULE around the entire includ

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Linus Torvalds
On Thu, Jun 29, 2017 at 6:46 AM, Thomas Gleixner wrote: > On Thu, 29 Jun 2017, Greg KH wrote: >> On Thu, Jun 29, 2017 at 03:05:26PM +0200, Thomas Gleixner wrote: >> > >> > And who defined that it should not be used in real code? >> >> Linus did, in a different firmware thread. You have to _really

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Thomas Gleixner
On Thu, 29 Jun 2017, Greg KH wrote: > On Thu, Jun 29, 2017 at 03:05:26PM +0200, Thomas Gleixner wrote: > > On Thu, 29 Jun 2017, Greg KH wrote: > > > On Wed, Jun 14, 2017 at 03:20:15PM -0700, Luis R. Rodriguez wrote: > > > Do you really still want to add these, now that we know we shouldn't be > > >

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Greg KH
On Thu, Jun 29, 2017 at 03:05:26PM +0200, Thomas Gleixner wrote: > On Thu, 29 Jun 2017, Greg KH wrote: > > On Wed, Jun 14, 2017 at 03:20:15PM -0700, Luis R. Rodriguez wrote: > > Do you really still want to add these, now that we know we shouldn't be > > using swait in "real" code? :) > > And who d

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Thomas Gleixner
On Thu, 29 Jun 2017, Greg KH wrote: > On Wed, Jun 14, 2017 at 03:20:15PM -0700, Luis R. Rodriguez wrote: > Do you really still want to add these, now that we know we shouldn't be > using swait in "real" code? :) And who defined that it should not be used in real code? Thanks, tglx

Re: [PATCH 2/4] swait: add the missing killable swaits

2017-06-29 Thread Greg KH
On Wed, Jun 14, 2017 at 03:20:15PM -0700, Luis R. Rodriguez wrote: > Code in kernel which incorrectly used the non-killable variants could > end up having waits killed improperly. The respective killable waits > have been upstream for a while: > > o wait_for_completion_killable() > o wait_for_

[PATCH 2/4] swait: add the missing killable swaits

2017-06-14 Thread Luis R. Rodriguez
Code in kernel which incorrectly used the non-killable variants could end up having waits killed improperly. The respective killable waits have been upstream for a while: o wait_for_completion_killable() o wait_for_completion_killable_timeout() swait has been upstream since v4.6. Older kernel